google-drive-android-api

Android Google Drive SDK - how to show list of files in selected folder

时光毁灭记忆、已成空白 提交于 2019-12-09 18:13:34
问题 I am struggling to get my code to work. I want my app (when a button is clicked) to show all the folders (and files) in the root folder of the drive. But it seems this is not possible since even though I have authorised the app using Ouath2, the app only has access to the files and folder that the user selects. The behaviour is strange in that when the folder picker opens, it only lists the contents of that folder if the contents ARE folders. It will not list any files at all. Could an expert

How to download google drive file in android

笑着哭i 提交于 2019-12-09 02:51:41
问题 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

Getting result.getDriveFolder().getDriveId().getResourceId() always null

人走茶凉 提交于 2019-12-08 12:39:00
问题 Trying to put all files inside folder but getting result.getDriveFolder().getDriveId().getResourceId() always null. i searched and found some links and i tried to go with the steps mentioned in this linkenter link description here Here's my code :- public class MainActivity extends Activity implements ConnectionCallbacks, OnConnectionFailedListener { public ArrayList songsList = new ArrayList(); private static final String TAG = "drive-quickstart"; private GoogleApiClient mGoogleApiClient;

Cannot access Google Drive file

大城市里の小女人 提交于 2019-12-08 12:03:13
问题 I am making a notepad app using Google Drive . Whenever user creates a file in the app, it also creates a file in the Google Drive . And user can enter the text and save the file, the unsaved text will get committed whenever the internet is available. I am managing the update and create processes within the app using the DriveId . If the user wants to use the files with the alternative device using my app, for that I also have the option called DriveId import . By clicking the option DriveId

Error com.google.android.gms.drive.DriveApi.DriveContentsResult cannot be resolved

半城伤御伤魂 提交于 2019-12-08 11:14:52
问题 I am working on Android Google Drive. As of now I am using the github sample code Android Demos. I am getting an error of The import com.google.android.gms.drive.DriveApi.DriveContentsResult cannot be resolved and The import com.google.android.gms.drive.DriveContents cannot be resolved I am using the updated Google play service and I have imported it properly. I am using eclipse 回答1: I remember using 'ContentsResult' in GooPlaySvcs 6.1.+ and switching to 'DriveContentsResult' after installing

Using google drive API to access my own “public” folder android/iOS

ⅰ亾dé卋堺 提交于 2019-12-08 05:06:45
问题 I have a google drive account that i want people within a certain organization to be able to upload files to programmatically, and also as invisible as possible. as i'm following along the google drive SDK tutorials, i can't seem to find anything about uploading a file directly to MY drive account. all the tutorials seem to be talking about allowing users to upload a file to their own account. The other problem is that they seem to all require some user permission (which i don't want). the

Upload image to a google drive using google drive api programatically in android

独自空忆成欢 提交于 2019-12-08 04:55:49
问题 I am able to uploading a text file to folder in google drive using google drive android api .Sample code But i would like to uplaod a image to google drive .Is it possible? code for create text file: final private ResultCallback<DriveContentsResult> driveContentsCallback = new ResultCallback<DriveContentsResult>() { @Override public void onResult(DriveContentsResult result) { if (!result.getStatus().isSuccess()) { showMessage("Error while trying to create new file contents"); return; } final

Upload image to a google drive using google drive api programatically in android

不羁岁月 提交于 2019-12-08 04:12:30
I am able to uploading a text file to folder in google drive using google drive android api . Sample code But i would like to uplaod a image to google drive .Is it possible? code for create text file: final private ResultCallback<DriveContentsResult> driveContentsCallback = new ResultCallback<DriveContentsResult>() { @Override public void onResult(DriveContentsResult result) { if (!result.getStatus().isSuccess()) { showMessage("Error while trying to create new file contents"); return; } final DriveContents driveContents = result.getDriveContents(); // Perform I/O off the UI thread. new Thread(

How to upload a file to GoogleDrive in android

喜你入骨 提交于 2019-12-08 04:11:14
问题 I refer from this code AccountManager am = AccountManager.get(activity); am.getAuthToken(am.getAccounts())[0], "oauth2:" + DriveScopes.DRIVE, new Bundle(), true, new OnTokenAcquired(), null); private class OnTokenAcquired implements AccountManagerCallback<Bundle> { @Override public void run(AccountManagerFuture<Bundle> result) { try { final String token = result.getResult().getString(AccountManager.KEY_AUTHTOKEN); HttpTransport httpTransport = new NetHttpTransport(); JacksonFactory

unable to query the files “shared with me” from google drive using Google drive api android

喜夏-厌秋 提交于 2019-12-08 03:59:47
问题 public class QueryFilesSharedWithMeActivity extends BaseDemoActivity { private ListView mResultsListView; private ResultsAdapter mResultsAdapter; @Override protected void onCreate(Bundle b) { super.onCreate(b); setContentView(R.layout.activity_listfiles); mResultsListView = (ListView) findViewById(R.id.listViewResults); mResultsAdapter = new ResultsAdapter(this); mResultsListView.setAdapter(mResultsAdapter); } /** * Clears the result buffer to avoid memory leaks as soon as the activity is no