I want to detect a program starts on android.
I know i should code a service and broadcast receiver.the problem is i do not know what intent filter should i use?
EDIT1 :
for example i want to know if user wants to start contact manager.
thanks and regards
I don't think this is possible directly through Intents and service/broadcast receivers as this would constitute a major security issue. Take a look at these other proposed solutions. The best one would be to replace the launcher if the user allows it.
Related
I'm working on an application that requires to know when user opens other apps.After some research, I came down to this ActivityManager class and getRunningAppProcesses() method. But they only give me the full list of apps, and won't tell which one is currently open. Then I came down to using getRunningTask() or getRecentTasks() but according to this question, google has deprecated these two methods!
Is there a broadcast for what I'm looking for? I mean like the same way that we receive a broadcast that the screen turns on or things like those!
Is there a broadcast for when user starts and app in Android?
No.
I'm looking to do the following, but have no idea where to start, I have some basic android understanding and hope someone can point me in the right direction.
I have an app. That app waits for an SMS from a certain number. As I understand it's not so hard to accomplish using the content://sms/inbox content resolver.
(this is as far I can manage on my own)
Upon receiving such an SMS I want to open another app (not mine) and press a certain button (or even navigate the UI until i get to it).
Is this possible to achieve? If yes, how?
I don't care how to, it can be a classy solution using libraries meant for it, or it could be brute force "record the touch input", but I really have no idea where to start in order to accomplish this.
The app you want to launch must have certain intents that you can invoke form you app when you recieve the SMS
Intent intent = getPackageManager().getLaunchIntentForPackage("com.thirdparty.package");
startActivity( intent );
It's the first time I post here, and I am a non-native speaker. So please forgive me if there is any bad grammar.
I am working on a project that wants to detect this:
When an app A sends some data to another app B and app B behaves abnormally after receiving the data, the app I wrote should send an notification to users.
For example, app B's memory usage suddenly shoots up to, say, 50%.
However, after searching, I found a post that says it is impossible to detect/intercept explicit intent sent between apps.
Does that mean I have no way to tell whether two apps communicate with each other?
ps: I know that it is possible to detect implicit intents, but that's not what I want.
Thank you!
As you suggested, there is no way to tell whether two apps communicate with each other, so what you're asking simply isn't possible.
I need to know when a certain intent (in my case ACTION_CALL and ACTION_CALL_PRIVILEGED which are called when the user or an app make a phone call) was sent without registering my activity to handle it.
I don't want to interfere with the normal handling of that intent, i.e. the activity that's supposed to handle it should still handle it the usual manner (in my case the OutgoingCallBroadcaster).
I read here a suggestion to drop the ACTION_CALL_PRIVILEGED intent and issue another one, but want to avoid it. Moreover, I don't want to use an activity for the ACTION_CALL and issue another since it will appear in the intent chooser as an option and I want it to be transparent to the user and to always work.
Also working with the ActivityManager object like this suggestion is not recommended for core logic as stated in the documentation of the getRecentTasks method.
Please tell me if this is possible in Android, and if so how.
Thanks,
Amitai
No. This isn't possible. If it were possible it would allow me to write an app that monitors a user's behaviour without him knowing it. ACTION_CALL is an Intent to launch an Activity. You can, of course, intercept this, but that is clearly not what you want to do.
There are broadcast Intents that are sent out during the "call" process. You can monitor these, but you'll have to register to listen for them. Since you indicated that you don't want to register any listeners you are pretty much out of luck.
Which is a good thing, because otherwise people would be able to write a "NastyWare" application.
After many sites searched and googling,
I can't find anything for my problem.
I want to capture the sequence of user interactions on android device. Starting from when the device is powered ON. And one more thing is that I'm not talking about the user event on UI of any application. It's for whole device UI interactions. And if any tools are available then please let me know about it. I didn't get anything about this. Any help or suggestion is well appreciate.
This is not possible, except perhaps via modified firmware, for obvious security and privacy reasons.
I am not sure at what extent it will help you to achive your goal but the best way I know is that:
You need to implement Broadcastreceiver for every action like action android:name="android.intent.action.BOOT_COMPLETED" when your device starts, similarly you need to use all the action which will notify you in your receiver.
You can run a service where you can check which app is running for your record. For this you need to fetch installed app list.