I am trying to make a Battery Alarm Application. I was reading the Android docs and found out that we don't need to register a BroadcastReceiver. We could do something like this-
IntentFilter ifilter = new IntentFilter(Intent.ACTION_BATTERY_CHANGED);
Intent batteryStatus = context.registerReceiver(null, ifilter);
MY QUESTIONS ARE-
- Does the system broadcast intent(containing battery status) every time the battery level change?
- Do I have to query each time for battery level?
- Also, How to play the alarm when the battery level reaches a particular level(set by the user).