0

Is is possible to simulate the battery charging? I mean, I want to beat the phone (android) to beleive it is charging. The power cable is not connected, but the phone should detect, that it is connected.

Is it possible somehow?

opix
  • 71
  • 4
  • You could simulate charging on android emulator. Have a look at second answer: https://stackoverflow.com/questions/16295196/how-to-simulate-low-battery-in-android-devices – bigb055 Oct 10 '18 at 10:45
  • 1
    I want it on a real phone, not in Emulator. I want my phone in real to show that is a charger connected, however it is not. – opix Oct 10 '18 at 11:25
  • If you are wondering how to debug your app and at the same time plug/unplug the charger, you can have a look at [debugging over Wi-Fi](https://developer.android.com/studio/command-line/adb#wireless) as that leaves the USB port available for other use, such as charging. – Markus Kauppinen Oct 10 '18 at 11:31

1 Answers1

1

Sure it is. Once you have installed Android Studio with Android Emulator, you can create new AVD (Android Virtual Device) aka Emulator, run your app on it and simulate battery level via Emulator settings. I checked it some time ago and it works fine.

Piotr Wittchen
  • 3,853
  • 4
  • 26
  • 39
  • I want it on a real phone, not in Emulator. I want my phone in real to show that is a charger connected, however it is not. – opix Oct 10 '18 at 11:24
  • Why do you want to do that? Real device is not an emulator or simulator. It has real battery indication. Once you test emulated battery behavior on the emulator, the real device should behave the same in different use cases. – Piotr Wittchen Oct 10 '18 at 11:32