What is the best way to sync files or documents to cloud


Say I have few files on the android device. I would like to have a two way sync to the cloud. Should I schedule jobs using work manager or use foreground service. Do it only WiFi cause files may be huge.

Just want to know how to architect this syncing mechanism.


I would go with WorkManager and detect a wifi connection. You’ll want to make sure that the Wifi connection is not a captive portal either (where you have to log into the wifi with email and accept terms of service - very common at hotels and coffee shops).


Agree. Work manager works well with this case.