Is It Posssible To Access AwesomePlayer Info And Error Messages From An Application? - android-mediaplayer

I'm an untrained, newbie code hacker playing with a homebrew MediaPlayer for streaming live internet audio. An old fashioned "radio" if you will. I'm using OnInfo, OnError and OnBuffferingUpdate info to fill a "status" textView box on my player, but I see so much more detailed info in logcat from the AwesomePlayer engine. Is it possible to access the AwesomePlayer info directly from the application?

From an application perspective (assuming the application is written in JAVA), MediaPlayer is the abstraction for all player engines. There are multiple player engines such as StagefrightPlayer which internally uses AwesomePlayer and NuPlayer to name a couple.
The information made available on listeners i.e. onInfoListener, onBufferingUpdateListener, onErrorListener originates from AwesomePlayer which is translated into a generic message and is communicated through the listeners. This information is deemed to be sufficient for any application developer to develop their code around the same.
AwesomePlayer logs are more from debug perspective and helps to understand the underlying implementation of the engine. I feel that this information is good to know and understand, but not sure if this is essential for application development.
To summarize, AwesomePlayer information is actually communicated through the listeners which are generic in nature and rest of the logcat information is more for debug or understanding purposes. Currently, there is no scheme to get this information unless the developer explicitly customizes the AOSP distribution.

Related

How do I handle and return a human readable error in a Java Azure Function app?

How do I handle and return a human readable error in a Java Azure Function app?
All examples of this on a Google search, are just simple instructions on how to do a try-catch, which is not my question.
More specfically, how do we design the return status code and the response body of the request, in a way that provides the most flexibility to a wide array of situations?
Given that we are not integrating Spring-Boot in this case, and that we do not have access to anything Spring.
Given that my API generally returns an object that we will call Pojo1, on error, what is the best way to return a informative message.
NOTE: Of course, I do know there are situations where you want security through obscurity, in which case I would probably choose logging errors to app insights. This is not my question though.
Well, you can set custom headers while returning the request. This
can be done using a setHeader function.
You can also use azure service bus or event grid which will carry
specific messages regarding the errors.
Also, you can use azure monitoring which collect all the error and
notify you when everything happens.
Refer this article by Eugen Paraschiv for indepth explanation on how to use setheader.
Refer this documentation on azure service bus and this documentation on event grid.
Refer this documentation on azure monitoring logs.

Why should I use ILogger or Serilog?

As the question suggests, why should I use ILogger or Serilog or any other 3rd party logger for that matter. I have absolutely nothing against either or any 3rd party loggers. I've traditionally always rolled my own, I don't find it difficult or time consuming, more often than not I've just reused/rehashed something I've written before.
I'm not looking to bash anything. But from what I've read they pretty much do what my logger does and that's just simple messages and time stamps so I can see whats going on. I capture this
Date/Time
Message or error message
Module that added the log (name)
Logged in user (if my app has users)
I'm just looking to see what the community thinks
For Serilog, I've recently been through a series of article that explains it fairly well: https://ranjeet.dev/All-about-structured-logging-introduction/
The main reason is to leverage structured logging, which consists in adding machine friendly meta data, on top of classical human friendly string based logging. When you end up with a big system in production, this is a gamer changer, because going through Gb of text files would be very unproductive. Then, on top of that, you get a very well thought framework with addins and integration to easily manipulate your logs.

Monitor process api calls windows 7 vb.net/C# or C++

Currently i'm working on a security monitoring app that continuously monitor new processes created.
For that im using wim and event watcher, witch works fine in VB.NET.
But there are 2 features that im missing.
I need to monitor process API calls, and I've been searching the web like mad, and come up empty.
Basically i need to monitor process WaitForSingleObject, LoadLibraryA, CreateProcessW and WriteProcessMemory. And registry access/changes as well.
Im hoping this can be done without a system wide hook, but form what i can find, it cannot be done via WMI.
So the question is, how to, and what can i do with managed code.
I'm gonna focus on the second point as i don't have experience on your first.
For checking if a process is signed i am using the sigcheck.exe from Mark Russinovich, because of the various methods it uses to verify files. Some are catalogsigned, some have the key embedded, there is iirc another weird method. There is no easy way to do it yourself. Had weird false detections with trying self-built methods to cover all possibilities. Hope that info helps

Integrating System Center Operation Manager [SCOM] with external monitoring tool [Application]

