how can i get all the system notifications that are shown now? - android

how can i get all the system notifications that are shown now?i want to write a programe that can intercept the notifications that other apps notified.

You cannot interfere with another appliactions notifications so it will not be possible to write such application.

This thread from the Android Beginners Google group answers the question with a solid "No." Quoting a user from the thread:
No, sorry. Intercepting notifications,
in particular, would be quite the
security loophole. In general, on
Android, one application cannot see or
mess with another application's
stuff. So, while your desired features
would be interesting for the OS
itself, they aren't going to be very
practical to implement in an
application written to the SDK.

Related

Best way to determine to current foreground application, Android

This question has been answered elsewhere but all solutions use ".getRunningTask()", which has been depreciated in the most recent API. I am trying to make an app that allows people to monitor their phone use and need to know when an app come to the foreground and when the foreground app changes.
I think if you have a look at this answer you will find what you are looking for:
https://stackoverflow.com/a/27304318/1173391

There is any Android API to record call conversation and/or automatically answer calls?

Scanned through the Android API (reference) documentation, but didn't find specific API that allows one to achieve the following:
Be notified of an incoming call
Automatically answer or reject the incoming call
While a call is in progress, be able to capture the audio
Play a pre-recorded message, after answering the call
The intention behind the questions, as most might have guessed, is to have an automated answering machine type of application. I have seen such applications on Nokia Symbian OS devices.
If such functionality requires rooting the device, I'd still be interested in knowing the API's available once rooted!
As an aside, is there are separate API reference documentation for API's available to rooted devices ?
For the latter parts of your question, No.
Imagine for a second there was, and you had an app installed that uses it. It could record your conversations and send them to a 3rd party. The app might not even disclose that it does this.
That sounds like it would be a huge security problem... Don't you agree?
It would appear I am mistaken about the call recording part - several apps available on google play (such as this, this, and this) does call recording, at least of the user making the call.
For #1, this is covered by marcin_j's answer
For #2, these SO answers show you can accept or reject a call programmatically.
For #3, I did a bit more detailed search on this, which reveals a related Stackoverflow question and answer, which provides info on recording audio (as per the above linked apps). Please keep in mind there are likely legal requirements around recording calls.
For #4 (playing a message to the caller), the only info I was able to find on this says it is not supported. It's hard to find much more info on this with so much clutter on search coming up with apps that are basically an audio version of caller id.
Most of these answers are on StackOverflow already; hopefully bringing it all together here helps you.
You can use android.intent.action.PHONE_STATE broadcast, and check TelephonyManager.CALL_STATE_RINGING state. Requires android.permission.READ_PHONE_STATE.
2/3. Dont think you can do this, at least not on non-rooted phones. Maybe someone else will give better answer.

How to properly monitor and log Android OS events/activity in the background

I would like to know the correct way to monitor system events and operating system activity in Android. My research so far indicates there are various methods for running Activities, Services, BroadCastReceivers, etc. but I don't have an overall comprehensive answer for everything I want to accomplish yet. I did come across an app today called "Carrier IQ" and was wondering how they do it. I believe their app is built into the kernel or at least the phone's OS image, something I want to avoid doing if at all possible.
I know that the Android SDK offers various ways to obtain
Since my app cannot be allowed to be suspended, should it run as a foreground service? If I do this, will I consume too many resources if I need to poll for various activity? I ask this because I don't think I can get everything through receiving events (i.e., using a BroadCastReceiver). I think I need a combination of polling and events.
I want to log sensors, events, OS activity, etc. for a user study. This is NOT for hacking or phishing purposes!
These are the top three projects that I think may accomplish something similar to what I want to achieve, but I have not yet determined if they are viable solutions:
android-hci-extractor
cellbots data logger
android-os-monitor
Does the Android manifest permissions list contain all of the permissions your app will need?
http://developer.android.com/reference/android/Manifest.permission.html
Then you can just ask for permissions when the app is installed and you should be able to access them.

With root access, how do I access the OS-level notification system?

I am using a phone without LED notifications. I would like to dev an app to simulate that, however first, with root, I would like to get access to the notifications system on the OS level (so it can be app-agnostic), to get the notifications.
How can I do so, or where can I read up more about this?
Thank you!
Despite this being old and already having an answer accepted, I want to offer an alternative solution since I think the end goal can be achieved. With all due respect to Mark, I think the direction the question is a little misleading, but the end goal is attainable.
If you are looking for something that would allow you to make an app that listens for notifications and then performs some action based on them regardless of the source app (or could be tailored to specific apps), then I think you can do this without writing firmware or rooting using an Accessibility Service. Accessibility Services would allow access to notifications as they come in, allowing your app to do something with them. You would be able to filter by the source package, get the notification contents, and a lot of other things.
There is a lot I could say on it, but it is still rather new to me, so I'll provide a couple of links to get started.
Accessibility Services page: http://developer.android.com/guide/topics/ui/accessibility/services.html
I would also recommend trying it out for yourself. I came across a small project file that I was able to copy and run on my own as a proof-of-concept. If you run this, you'll be able to see in the log that you really can read notifications: https://gist.github.com/qihnus/1909616
Don't forget to enable the accessibility feature for the app after you install it in your phone's accessibility settings.
You have to write your own firmware. This is not possible from an SDK application, rooted or not.

Android Services

i have a question. I'm developing an Android Application. Actually, i have a thread in background that makes request to an external API in order to get data when the users clicks in different parts of the app.
My doubt is if this "thread" would be better if i implemented it as a service instead of a Runnable class.
Thanks
The point of a service is that it can run while your app is not resident. If you only want the service to run while your app is open then a thread is the probably the best way to do it.
As i learned some days ago, using AsyncTasks is the preferred, painless way in android to do background tasks. Have a look here to get a good tutorial.
http://android-developers.blogspot.com/2009/05/painless-threading.html
bye
If your information can be used by any other application you could use a service or as they are called in Android, a Content Provider. This way you make the information available to all the applications on the phone. This is a great way of encouraging other developers to build their applications with the info that you've provided. This is just something that you should consider, if it's something strictly related to you're application you can go on with the thread just as CaseyB stated.

Categories

Resources