Following this guide https://developer.android.com/training/monitoring-device-state/battery-monitoring.html
I made a receiver that should log battery info to a file
Did you try using wake-locks? Generally app will wake up on the receive of broascast butif it doesnot (happens in few devices), then try using wake-locks which will forcefully wake up the device.
How to use wake-locks :
//Register for wake-locks
if (mWakeLock == null) {
PowerManager pm = (PowerManager)yourcontext.getSystemService(Context.POWER_SERVICE);
mWakeLock = pm.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, yourcontext);
mWakeLock.setReferenceCounted(false);
}
//Apply wake-lock using acquire
mWakeLock.acquire();