Drive API for Android: how to list every entry in Google Drive folder (also those not created by my app) -
i'm using google drive folder backup info app. don't use app folder since want user able upload files same folder (for example, upload backup obtained else).
the code use following:
query query = new query.builder() .addfilter(filters.eq(searchablefield.title, backupname)) .build(); driveapi.metadatabufferresult result = mdrivefolder .querychildren(mgoogleapiclient, query) .await(); if (result == null || !result.getstatus().issuccess()) { return null; } metadatabuffer buffer = result.getmetadatabuffer(); if (buffer.getcount() == 0) { buffer.close(); return null; } metadata m = buffer.get(0); //get first
this way, can find backup file if uploaded app through backup function. if upload drive file desktop, or create new document testing purposes, not found. (and drive can correctly see files, either app or not, , owner).
so, tried list , log folder contents:
driveapi.metadatabufferresult result = mdrivefolder.listchildren(mgoogleapiclient).await(); if (result == null || !result.getstatus().issuccess()) { return null; } metadatabuffer buffer = result.getmetadatabuffer(); for(metadata m: buffer){ log.d(tag, m.gettitle()+" - "+m.getoriginalfilename()); }
and files uploaded app logged.
so, how can every content of folder app, irrespective of source? missing something?
it not possible google drive sdk. should use http-requests it.
Comments
Post a Comment