9

I have used the new Google Play services 4.3 to back-up my app data to the "App Folder" from Google Drive. I followed the instructions from this link Storing Application Data. I checked in "Manage Apps" and the file seems to be added. If I try to list the children of the App Folder, they are returned successfully.

The issue appears when I install the app on another device (properly synced), or if I uninstall and install the app again on the same device. When I tried to list the children of the App Folder, the count returned is 0.

PS: I tried querying with both:

Drive.DriveApi.getAppFolder(mGoogleApiClient).listChildren(mGoogleApiClient)

and

Drive.DriveApi.getAppFolder(mGoogleApiClient).queryChildren(mGoogleApiClient, query)
Rahul Sharma
  • 347
  • 1
  • 16
  • You have the same user/app on both devices? When you say "properly synced" what are you doing to verify this? There may be some delay on a newly installed device until the changes are synced from the server. – Cheryl Simon May 22 '14 at 21:42
  • Yes I have installed the same app from IDE and the Google Account is the same. Basically I am going in the device settings and manually start the sync for "Sync App Data" and "Sync Drive". When it's done it says "Last synced on *current time*". The file is uploaded to the server (verified in Manage Apps) so I'm expecting the call to retrieve it now. – user3655685 May 24 '14 at 08:48
  • 2
    Sorry its a little confusing, but those sync settings are for the Drive app itself, not for usage via the API. Thus, it doesn't tell you anything about if the API has full data yet. Instead, you can use the requestSync method, or open the file picker and manually select "refresh". – Cheryl Simon May 27 '14 at 16:33
  • 1
    had the same problem; calling Drive.DriveApi.requestSync(GoogleApiClient) seems to address this... – Stefan Haustein May 30 '14 at 23:58

1 Answers1

4

There is a known issue regarding syncing App Folder content after app uninstallation and reinstallation. For cross device backup, we recommend using requestSync() to ensure App Folder content is synced before attempting to restore.

Community
  • 1
  • 1
Daniel
  • 1,239
  • 1
  • 13
  • 24