简体   繁体   中英

Download files of specific a MIME type using Google Drive Android API

I am new to Android programming. I am writing an application to download files of a specific MIME type from the Google Drive using the Google Drive Android API. Is this possible? I'm looking for code snippets or links.

Have a read through the Android API's documentation on queries .

Query query = new Query.Builder().addFilter(
    Filters.eq(SearchableField.MIME_TYPE, "text/plain"));

Thanks for answering the question @Dan, but i solved this a week ago using a little bit different approach from yours

Files.List request = mService.files().list()
                                .setQ("mimeType contains 'application/' ");

                        FileList files = request.execute(); 

in the place of application we can put imagess ,videos etc or any mime type application/ downloads all the application files if you want more specific type of file then use 'application/vnd.android.package-archive' for apk files etc.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM