(Android) Lower battery usage ideas

I can’t find a good setting that suits my phone for low battery usage.

My ideal performance/battery usage would be :

-to keep the app in the background with minimal cpu usage

-No Sync during sleep (only sync when the user is actively using the phone)

-Instant sync when modifying a local file in a folder covered by Syncthing

-A different automatic sync interval between Wifi and Cellular network. On my phone, Wifi is fast and reliable but my cellular provider is hit and miss. Sometimes it goes super fast, but sometimes it switches to slower networks (3G/2G/Edge) and times out often : in this case it uses a huge amount of power to transfer very little data. If the transfer rate is poor, Syncthing should detect it and abandon any automatic sync operation in progress and try again later.

-Add a global sync interval for the entire device (if a specific folder has a shorter sync interval, ignore this setting and use the global sync interval)

-Change the sync interval interface from “x seconds” to a multiple choice {week, day, 6 hours, 1 hour, 10 minutes, 1 minute, CUSTOM}

-Change the “Wifi-only” mode behaviour : do not send me to the options menu when I open the app. The “Wifi-only” setting is for the periodic automatic sync. The rest of the application should keep working normally.

-add a “Sync now” function. Override any previous setting : no matter the connection, the user wants to sync so do it now.

I don’t think there’s an Android API to find out if the device is currently in use.

This is already done as we use inotify on Android (as long as Syncthing is running).

I’m not sure what to do about this, but I guess this would be something for Syncthing to handle (not the Android wrapper).

We don’t need a sync interval on Android, because of inotify.

The problem is that the entire GUI depends on the Syncthing API to get the data. This might be possible if a global pause was possible in Syncthing.

Yeah, we could probably add an extra button to the dialog for this.

As I unterstand, inotify triggers if files on Android change. But how is Android informed about file changes on other devices?

To clarify the interval: it is not a sync interval but a scan interval. There is no interval for syncing.

Syncthing scans the local folder for changes every 60 seconds (by default). Changes on other devices are detected by that devices and they will immediately inform every connected device about that change.