in my application i display the battery level.. i get the battery level in this way:
int level = battery.getIntExtra(BatteryManager.EXTRA_LEVEL, -1);
And it's ok i can see the percentage.. but online i found another way:
int level = battery.getIntExtra(BatteryManager.EXTRA_LEVEL, -1);
int scale = battery.getIntExtra(BatteryManager.EXTRA_SCALE, -1);
float batteryPct = level / (float)scale;
What's the difference? Why i would divide the level with the scale? Thanks