PowerManager is a class in the Android SDK that gives control of the power state of the device.
PowerManager
is a class in the Android SDK that gives you control of the power state of the device.
Device battery life will be significantly affected by the use of this API. Do not acquire PowerManager.WakeLocks unless you really need them, use the minimum levels possible, and be sure to release them as soon as possible.
You can obtain an instance of this class by calling Context.getSystemService().
The primary API you'll use is newWakeLock(). This will create a PowerManager.WakeLock object. You can then use methods on the wake lock object to control the power state of the device.
Reference page: http://developer.android.com/reference/android/os/PowerManager.html