google-drive-android-api

Create or Open native Google documents using GoogleDriveApi

我是研究僧i 提交于 2019-12-22 00:21:23
问题 I have been closely following the documentation for the Google Drive Android API and, all works great. I can create new text documents and read them back in using the mime type of text/plain . What I cannot do is create a native Google "Document" or "Spreadsheet." Actually, I can create them by using the mime type to application/vnd.google-apps.document or application/vnd.google-apps.spreadsheet as per Supported MIME Types documentation. If, however, I try to write content to these documents,

List files from Google Drive and get downloadUrl for selected file in Android

霸气de小男生 提交于 2019-12-21 21:38:29
问题 I am trying to show a list of files the user has on their Google Drive from my Android app and once the user has selected a file, I want to get the downloadUrl and the Bearer token for that account to give it to my application server to download it. I have been looking around and it seems very confusing. There are 2 SDKs, Android SDK and Java SDK ( REST based) for Google Drive. I successfully was able to get the list of files and display it using the Android SDK (I did not have to build any

GoogleApiClient onConnectionFailed with statusCode=SIGN_IN_REQUIRED

扶醉桌前 提交于 2019-12-21 02:34:46
问题 I'm trying to connect my app to Google play service to access Google Drive but It showing me connection failed with statusCode SIGN_IN_REQUIRED. But it seems to behave like that just 3 days ago. I am also checked developer console of google. They may have changed something in the API which i am unable to figure out. Your help will be welcome. My Code: /** * Create a new file and save it to Drive. */ private void saveFileToDrive(final byte[] data) { // Start by creating a new contents, and

get path from Google Drive URI

眉间皱痕 提交于 2019-12-20 21:06:23
问题 I'm using Android file selection and selecting files from app storage (images, videos, documents). I have an function "getPath" . Im getting path from uri. I have no problem with gallery images or download documents. But when i select a file from google drive i cant get path. This is the google drive uri "content://com.google.android.apps.docs.storage/document/acc%3D25%3Bdoc%3D12" Can you help me about it ? This is also my "getPath" function. public static String getPath(final Context context

com.google.android.gms.common.api.ApiException: 17: API: Drive.API_CONNECTIONLESS is not available on this device

六眼飞鱼酱① 提交于 2019-12-20 10:52:07
问题 Here is the story. I had integrated Google Drive Android SDK (8.1.0) into my app (AnyCopy) around three years ago. And I followed the tutorial to set up properly including adding credentials and api key. Everything worked okay. I could backup and restore my data without any problem. Even today it works okay if I download it from Google Play. Recently I have been trying to refactor AnyCopy and integrate the newest Google Drive Android SDK (Google Play Service Version number 12.0.1 )into my app

How to get list of all folders and files from google drive in android

て烟熏妆下的殇ゞ 提交于 2019-12-20 07:28:37
问题 I have started developing a app in which i have to list of all folders and files from google drive. I have go through all the documentation and below demo links as suggested in this stack overflow answer, https://github.com/googledrive/android-demos And https://github.com/seanpjanson/RESTDemo I have make these both demo working properly. But I am not able to list out all the folders and files of google drive. Currently i can only list out those files which are created by app only . If there

Accesing google drive API for a specific account

家住魔仙堡 提交于 2019-12-20 05:53:47
问题 I'm trying to access google drive through my android app for a specific account. In addition, I also have sign in with google option, so that users can login to the app through google+ and this will be the google account which play services is using. However, I want to store some files on a specific google drive account say abcd@gmail.com . I tried using the GoogleAPIClient by specifying DRIVE API, required scopes and an account name as 'abcd@gmail.com', which looks something like below:

Enforce Drive API for Android to work online mode only

↘锁芯ラ 提交于 2019-12-20 05:25:10
问题 Recently, I just manage to migrate Drive API related code from Google APIs Client Library for Java to Google Play services client library The following code is search a file in appdata folder, then download it as temp file. private static GoogleCloudFile searchFromGoogleDrive(GoogleApiClient googleApiClient, HandleStatusable h, PublishProgressable p) { DriveFolder driveFolder = Drive.DriveApi.getAppFolder(googleApiClient); final String titleName = ("my-title"); Query query = new Query.Builder

Android Drive API Invalid parent folder error

风格不统一 提交于 2019-12-20 05:15:29
问题 I used Android Drive Api to upload my files on Drive.I created a folder("NewFolder") on Google Drive root and created a inner folder("InnerFolder") inside my "NewFolder" from android app using following code.Then I write my files on this "InnerFolder" from my android app. My app create the "InnerFolder" on first time installation on my device only.Then uninstall and reinstall App will not created folder again(Stored created folder Drive Id(like DriveId:yrjundeen12cnfe) in local file). My Code

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

故事扮演 提交于 2019-12-20 01:42:11
问题 Google Drive used to send file:// URIs as the data for ACTION_VIEW intents. It now sends content:// URIs instead. Why did this change? 回答1: 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