Skip to content Skip to sidebar Skip to footer

Detecting Android L Battery Saver

One of the new features of Android L is a battery saver that kicks in at 15%. Is there some way to detect when this is active, so my app will respond correctly? http://www.techn

Solution 1:

android.os.PowerManager has a new method, boolean isPowerSaveMode(). You can download the preview SDK docs at http://developer.android.com/preview/reference.html to see the new APIs.

There's also a broadcast intent ACTION_POWER_SAVE_MODE_CHANGED when this changes.

You might also want to look into the JobScheduler API as this allows you to easily run tasks and only have them execute when there is a sufficient power or a network connection for instance.

Post a Comment for "Detecting Android L Battery Saver"