In order to simulate battery charging and discharging, is there a way to write a script to change the battery level of the virtual device?
Asked
Active
Viewed 911 times
0
-
Why would you want to do that? I think it would be dangerous if programmers could decide whether the device is charging or not. It could confuse the phone – Max Dec 13 '13 at 08:53
-
1@MaxMommersteeg: `In order to simulate battery charging and discharging`? – tilpner Dec 13 '13 at 08:53
-
@MaxMommersteeg StackOverflowException said it for me. There could be many motivations. I know that with emulator it is possible to do it, however it suffers from many limitations: it's slow, doesn't support graphics, doesn't support bluetooth. If one needs to use all these features while monitoring battery level, he simply cannot use emulator. I know that one could simulate battery with a "EmulatedBattery" class, but I wanted to know if it was possible to do it directly in the virtual machine. – HAL9000 Dec 13 '13 at 08:59
-
@HAL9000: Note that [Genymotion](http://www.genymotion.com/) got a battery control inbuilt! – tilpner Dec 13 '13 at 09:05
-
@StackOverflowException Thank you, it looks good, I will consider it. – HAL9000 Dec 13 '13 at 09:09