Android Google drive App data folder return empty when I use queryChildren

我的未来我决定 提交于 2019-11-27 11:39:19

问题


I'm using the new Google play service drive api to implement backup and restore data with App folder in my android application.I followed the intructions from the google drive developer guides.I can backup and restore data successfully when I only use one device and don't uninstall and reinstall the app.But Problem appears when I use two devices or unintall and reinstall the app.

Scene 1: I install my app on one device and backup data to "App folder" succeed and I can see the data size of my app folder changed in Google drive "Manage apps",then I install my app on another device and try to use "restore from google drive" to restore the data I just backup on the first device.but google drive api returned empty MetadataBuffer.

Scene 2: I install my app on one device and backup data to "App folder" succeed and I also see the data size of my app folder changed in "Manage apps".then I uninstall my app and reinstall it and try to restore the data I backup.the same thing happened.There's no file find in my app folder.

I tried api with both queryChildren and listChildren but no lucky.

Drive.DriveApi.getAppFolder(getGoogleApiClient())
    .queryChildren(getGoogleApiClient(), query)

and

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

Can anyone from google drive team resolve the problem? I think it's a really big bug.we still have no resolve method.


回答1:


We have identified an issue with the API that meant App Folder content was not downloaded after an app was uninstalled then reinstalled. This will be fixed in the next release of Google Play services.

For development purposes, you can work around this issue in the current Google Play services (version 6.1) by clearing Google Play services data (Settings > Apps > Google Play services > Manage Space > Clear all data). We don't recommend suggesting this solution to end users as this will likely clear data relied on by other apps.

Regards,
Daniel



来源:https://stackoverflow.com/questions/23840846/android-google-drive-app-data-folder-return-empty-when-i-use-querychildren

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!