How to select files from Google Drive in Android?

Is there any way to run the file collector for Google Drive in an Android application - do something similar to this http://googleappsdeveloper.blogspot.com/2012/08/allowing-user-to-select-google-drive.html . I need to allow the user to select files from the Google drive, so I can use their bytes in my application. Thanks.

+6
source share
2 answers

Yes, there is a file collector in GDAA . The best place to use it is this demo , in particular Intents .

In the demo, you are interested in 2 methods:

  • "Select file with opening activity",
  • and "Select folder with opening activity"

but they are essentially the same, distinguishing only the MIME TYPE filter specified here:

IntentSender intentSender = Drive.DriveApi.newOpenFileActivityBuilder() .setMimeType(new String[] { DriveFolder.MIME_TYPE }) // <--- FOLDER //.setMimeType(new String[] { "text/plain", "text/html" }) // <- TEXT FILES .build(getGoogleApiClient()); 

Luck

+6
source

There is an api for this. I think that this google documentation should help https://developers.google.com/drive/android/queries . I'm not sure how you want to do this.

+1
source

Source: https://habr.com/ru/post/951558/


All Articles