Android, Detect when other apps are launched -


I'm trying to develop an app that prevents a user from having a specific app without a password is. The scenario is ...

  1. The user clicks the "Email" app (for example)
  2. My app has launched the app
  3. My app confirms that this is the "Email" app
  4. My app opens a view at the top, asking for a password
  5. The user enters the password, If true, my app disappears, the email is "App at the top"

I'm completely fixing it, just part 2 is bothering me, and After several days, reading on broadcasting intents and reading "Android" .intent.action.MAIN "etc. I can not find my test project when my app applet starts.

Can anyone help Can I go about this in the right way, by looking at the new app intent to start, or reading system logs for new intentions, or doing something in the original code?

Anyone The signal will also help, even if you answer it completely I will be able to do some more research, thank you very much, Ian

It seems that we can use the logcat and analyze its output.

I have this permission in all similar programs:

android.permission.READ_LOGS

This means that all of this But it seems the program starts and after that our program (AP Guard) will start and bring it out.

Use the code below:

  Try {procedure mLogcatProc = null; Buffer Reader = Faucet; MLogcatProc = Runtime.getRuntime (). Exec (new string [] {"logcat", "-D"}); Reader = New BufferedReader (New InputStreamReader (mLogcatProc.getInputStream ())); String line; Last stringbuger log = new stringbilder (); String separator = System.getProperty ("line.separator"); While ((line = reader.readline ()) = tap) {log .append (line); Log.append (separator); } String w = log.toString (); Toast. Make Text (getApplicationContext (W), Toast. LNNHHLLG). Show (); } Hold (exception e) {toast. GetApplicationContext, E.Get Message (), Toast. LNNHH_LOG). Show (); }  

And do not forget to add its permission in the manifest file.


Comments