google-drive-android-api

How to download google drive file in android

≡放荡痞女 提交于 2019-12-01 03:16:16
I wanted to download file from google drive. For this I have implemented in Google Drive SDk and used the following method. @Override protected void onActivityResult(int requestCode, int resultCode, Intent data) { switch (requestCode) { case REQUEST_CODE_OPENER: if (resultCode == RESULT_OK) { DriveId driveId = (DriveId) data.getParcelableExtra( OpenFileActivityBuilder.EXTRA_RESPONSE_DRIVE_ID); } finish(); break; default: super.onActivityResult(requestCode, resultCode, data); } } I also tried using output stream but not able to save data to a file. I have tried searching around this, but couldn

Google Drive Android api - Downloading db file from drive

萝らか妹 提交于 2019-11-30 20:13:54
问题 I am using the below code for downloading an already uploaded sqlite db file from google drive to the data/data/packagename/databases folder, but when the method completes, I am seeing a db corruption warning message logged in logcat and also all the data on the device for the app is overwritten and shows up blank, upon opening the app. mfile = Drive.DriveApi.getFile(mGoogleApiClient, mResultsAdapter.getItem(0).getDriveId()); mfile.openContents(mGoogleApiClient, DriveFile.MODE_READ_ONLY, null

App Folder files not visible after un-install / re-install

|▌冷眼眸甩不掉的悲伤 提交于 2019-11-30 09:05:27
问题 I noticed this in the debug environment where I have to do many re-installs in order to test persistent data storage, initial settings, etc... It may not be relevant in production, but I mention this anyway just to inform other developers. Any files created by an app in its App Folder are not 'visible' to queries after manual un-install / re-install (from IDE, for instance). The same applies to the 'Encoded DriveID' - it is no longer valid. It is probably 'by design' but it effectively

Android - access Google Drive appdata folder from another device, but same app

放肆的年华 提交于 2019-11-30 07:32:34
My app is setup to allow backups to be saved to a Google Drive appdata folder. It all works perfectly well on the same device. When I make a backup, delete the app's data, then restore it all works. However, when I try to backup on one device, then install on another and attempt to restore there are no files found. Same goes for when I uninstall the app on the original device, reinstall it on the same device and attempt to restore. Both cases result in no files being found despite the fact that I see there are files in the appdata folder when I log into Google Drive. I read somewhere that you

Using Google Drive to backup and restore SQLite Database

主宰稳场 提交于 2019-11-30 06:47:23
I've managed to create a backup of my database on an SD card and restore from there but realized that the purpose of my backup is to ensure the safety of the data and in this case if the physical device itself is damaged, lost, or spontaneously combusts so will the backup on the SD card. So having the backup in the same place as the original in this case, quite frankly defeats the purpose of having a backup. So I thought of using Google Drive as a safer place to keep the db file, that and it's free. I've taken a peek into Google's quickstart demo which I got working just fine. But I still have

Creating a folder inside a folder in google drive android

最后都变了- 提交于 2019-11-30 04:45:28
问题 I want to integrate Google drive with my app I have registered my app in Google Developers Console. I got a sample from https://github.com/googledrive/android-demos .By this i am able to create a file,folder in Google drive's root folder but the problem is I couldn't create a file or folder inside an existing folder. In such case i got a toast "Cannot find DriveId. Are you authorized to view this file?" ie I cannot get the driveID public class CreateFolderInFolderActivity extends

Android Google Play / Drive Api

不羁的心 提交于 2019-11-29 21:18:02
问题 Hi I'm using the Google Drive Api to store a database using the AppDataFolder facility. I have a test app running successfully on one device. I am able to upload/update/delete/download the database file and reintegrate it into the program with no problems. The issue I'm having is when I want to share this database with another device running the same app, then things don't work as expected. Example device A I upload the database, device B - I want to download the database but no file is found

How to identify Drive ID?

本秂侑毒 提交于 2019-11-29 17:14:54
The new Google Drive Android API has 2 types of string IDs available, the 'resource' ID and the 'encoded' ID. 'encoded' id from DriveId.encodeToString() "DriveId:CAESHDBCMW1RVVcyYUZKZmRhakIzMDBVbXMYjAUgssy8yYFRTTNKRU55" 'resource' id from DriveId.getResourceId() "UW2aFJfdajB3M3JENy00Ums0B1mQ" In the process I end-up with a string that can contain any one of them (result of some timing issues). My question is: If I need to 'parse' the string in order to identify the type, is there a characteristic I can rely on? For instance: ' encoded ' id will always start with 'DriveId:' substring ' resource

Files created by the NEW Google Drive Android API (GDAA) not showing up

孤者浪人 提交于 2019-11-29 16:59:41
First, everything looked OK until yesterday (Mar 12, 2014). Since about lunch time, files (not folders) created by GDAA are not showing in the Web Drive interface anymore. A few showed up with a considerable delay (3+ hours) and nothing since. The Android GDAA find/search facility shows both the files (including contents) and folders, but the Web Drive has only folders. I use this code to test it , but I've tried the official demo as well with the same result. Fixed by emptying the Google Play Services cache using standard Android device Settings -> Apps -> Google Play Services -> Clear Cache

get metadata of all files and folders in Google Drive

 ̄綄美尐妖づ 提交于 2019-11-29 13:05:42
I am implementing Google Drive in one of my Android application. I am able to authenticate. Here in this method I want to list down metadata of all the files and folders. Drive.DriveApi.fetchDriveId(DemoUtil.getGoogleApiClient(), <drive_id>) .setResultCallback(idCallback) But this is not working. It requires drive id, from where I'll get this drive id? Can I get the metadata listing of all files and folder of Google Drive? I am using API of play services. First, be aware of the fact, that using GDAA ('API of play services') will give you only the files, folders created by your Android App,