Reputation: 272
I'm Developing an Android Application where it's constantly required to keep the App up an running at all time. with the phone connected to a power outlet at all time, Is it possible that if the phone's battery died to Auto-start up the app with no user intervention . *i.e to power up the phone automatically without hitting any power button and start up android since charger is connected. * then start up my app with android.intent.action.BOOT_COMPLETED and RECEIVE_BOOT_COMPLETED permission
PS: I have tried android.intent.action.ACTION_POWER_CONNECTED but it only works if the phone is already powered up.
Upvotes: 8
Views: 21303
Reputation: 531
No way doing it if you do not root your device and add reboot scripts to the programs running to show battery charging pictures when device is turned off and charging.for Samsung s2 here is an answer
Upvotes: 1
Reputation: 87
I have the same problem.
The solution that i will to implement:
1.- get out two(here is my doubt, ¿what two wires?, because i see three, i will use my multimeter for see continuity between wires when i push the button) wires from the power button phone.(when you push that button, it just connect two poles like a switch).
2.- When you have the two wires, so, we build a little circuit with a timer like a 555(integrated circuit). The purpose of the circuit will connect the two wires(from power button phone) by a 5 seconds period every 15minutes.
Obviously this circuit will be running always.
Upvotes: -1
Reputation: 21
I have exactly same requirement as yours.
Can we plan a solution like this:
The Android device is always connected to charger's output. Charger's power supply is connected to a custom made hardware device which controls power supply to charger. This hardware device puts charger off until battery is getting low. i.e. 20% remaining. Once battery is less than 20%, that device automatically switch on the charger. The "custom made hardware" gets it input from android device itself via USB/WiFi/Bluetooth.
Just a thought. May not be practically possible.
Upvotes: 2
Reputation: 2613
Maybe you can make an additional app that waits for the BOOT_COMPLETED with its BroadcastReceiver and then check wether the power is connected and start as a new Intent your application?
Just a quick thought..
Upvotes: 0