mendhak/gpslogger

can detect device is charging or not?

PersianCoders opened this issue · 7 comments

Hello

how can I detect device is charging or not ?
on custom URL or other options.
could you add this item on the next version?

thanks a lot

Alright this looks simple enough : https://developer.android.com/training/monitoring-device-state/battery-monitoring#java

And this feature has been requested several times so I'll have a look at adding it.

To answer your question, only battery level is available in custom URL using %BATT. So if I can get this to work I'll add a separate parameter like %ISCHARGING

I've got an APK here: https://github.com/mendhak/gpslogger/releases/tag/v120-rc1 if you are able to test it. Note that the APK is not compatible with F-Droid so if you install it you will lose all previous GPSLogger data.

It's got a CSV field battery_charging and a Custom URL parameter %ISCHARGING

I've got an APK here: https://github.com/mendhak/gpslogger/releases/tag/v120-rc1 if you are able to test it. Note that the APK is not compatible with F-Droid so if you install it you will lose all previous GPSLogger data.

It's got a CSV field battery_charging and a Custom URL parameter %ISCHARGING

that's work well , thanks a lot.
when phone in charging , get true , and when phone is not charging , get false;

Awesome I love to see this new feature. This will come in handy for my project. Thank you for this great app and all the effort.

I wanted to ask, since now we know the phones charging state. Would it be possible to get two different logging interval settings.
One for when the phone is charging and for when the phone is on battery.
That would be really cool to have.
During charging the logging could be every second. And on battery back to power saving eg. every 60 seconds.

It's too complicated to implement that in GPSLogger. I think a better way to accomplish that would be via an automation tool like Tasker or Llama Automate. They can trigger events when charging events occur, and they can send commands to stop logging, switch profile, start logging. What you'd need to do is prepare two profiles, each with different timings.

Thank you for getting back to me and thanks for this idea. I will try this approach with two profiles👌🏼

v120 is in the releases and on F-Droid