as mentioned above, I want to get the total number of battery chrarges. The batery Intent I'm already using only shows me Level, Voltage, Temperature ... but not the total loading cycles.
-
Are you sure this is being tracked? What counts as a battery charge? If it goes for 20% to 30%? Or up to 99%? – Cheryl Simon Jan 10 '11 at 18:11
-
Excellent question. Unfortunately (I don't know definitively), I think the answer is going to be that this isn't tracked or accessible. – Blumer Jan 10 '11 at 18:17
-
yeah, you are right. I thougt I've seen it in the testinfo but I was wrong. so I'm gonna track it myself. – Tobias Jan 10 '11 at 19:59
-
Note: On Android.SE, there's a [related question](http://android.stackexchange.com/questions/78209/is-there-a-battery-cycle-counter-app), in which the users discuss ready-made third-party apps which can keep track of charge cycle count. – unforgettableidSupportsMonica Dec 21 '15 at 17:28
1 Answers
You can register an Intent receiver to receive the broadcast for ACTION_BATTERY_CHANGED: http://developer.android.com/reference/android/content/Intent.html#ACTION_BATTERY_CHANGED.
Broadcast Action: This is a sticky broadcast containing the charging state, level, and other information about the battery. See BatteryManager for documentation on the contents of the Intent.
You can not receive this through components declared in manifests, only by explicitly registering for it with Context.registerReceiver()
. See ACTION_BATTERY_LOW
, ACTION_BATTERY_OKAY
, ACTION_POWER_CONNECTED
, and ACTION_POWER_DISCONNECTED
for distinct battery-related broadcasts that are sent and can be received through manifest receivers.
This is a protected intent that can only be sent by the system.
Constant Value: "android.intent.action.BATTERY_CHANGED
"

- 26,454
- 22
- 137
- 203