java - How to start service whenever a new application is launched? -


I want to run a service whenever a new application starts on the Android device.

Creating an anti-virus based behavior for the Android system I works by collecting system call trash of these applications. Everything is fine, except that how do I determine the time of service to run so that it can cover all the applications in a way, I schedule it to run at specific intervals. However, every time a new app is launched, it is more logical to run. Once the service started, the system will collect the call data for the running application (I use the Stress Program for that) to send the data to the network on the remote server, which all processed, and ends. Any indication how I can accomplish this (runs a new app on startup) pro-grammatically (yes I have searched extensively before posting this question)?

I do not have enough experience on Android. Are there other ways to stress all the apps installed on Android?

There is no way to inform you when an app launches to launch App Launch Broadcast receiver is not intended for

You start service on device boot receiver Can find and run running apps

> Write a custom receiver to start the service in this way

  Public Series Broad Resource Extends Broadcast Receiver {@ But the relevant context, intent on intent (Override public zeros) {context.startService (new intent (reference, custom service.)); }}   

Register for boot in the manifest.

  & lt; Receiver Android: name = "com.stackwork.app.services.CustomReceiver" & gt; & Lt; Intent-Filter & gt; & Lt; Action Android: name = "android.intent.action.BOOT_COMPLETED" /> & Lt; / Intent-Filter & gt; & Lt; / Receiver & gt;   

In addition, add permission to get the boot full broadcast

  Android: Usage-permission Android: name = "android.permission.RECEIVE_BOOT_COMPLETED" / & Gt;    

Comments

Popular posts from this blog

c - Mpirun hangs when mpi send and recieve is put in a loop -

python - Apply coupon to a customer's subscription based on non-stripe related actions on the site -

java - Unable to get JDBC connection in Spring application to MySQL -