Alex
Alex

Reputation: 350

Google Drive API - Get folders list

I have some folders in Google Drive (lets assume, that I have them in the Root folder).

How can I parse them from Drive as folderName and driveId?

I'd like to do it with Google Drive API Google Drive API, not with REST.

Upvotes: 0

Views: 743

Answers (2)

Marco C.
Marco C.

Reputation: 1412

If you have a bit of experience with rxjava I would suggest you to take a look at this library: https://github.com/francescocervone/RxDrive Otherwise you could do the same things without rxjava, official documentation has some examples for basic operations, also this quickstart might help

Upvotes: 0

pr0gramista
pr0gramista

Reputation: 9008

You need to setup Google Drive API for Android in your project. Everything is in guides/documentation on Google Drive API site. Here is link to get started

Then you will do like this:

  1. Get root folder by calling DriveApi.getRootFolder
  2. Get children of the root folder by calling method listChildren (Link to documentation) on folder returned in step 1
  3. Process result by getting Metadata from buffer
  4. Get file by calling DriveID object method asDriveFile() (Link to documentation)

Upvotes: 3

Related Questions