Learning Mobile App Development: A Hands-on Guide to Building Apps with iOS and Android
by Jakob Iversen, Michael Eierman
Monitoring the Battery
Typically, all versions of the Android OS have some sort of battery-level monitoring display so that the user knows when to recharge the device. However, just because the battery level is displayed to the user doesn’t mean that the user will pay attention and plug in the phone or tablet when needed. To avoid complications from the device shutting down during app execution, you may need to monitor the battery within the app so that the app can take necessary precautions if the level gets too low. You may also require the user to have the device plugged in to external power to carry out certain operations that might require a significant power drain.
Monitoring the battery is not crucial to the MyContactList app. However, ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access