Intercept Android's explicit intents - android

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.

Related

How do I open and use another android app through my own after a certain event?

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 );

Can you send a message to clients who have just joined your access point?

I am wondering if there is a way to send a message to users that have entered your wifi's reach? I am not sure if this is possible or how it's called.
A hint of what to look for or some sample code (if this is possible at all) would be much appreciated!
The only thing that is possible as far as I know is to add software to your accesspoint to do a splash screen (or possibly a login page).
This would not completely solve your use-case, but like the various "free" wifi in bars you do need to log in to first, you need to open a browser first and perform an action, before you have a real connection.
You could just skip the authentication-part, and put your message on the splash screen.
A random example of what you can find on the internet is this: http://www.dd-wrt.com/wiki/index.php/NoCatSplash
I have no experience with it, but it seems to serve above mentioned purpose, and you can easily go from there.
I am aware that this is NOT an android specifi answer, but as far as I know it is not an android specific question: you want to send a message to people connection to your wireless.

Sending android "notifications" to a separate system

Basically I'm trying to get the "notifications" present in the notification bar somewhere else, or something similar in effect.*
Mind the ": I'm not really interested in catching and possibly messing with the original notification, I just want to know that it is there. There seems to be more questions around this topic, but mostly the quality is "I WANT THIS" with an expected "YOU CAN'T" answer. Maybe you (we) can come up with another option?
Things I have come up with, but that seem problematic are:
1:
Catching all send notification's. I don't think you can extend/override/change the current notificationManager. People seem to think this is not needed for non-evil apps. I disagree. But nevertheless I don't know any method that can accomplish this. Another option would mean to ask the manager for the current 'live' notification, but there is no such method I believe. Also the conclusion of these threads:
Global intents that are fired for all Android notifications
Receive Android NotificationManager Notifications from Non-System Apps
Is it possible for an app to replace the NotificationManager? (google groups)
2: Catching Broadcasts. This seems more doable, although not everything has a broadcast available. Apart from that last point: This would mean I would have to find out what broadcasts are available, and act on each one hard-coded. How feasable would it be to let users add their own broadcasts? And how would they know if (and what) their favorite program sends out? (I mean: add their own the app should listen to, not add a broadcast itself obviously)
This might involve something like an activity that catches everything for a certain period of time, and then you make sure you let your program send a notification, hoping it also sends something like a broadcast? Once a broadcast is identified, you want to act on that, but I don't know if you can change your behavior this dynamically.
3: Something completely different that will let me send as many different types of information (user choosable in the end) to an 'outside' place.
* I'm trying to send all notifications to a secondary location (a watch in this case). I can make something for all sorts of different situations (SMS, phone, mail, twitter etc), but this means double bandwith and cpu (battery), and everytime I (or a user) wants to add another type of message, I need to code more.
But nevertheless I don't know any method that can accomplish this.
Correct, short of modifying firmware.
Another option would mean to ask the manager for the current 'live' notification, but there is no such method I believe
Also correct, short of modifying firmware.
And how would they know if (and what) their favorite program sends out?
They wouldn't.
You are certainly welcome to:
Define your own broadcast Intent structure for a broadcast saying "hey, if anyone out there has some sort of extended notification thingy, here's one!"
Create one or more end-user applications that consume such events (e.g., routing to your watch)
Document and evangelize your Intent structure, convincing developers to take advantage of it, either to broadcast such events or consume such broadcasts

How detect a program starts on android?

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.

Application for Child Monitoring

I am starting an application for child monitoring. This would involve mainly the logging of the SMS messages sent and received and logging other activities that may be of interest to the parents. It will also be nice to have something like access control lists for these, too.
Now, as far as I know:
It is not possible to make an app "not uninstallable".
It is not possible to prompt for a password to uninstall an app.
It is not possible to assure that your app is "always" running even if it's getting killed with something like Task Killer, although I think you can respawn the application at given time intervals.
So, any ideas on how to overcome these problems?
There is no way to work around these problems directly without creating your own build of the Android OS. Android always assumes the current user is the owner of the phone and should always be allowed to do whatever they need to do.
It's easy to see why the functionality you need isn't available if you replace "child monitoring" with "malicious data logging" in your question; if Android allowed an app to prevent the user from removing it, it would clearly be open to abuse.
The only thing I can think to do is to have your keep a log of when it is running. This would allow a parent to seen when the app had been running when they viewed the log of the collected data. So if the child had disabled the app the parent would know, but they wouldn't know what had been missed. Although you'd had to be able differentiate between when the phone was switched off and when the app just wasn't running which might not be straightforward.
What you said is true.
Also remember that applications like Task Killer have some sort of blacklist/ignore list so re spawning your app might not make it work.
PS: Without a rooted phone, there is no way you can save your app from a geek kid :)
I was thinking about writing a similar app and considered the same exact scenario. "What if the kid uninstalls the app?"
The only solution I was able to come up with was to have the app periodically ping a server with the a unique ID. Affectively having the app "Check in" with the server a few times a day. Kind of like when prisoner goes on parole. The app is the prisoner and the server is the Parole officer :)
If the app misses a checkin you could treat this as a potential uninstall. However, this could be caused by a lack of network connectivity. I'm sure you could come up with some interesting ways to flag and treat missed checkins. Maybe you could have the app send an SMS checkin or something instead of over HTTP. Then you wouldn't have to depend on Network connectivity.
Once you figure out how to translate missed checkins to an uninstall, you could shoot out an email to the interested party (i.e. the kids parent).
With this option in place, the parent can then have a "Conversation" with their kid before giving them the phone. Something along the lines of:
- "This phone's got parental controls on it. Yes, you do have the ability to uninstall them. However, if you uninstall them I'll know about it and I'll take the phone away."
I think there's definitely a market for this. Need some type of web-interface/dashboard for that parents can log into for monitoring too.
Hope this helps & best of luck.
Cheers!

Categories

Resources