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 You start > Write a custom receiver to start the service in this way Register for boot in the manifest. In addition, add permission to get the boot full broadcast Broadcast receiver is not intended for
service on
device boot
receiver Can find and run running apps
Public Series Broad Resource Extends Broadcast Receiver {@ But the relevant context, intent on intent (Override public zeros) {context.startService (new intent (reference, custom service.)); }}
& 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;
Android: Usage-permission Android: name = "android.permission.RECEIVE_BOOT_COMPLETED" / & Gt;
Comments
Post a Comment