Reputation: 1
I would like to make a battery saving application that will auto start when the battery level gets to 20 percent, meaning it should always be active once installed. I have no I dea how to keep the application listening as well as how to make the application auto start when it gets its desired battery percentage which is 20 percent at which it must autostart
Upvotes: 0
Views: 120
Reputation: 8568
20% is too rigid a scale. As @CommonsWare suggests, an easier, more ideal approach would be for a broadcastReceiver to start your application on ACTION_BATTERY_LOW intent. Keep in mind that that could mean 15%, or even 10% depending on the device make and model.
On a side note, how is this battery saving if you are starting it after your battery level is already low?Perhaps you mean , you want to kill/stop your app when the device battery is low ?
Upvotes: 1