Start backup when power comes down to certain %

P

Pankaj S.

Hi,

How can I take a backup of my application when power comes down to say X %.
I want to schedule this task through program?

Thanks in Advance.
Pankaj
 
P

Peter Foot [MVP]

There is no event exposed when power level reaches a specified percentage,
therefore the only alternative is to check on a regular basis the power
status and begin your backup procedure if it is below your threshold.
Polling for this information will be bad for battery life itself so you
should not call this too frequently. If you want this check to take place
while your app is running you can start a background thread which checks the
power status and then sleeps for a while in a loop. If you want to be able
to check this state even when your app isn't running you could use
RunAppAtTime to run a small application at timed intervals to check the
current status.

Peter
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top