In my Application I want to do some action below battery level like 30%, 20% and 10%. The user can select any of the above battery level to perform the operation.
My question is, how can I determine the battery level is 30% or 20% or 10% to perform my work?
I have register a battery broadcast receiver in manifest file as below.
<receiver android:name=".BatteryLevelReceiver">
<intent-filter>
<action android:name="android.intent.action.ACTION_BATTERY_LOW"/>
<action android:name="android.intent.action.ACTION_BATTERY_OKAY"/>
</intent-filter>
</receiver>
But I don't know when will (on what battery level) I receive it in my receiver class? or in other way when will the ACTION_BATTERY_LOW intent get fired (at what battery level)?
Please help!