WHAT AM I TRYING TO ACHIEVE
Synopsis:
Trying to create an API or connector for an inhouse monitoring tool that integrates with SCOM [System Center/Microsoft System Operations Manager 2012].
Our tool has a restful page with all the necessary endpoints and simply would like SCOM to read the status of those endpoints.
Thus far according to SCOM documentation and my understanding, I need to build a management pack. And this consists of Authoring tools with visual studio etc.
Whilst I am still going through the documentation on this, whose tackled something like this before. Some guidance on how to approach this would be appreciated.
##### UPDATE [04/01/16] ########
Thinking.... * Plan to create a MP(s) for Discovery, Monitoring and Dashboard.*
New Question...
Created a script using posh that exposes the endpoints needed by SCOM.
+ These need to be converted to a class object (converting posh to xml). - not done yet!
+ Thinking ahead I am not sure what Base Class to use for this discovery script?
A very simple way to do this would be with Web Application Availability Monitoring, which works with any HTTP endpoint. As well as checking availability, this monitor can check the content of the response and raise an alert accordingly.
To get started, use the SCOM console and navigate to Authoring > Management Pack Templates > Create > Web Application Availability Monitoring
This blog is a really good walkthrough of doing that:
http://www.opsmanfan.com/index.php/6-use-scom-2012-to-monitor-a-webapi-without-using-scripts
Some limitations with this approach vs. a custom management pack:
you won't get any control over the alert content (name, desciption etc)
it won't scale well to many monitors (in terms of administrative burden)
you can't represent the health using a complex object model (no classes / discoveries)
If you want to test a large number of URLs with this method, then a community Management Pack called URLGenie might also help:
http://blogs.msdn.com/b/tysonpaul/archive/2015/05/04/urlgenie-management-pack-for-scom-an-easy-solution-for-bulk-website-monitoring.aspx
You are right that custom MP is the right way to do an integration of the custom/third-party monitoring system with SCOM. You have to think about three important things when you are planning your work on such MP:
How you are going to get information from external system
How you are going to persist and use it in SCOM
How you are going to visualize it in SCOM
Let's walk through these three items:
From your intro it looks obvious - your system exposes RESTful API. SCOM (even 2012 or 2016) doesn't have native datasources to parse JSON so you'll need to create custom datasources using Powershell or C# (depends on your experience) . In this case, it might be reasonable to use any standard library to make this job easier.
SCOM has its special object model. You have classes to represent objects, monitors to detect failures/state changes and rules to collect performance metrics and alerts/events. So you'll need to implement Discovery datasources to get data about objects, monitored by your custom monitoring system (such as servers, databases, disks, apps, etc.) and define a class hierarchy to persist these objects in SCOM.
Then you'll need to create datasources for monitors and rules and here you must think before act - what failures, alerts and metrics you want to expose to SCOM. When you have clear understanding of this area - you are good to implement that (again - using PS or C#).
SCOM will give you some OOB visualization after you dome (1) and (2), so in the minimal scenario you'll need to define just a couple of views to show in SCOM console data collected by your MP. In ultimate case - if you want to have some fancy visualization - you'll have to create custom Dashboard. A good option here - use dashboards from SQL Server MP (it was released recently, it's free and it is really cool).
In fact, SCOM is not a monitoring system, but a framework, which has runtime platform, development language, and libraries, so building your own MP is closer to programming than IT administration :)
You also can try to use Silect MP authoring tool, but I'm not sure if it will help you to build custom datasources better than VS.
Good luck!
P.S. feel free to ping me via LinkedIn for more details about MP development.

Instant Messenger API

I need just a simple Objective-C app or API that can send and receive IMs to a single user.
BARE BONES.
I've looked at Skype, but the Objective-C part looks really outdated. AIM is preferred, but anything that can send and receive IMs is perfect.
Is there an API for this? For AIM or Skype?
Examples would be appreciated, and remember, I'm totally new to Obj-C.
I don't know about simple or bare bones, but Adium is a good open-source IM client for OS X written in Cocoa.
UDPATE: You might want to check out this blog post ("Towards an Open Source XMPP Framework for Cocoa"). It looks like the author wanted his own Jabber/XMPP Cocoa framework, too, and has even created a project for it in Google Code.
I am currently working on an Objective-C implementation of the OSCAR (AIM) protocol. It is being updated on GitHub. If I understand what you want to do correctly, the library, although incomplete, will meet your needs. It can send and receive messages, and work with status messages. It can also read the buddy list if you are interested in that. The entire library should be finished by the end of the month, and you can check it out on GitHub:
https://github.com/unixpickle/LibOrange
Signing on is this simple:
login = [[AIMLogin alloc] initWithUsername:username password:password];
[login setDelegate:self];
if (![login beginAuthorization]) {
NSLog(#"Failed to start authenticating.");
abort();
}
Once signed on, sending messages works like this:
AIMMessage * reply = [AIMMessage messageWithBuddy:[message buddy] message:#"Test"];
[theSession.messageHandler sendMessage:reply];
Obviously, you can check out the sample on GitHub, but I thought I would put that sample code to wet your appetite. Enjoy!
I don't know exactly how hard it would be to use, but isn't there an open source library for accessing IMs called libPurple? maybe you should check that out and see what it can do in Xcode.
If it's for a small scale deployment, it would be pretty easy to roll your own using Distributed Objects. I've heard it can be problematic trying to use DO for a high traffic Internet service though.