35046

Android Google Drive EXISTING_FOLDER_ID,EXISTING_FILE_ID

Question:

In <strong><em>BaseDemoActivity.java</em></strong> from Google Drive Demo app

<a href="https://github.com/googledrive/android-demos/blob/master/src/com/google/android/gms/drive/sample/demo/BaseDemoActivity.java" rel="nofollow">https://github.com/googledrive/android-demos/blob/master/src/com/google/android/gms/drive/sample/demo/BaseDemoActivity.java</a>

what i have replace in EXISTING_FOLDER_ID,EXISTING_FILE_ID,EXTRA_ACCOUNT_NAME

Please provide steps to get this values

/** * DriveId of an existing folder to be used as a parent folder in * folder operations samples. */ public static final String EXISTING_FOLDER_ID = "????"; /** * DriveId of an existing file to be used in file operation samples.. */ public static final String EXISTING_FILE_ID = "????"; /** * Extra for account name. */ protected static final String EXTRA_ACCOUNT_NAME = "????";

Thanks

Answer1:

The first part, EXISTING_FOLDER_ID,EXISTING_FILE_ID, is answered in <a href="https://stackoverflow.com/questions/21800257/where-did-the-createfromresourceid-go" rel="nofollow">SO 21800257</a>, 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 <strong>your</strong> 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:

GoogleApiClient mGac = new GoogleApiClient.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.

Recommend

  • Load image without autoscaling in Android
  • how to load css classes from my own project specfic css in Sitecore's RAD editor?
  • C# COM Component Fails To Read Config When Loaded Into An Unmanaged C++ App
  • Firefox extension testing and developing - I'm confused
  • How to get the url of a file of google drive to download in android
  • Custom locale in Android
  • Emit new line in Inno Setup preprocessor
  • How to format code on aptana 3?
  • Correctly Importing Apache Commons Math Package
  • Zend Framework + Doctrine1.2 project structure with more modules
  • Iterate through permissions on a file in the windows file system in C#
  • How do I change the kernel/python version for iPython?
  • Relative paths. baseUrl and paths not working on ionic2 - angular2
  • Getting unread count in Sent Folder using Google Apps Script - GMail
  • How to turn (A, B, C) into (AB, AC, BC) with Pig?
  • apply a javascript function to draggable copy
  • How to install node-mysql?
  • Best way to dynamically load an xml configuration file into a Flex4/Flash movie at runtime?
  • Android Studio Can't Find tools.jar
  • msbuild create itemgroup from property group
  • Android changing fragment order inside FragmentPagerAdapter
  • How do I include a SWC in an AS2 Flash project?
  • Web.config system.webserver errors
  • cygwin cannot exec 'git-add--interactive' permission denied
  • Force show.bind execution
  • Create DicomImage from scratch using Dcmtk
  • Groovy: Unexpected token “:”
  • Disable Enter in editText android
  • Change Inet root folder for iis 7
  • Paperclip, set path outside of rails root folder
  • Join two tables and save into third-sql
  • Convert array of 8 bytes to signed long in C++
  • Proper folder structure for lots of source files
  • Load html files in TinyMce
  • Understanding cpu registers
  • Linking SubReports Without LinkChild/LinkMaster
  • Append folder name and increment by 1 using batch script
  • Easiest way to encapsulate a HTML5 webpage into an android app?
  • Recursive/Hierarchical Query Using Postgres
  • Running Map reduces the dimensions of the matrices