2

As far as i understand, there are 2 ways to read battery status:

1) Register a broadcast receiver on "ACTION_BATTERY_CHANGED" and get the values from the Intent using BatteryManager fields.
2) Read values directly from sysfs battery files.

My question is which way is better? what are the pros/cons of each method?

Any help would be appreciated. Thanks!

GrIsHu
  • 29,068
  • 10
  • 64
  • 102
  • what u want from battery. U want to get battery status that how much it remains is this your requirement – Bhanu Sharma Mar 03 '14 at 10:51
  • I want to get as much information as possible (voltage/temp./etc...). if there are some limitations for getting the information in a specific method I will be happy to know about it. @BhanuSharma. Thanks. – user3350774 Mar 04 '14 at 10:08

1 Answers1

0
yurenchen
  • 1,897
  • 19
  • 17