android - Trouble with google drive -


i want create application browsing files in google drive located in root folder. problem can set permissions creating , browsing files. have browse files upload in google drive via browser.

@override protected void onresume() {     super.onresume();     if (mgoogleapiclient == null) {         mgoogleapiclient = new googleapiclient.builder(this)                 .addapi(drive.api)                 .addscope(drive.scope_file)                 .addscope(drive.scope_appfolder) // required app folder sample                 .addconnectioncallbacks(this)                 .addonconnectionfailedlistener(this)                 .build();     }      mgoogleapiclient.connect();  } 

to retrieve files root folder use drive.getrootfolder method.

the getrootfolder returns drivefolder , can used interact root folder. method return synchronously, , safe invoke ui thread.

drivefolder folder = drive.driveapi.getfolder(getgoogleapiclient(), result.getdriveid()); folder.listchildren(getgoogleapiclient()) .setresultcallback(metadataresult); 

public static final scope scope_file scope gives 'drive.file' access user's drive. scope give per-file access files have been created by, or opened app.

the scope implements safeparcelable describes oauth 2.0 scope request. has security implications user, , requesting additional scopes result in authorization dialogs.

here's sample demo app, demo app illustrates possible ways talk drive service use of interfaces available in google play services: https://github.com/googledrive/android-demos/


Comments

Popular posts from this blog

javascript - Slick Slider width recalculation -

jsf - PrimeFaces Datatable - What is f:facet actually doing? -

angular2 services - Angular 2 RC 4 Http post not firing -