android-samples icon indicating copy to clipboard operation
android-samples copied to clipboard

Please provide an example, on how to perform background sync task if I were using GoogleSignIn + DriveClient

Open yccheok opened this issue 7 years ago • 2 comments

Our users have a chance to login, to authorize the app access to their Google Drive. We implement based on GoogleSignIn and DriveClient. (Not the yet another deprecated API GoogleApiClient)

https://developers.google.com/drive/android/auth

After the users quit the app, we would like to Google Drive sync process still work seamlessly in background, without further user/UI interaction. (Able to handle case when login token is expired/invalid after few days/hours)

May I know how to achieve so. Any code example is appreciated.

yccheok avatar May 20 '18 19:05 yccheok

Hi Yan Cheng, we do not have a sample ready for you but in the meantime you can read the documentation here for creating a background service: https://developer.android.com/training/run-background-service/create-service

If you're using Kotlin, here's a related sample: https://github.com/googlesamples/android-JobScheduler

asrivas avatar May 24 '18 21:05 asrivas

@yccheok Have you got any solution to do this?

parmarravi avatar May 22 '19 17:05 parmarravi