Today, I'm implement Google Drive API for Android. I create a folder /Demo/App/Photos and keeps DriveId of Photos to SharedPreferences and I create files or folders here. Everything ok. I'm try remove /Demo and Empty trash via (https://drive.google.com). Problems here, when I run Android app again, ResultCallback code always success when create files, folders or check MetadaResult with folder never existing in Google Drive. Any suggests?
Since the Drive Android API supports offline functionality, it comes with a caveat that the local cache can sometimes be out of date. I suggest using requestSync. This method should not be called too frequently as it is rate limited but should be fine to call when your app starts to ensure local cache is up to date.
Note that create file requests can also fail even if local cache is up-to-date, say for example file was created when the device was offline and parent folder was deleted before the file could be uploaded to the server. To have guarantees on your creation request try using ExecutionOptions in the CreateFile request to get notified about the success/failure state when the file is created on the server.