My application uses BatteryManager.BATTERY_PROPERTY_CURRENT_NOW to get the device’s battery current:
BatteryManager batteryManager = (BatteryManager) context.getSystemService(Context.BATTERY_SERVICE);
int current = batteryManager.getIntProperty(BatteryManager.BATTERY_PROPERTY_CURRENT_NOW), context);
However, it does not work, for example, on the Samsung Galaxy Tab. There it returns only 0.
Other applications show current even on this device. How do they do it? What are the alternatives to my method?
source
share