-
Notifications
You must be signed in to change notification settings - Fork 258
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add option to sync if on WiFi only #346
Comments
android docu for this topic https://developer.android.com/training/monitoring-device-state/connectivity-monitoring.html |
Different usecase: I'd like to be able to sync only on a specific wifi (since the wallabag instance runs locally). |
@Eisfreak7 does any other app implement something like that? I wonder if there is a good way to do it. |
Yes, taskwarrior-android. |
What about a Sync Adapter? Wouldn't that be the optimal goal? A "system account" for wallabag, and then let Android's Doze to manage the background sync schedules, to avoid unscheduled sync wakelocks. |
@Fenisu sounds very cool. Can you support here with a pull request? |
I considered Sync Adapter when I was implementing auto sync, but for some reason I decided not to use it. I don't remember why, so I'll probably need to look into it again. |
It might be interesting to implement it if @di72nn does not find any reason to not do it. |
@Fenisu can you compile a list of advantages a Sync Adapter provides? |
@di72nn I'm no expert but the idea would be to avoid unnecessary "independent" wakelocks, so Android and Doze can schedule the syncs when it is better suited. From there, you can also set the network constrains you want, like sync images only from wifi. And to avoid the need of GCM to monitor changes in the server, the sync can be set up to run in intervals. The main disadvantage is that it uses by default both account authenticator and content resolver, but it can be created as dummies to ignore them and skip changing more parts of the application. Although it might be a good idea to move the user credentials to the corresponding part of the system instead of saving them in the shared preferences xml file. |
The app doesn't use any explicit wakelocks (also no implicit, as far as I know). To schedule sync tasks it uses "inexact repeating" of I don't plan reimplementing sync with Sync Adapter myself (at least anytime soon), but you may give it a shot. |
With all the automatic sync options (and the image sync coming in future), i would love to see an option in the app to synchronize only on WiFi connection and not on mobile data plan.
Which one do you think is best? Or should we go for all three (which would add a lot of complexity for sure)?
The text was updated successfully, but these errors were encountered: