Skip to content Skip to sidebar Skip to footer

Android Google Drive Existing_folder_id,existing_file_id

In BaseDemoActivity.java from Google Drive Demo app https://github.com/googledrive/android-demos/blob/master/src/com/google/android/gms/drive/sample/demo/BaseDemoActivity.java what

Solution 1:

The first part, EXISTING_FOLDER_ID,EXISTING_FILE_ID, is answered in SO 21800257, but be careful. You can't just go to a web Drive interface, create a file, copy/paste its resource id ... Google Drive Android API (GDAA) supports only FILE scope, so only files, folders created by your Android App are eligible.

EXTRA_ACCOUNT_NAME is a name of your Google (gmail) account (myaccount@gmail.com). That's the one you would need here:

GoogleApiClientmGac=newGoogleApiClient.Builder(contex)
 .addApi(com.google.android.gms.drive.Drive.API)
 .addScope(com.google.android.gms.drive.Drive.SCOPE_FILE)
 .setAccountName(EXTRA_ACCOUNT_NAME)
 .addConnectionCallbacks(context).addOnConnectionFailedListener(context)
 .build();

but I'm not sure the demo even addresses this. You would use it if your Android App allowed switching between different accounts.

Post a Comment for "Android Google Drive Existing_folder_id,existing_file_id"