android wake-up action -
Does anybody know that it is possible to force an app to start automatically when applying external power - that is the following scenario: App is running (with permanent external power supply, this will not be a 'mobile' app); - For some reason the external supply fails; - The battery runs low, so the device stops; - Starting external supply; - The app must start automatically, without pressing the Home button or touching the screen, the device will be accessed without access. Will this action be different on the basis of manufacturer's hardware?
From your description, your application is always running, so when you apply external power Why do you want to start?
If your Android device actually stops, then I think you want to start your application on boot. In that case, you will need to type an Android BroadcastReceiver
which gets the effect android.intent.action.BOOT_COMPLETED
. When your receiver is called, you can start the application that you want in the onReiveive (context, intent)
method.
Remember to announce the receiver in your manifest and also add permission android.permission.RECEIVE_BOOT_COMPLETED
.
For example see.
PS If you really want to do something, when the source of power changes, you may want to listen to "android.intent.action.ACTION_POWER_CONNECTED
and related intents for intentions. .
Comments
Post a Comment