google drive sdk - Get folder in Android application, that was not created via this App -
having google drive account folders , files. want make android application adding , geting files there. class query useful, can work data making application only
the android drive api works https://www.googleapis.com/auth/drive.file scope. means files user has opened or created application can matched query.
help, please, how can add files folder, created via webinterface early?
don't use latest google api, released few weeks ago. works drive.file scope, hasn't yet implemented number of capabilities (e.g. setting multiple parents), , in experience, contains bugs need fixed well.
com.google.android.gms.common.api.googleapiclient
use api instead:
com.google.api.services.drive.drive try { list<string> scopes = new arraylist<string>(); scopes.add("https://www.googleapis.com/auth/drive.appdata"); scopes.add(drivescopes.drive); googleaccountcredential credential = googleaccountcredential.usingoauth2(m_context, scopes); credential.setselectedaccountname(m_account.name); //get token cannot run main thread; //trying token right away see if authorized token = credential.gettoken(); if(token == null){ log.e(tag, "token null"); }else{ log.i(tag, "gdrive token: " + token); g_drive = new drive.builder( androidhttp.newcompatibletransport(), new gsonfactory(), credential).build(); } catch ( userrecoverableauthexception e) { .... }
Comments
Post a Comment