I read throughly development documents, sample code and SO related Q&A, it seems the Google Drive Android SDK doesn't include any functionality to automatically sync local folders. Therefore I am going to build one by my own, and here is the strategy:
- Get files list of local folder
- Get files list of remote folder
- Store to status file (json string or database table with file name, parent folder name, location (local or remote), status (synced, uploading, downloading, in queue))
- Create a sync service to upload or download file if folder is not synced (when any file is not synced status)
- update status file if any remote change, and start sync service (using drive change event)
- update status file if any local change, and start sync service (using FileObserve)
During searching, I found the Transfer data using sync adapters lesson but I am not sure if it is useful for this case.