google-drive-android-api

Google Drive SDK - Drive Scopes

99封情书 提交于 2019-12-02 01:18:43
I am trying to use this: https://developers.google.com/drive/android/get-started Which is the Google drive SDK for Android. I want to be able to list all files in a users Google drive account. But only access is given to files and folders that the app created (or that the user selects). mGoogleApiClient = new GoogleApiClient.Builder(this) .addApi(Drive.API) .addScope(Drive.SCOPE_FILE) .addConnectionCallbacks(this) .addOnConnectionFailedListener(this) .build(); Can Google Devs tell me if it is possible to List a users files and folders with this SDK, and retrieve metadata? Only SCOPE_FILE

Why doesn't the Google Drive app on Android send file:// URIs anymore?

淺唱寂寞╮ 提交于 2019-12-01 22:31:56
Google Drive used to send file:// URIs as the data for ACTION_VIEW intents. It now sends content:// URIs instead. Why did this change? As of Feb 17th 2016, the Drive Apps no longer sends file:// URIs to other apps. This was done to improve security and has been encouraged by Android since 2013. Content URIs can be resolved to a ParcelFileDescriptor using ContentResolver as shown: Intent intent = getIntent(); if (Intent.ACTION_VIEW.equals(intent.getAction()) { Uri incomingData = getIntent().getData(); ParcelFileDescriptor pfd = getContentResolver().openFileDescriptor(incomingData, "r"); // Use

Google Drive API - Android - How to obtain a drive file id?

て烟熏妆下的殇ゞ 提交于 2019-12-01 16:19:28
I'm trying to develop an android app that can read a xml file stored in my google drive folder, the idea at first is trying to open the file and handle the content. I've read the Google Drive API docs for android and i reached a point that I'm lost, it's working with file contents. According to this guide the way to open a file from drive is this: DriveFile file = ... file.open(mGoogleApiClient, DriveFile.MODE_READ_ONLY, null).setResultCallback(contentsOpenedCallback);` Searching I realized that the complete code (that they not include there is): DriveFile file = Drive.DriveApi.getFile

Google Drive API - Android - How to obtain a drive file id?

谁说我不能喝 提交于 2019-12-01 15:08:57
问题 I'm trying to develop an android app that can read a xml file stored in my google drive folder, the idea at first is trying to open the file and handle the content. I've read the Google Drive API docs for android and i reached a point that I'm lost, it's working with file contents. According to this guide the way to open a file from drive is this: DriveFile file = ... file.open(mGoogleApiClient, DriveFile.MODE_READ_ONLY, null).setResultCallback(contentsOpenedCallback);` Searching I realized

Unable to get the shared with me files with the Google Drive Api using Filters.sharedWithMe()

*爱你&永不变心* 提交于 2019-12-01 14:14:30
I have some files in my Google Drive that others have shared with me and I would like to be able to query them. Unfortunately the MetadataBuffer' result count is 0 This is the code: private GoogleApiClient mGoogleApiClient; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main_activity); mGoogleApiClient = new GoogleApiClient.Builder(this).addApi(com.google.android.gms.drive.Drive.API) .addScope(com.google.android.gms.drive.Drive.SCOPE_FILE).addConnectionCallbacks(this) .addOnConnectionFailedListener(this).build(); }

Unable to get the shared with me files with the Google Drive Api using Filters.sharedWithMe()

≡放荡痞女 提交于 2019-12-01 12:40:28
问题 I have some files in my Google Drive that others have shared with me and I would like to be able to query them. Unfortunately the MetadataBuffer' result count is 0 This is the code: private GoogleApiClient mGoogleApiClient; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main_activity); mGoogleApiClient = new GoogleApiClient.Builder(this).addApi(com.google.android.gms.drive.Drive.API) .addScope(com.google.android.gms

Drive API - Download/upload sql database

爷,独闯天下 提交于 2019-12-01 07:28:08
问题 Im currently working on downloading my sql database i uploaded with the drive api. There's one backup for sure, but when i try to open the file I get an error that the file is unable to open. EDIT : I solved the problem above. Now i want to finally upload and download the sql database. I found code on the internet to download and upload, but nothing worked. How do i upload and download my sql database correctly? My code: public static void restoreDriveBackup() { Query query = new Query

How to upload a db file to google drive from android application?

为君一笑 提交于 2019-12-01 06:43:26
I want to upload a db file from my app to google drive. I am able to create a folder in google drive but I am not getting how to upload db file . This is my code. import java.io.BufferedInputStream; import java.io.BufferedOutputStream; import java.io.FileInputStream; import java.io.IOException; import android.content.Context; import android.database.Cursor; import android.net.Uri; import android.os.Bundle; import android.os.Environment; import android.util.Log; import android.view.View; import android.view.View.OnClickListener; import android.webkit.MimeTypeMap; import android.widget.Button;

Google Drive Android API (GDAA) getResourceId() returning null (timing issue)

守給你的承諾、 提交于 2019-12-01 05:36:34
When testing of delete, trash functionality discussed in SO 22295903 , I've run into this issue. 1/ Create a file with contents GoogleApiClient _gac; DriveFile createFileWait(DriveFolder fldr, String name, String mime, byte[] buff) { DriveFile drvFile = null; try { ContentsResult rslt = Drive.DriveApi.newContents(_gac).await(); if (rslt.getStatus().isSuccess()) { Contents cont = rslt.getContents(); cont.getOutputStream().write(buff); MetadataChangeSet meta = (mime == null) ? new MetadataChangeSet.Builder().setTitle(name).build() : new MetadataChangeSet.Builder().setTitle(name).setMimeType(mime

How to upload a db file to google drive from android application?

别等时光非礼了梦想. 提交于 2019-12-01 05:29:01
问题 I want to upload a db file from my app to google drive. I am able to create a folder in google drive but I am not getting how to upload db file . This is my code. import java.io.BufferedInputStream; import java.io.BufferedOutputStream; import java.io.FileInputStream; import java.io.IOException; import android.content.Context; import android.database.Cursor; import android.net.Uri; import android.os.Bundle; import android.os.Environment; import android.util.Log; import android.view.View;