0

If I understood according to this post: Listing files and folders of GDrive using Google Drive Api

We can not with the API googledrive explore the contents of files that were not created by our app.

So how do apps, like ES Explorer, Solid Explorer and others?

what is the difference between these two approaches:

DRIVE API :https://developers.google.com/drive/android/folders
REST API : https://developers.google.com/drive/web/quickstart/android

I have already integrated the API of Box DropBox year in my app ... without too much difficulty.

With Drive is not at all clear!

Community
  • 1
  • 1
Aristide13
  • 244
  • 2
  • 16
  • Please see if this [answer](http://stackoverflow.com/questions/32760028/get-all-folders-google-drive-api-on-android/32760777#32760777) suffice – seanpj Sep 28 '15 at 19:56

1 Answers1

0

On Android, both APIs (GDAA and REST), will produce a list of objects (files / folders) you are interested in. In this 'first shot', you can investigate any of the objects' metadata (REST's metadata set is richer than GDAA's). See the 'search()' method here (REST) and here (GDAA).

If this is not sufficient, your app can pull the file's content (there is no content in folder) and investigate the content. See the 'read()' method or both implementations mentioned above.

Now, your comment 'We can not with the API googledrive explore the contents of files that were not created by our app.' probably points to a different issue, mentioned here.

Good Luck

Community
  • 1
  • 1
seanpj
  • 6,735
  • 2
  • 33
  • 54
  • Yes it's what the link above explain too... I'm working on your code (REST) and also on the QuickStart ... I do not understand whether it is complicated to get childrens of folder by id ....to get the path! ... in comparison with other APIs such as DropBox or Box is ... crazy !! I'm going to repost a question !!! :) Thanks – Aristide13 Sep 30 '15 at 09:27
  • There is no 'path' in the GooDrive universe. The file system is flat (unique ID - ResourceId is the only anchor) and the tree structure is 'faked' by parent pointers. It also causes confusion in different areas. like the fact that you can end up with a file/folder with multiple parents, multiple files/folders with the same title (metadata) in the same 'subdirectory', etc. Try to model simple things like delete, rename,.. in this scenario. It will be very different from 'standard' OS file structure. – seanpj Sep 30 '15 at 12:13
  • It also means that relying on file name (title), path (which is a chain of titles) in the GooDrive universe is dangerous (they are not unique). Using logic like IF TITLE NOT EXIST ... CREATE TITLE will bite you considering that GDAA also introduces latency / delays. So you have to structure the app VERY differently than standard OS tree structure where TITLE / PATH is a unique id/anchor. – seanpj Sep 30 '15 at 12:20
  • I try to recreate a tree to explore fichiers.Pour start normally I try to list the files in a folder, starting with the root of the drive !! I post a question here but unfortunately not normally publish ...[my pour post](http://stackoverflow.com/questions/32866603/how-to-get-list-of-children-in-folder-with-rest-drive-api-android) – Aristide13 Sep 30 '15 at 13:18