When discharging it returned 1, as i had more than 66% battery
When charging it returned 9. Isn't it supposed to return 8?
I only want to know if the battery is charging or discharging, should i use another funtion?
Re-read the description of BatteryFlag. It actually contains bit flags. The reason it is 9 is because both flags 8 and 1 are set(that's 8 OR 1). To see if charging check flag 8 only, e.g,