Skip to main content

GOOGLE DRIVE API (Android Studio Project-Displaying Images From a particular folder from google drive  to Recycler view)






1.Create A new Project in Android Studio 
and API key refer below Link
https://developers.google.com/drive/android/get-started?authuser=1
2.Enable Drive API  ,for your Project from Below link
https://console.developers.google.com/apis/library/drive.googleapis.com
3.Use this below link ton get demo JSON responce
https://developers.google.com/apis-explorer/?hl=en_GB#p/drive/v3/
4.Use this String As a JSON URL Replace the Folder ID id Key with your own
https://www.googleapis.com/drive/v3/files?q='{folder_ID}'+in+parents&key={Your_key_here}
5.once you have Key just check this URL in Postman you will get All files JSON
6. I am using Retrofit2 to for Parsing JSON
{
"kind": "drive#fileList", "incompleteSearch": false, "files": [ { "kind": "drive#file", "id": "19AFwnkh67eiAIclxAb55LMVtze7JHHUG", "name": "mohanlal-600.jpg", "mimeType": "image/jpeg" }, { "kind": "drive#file", "id": "1hYGI-c7V9eHUPl9F_CEhRNQoVjiX6rp2", "name": "dileep.jpg", "mimeType": "image/jpeg" }, { "kind": "drive#file", "id": "1n0YGtzk5WNAFBPF9mQLx5II-Uhh6hv9V", "name": "42141199b151313b1fefc3ba6049544b--nivin-pauly-premam-film-industry.jpg", "mimeType": "image/jpeg" }, { "kind": "drive#file", "id": "1Y2pIBN5WYqv3dXOpARrFpuPOyRzjsyXc", "name": "nivin 3.jpg", "mimeType": "image/jpeg" }, { "kind": "drive#file", "id": "18J9L5HrLUBXBX2NpTIiiHULZtsUTxT9q", "name": "vikram_25416_13.jpg", "mimeType": "image/jpeg" }, { "kind": "drive#file", "id": "1fpg1kU20dCYAKFjs6SFvm2xk3t09qYyL",............>>>>>>>>>>Image Id "name": "be77dcd01c4de4c342b6f5f002afaf90.jpg", "mimeType": "image/jpeg" } ] }

-
---->Folder ID you should replace with your Folder ID.


{ "id": "1fpg1kU20dCYAKFjs6SFvm2xk3t09qYyL",............>>>>>>>>>>Image Id}

you can add more images

FINAL OUTPUT



                     

                         DOWNLOAD FULL Android Studio  SOURCE CODE FROM HERE!

Comments

Latest Posts

Android-Playstore Like RecyclerView With SharedElement Transitions

A simple Project to Demonstrate  A recycle view like Play store ( Android Studio Project-  vertical Recycle view with horizontal recycle view ) JSON: file kept in Asset folder containing , a list of Different Movie list 3.The project Look like view More Single item clicks                        DOWNLOAD FULL PROJECT          for          Android Studio 
Login and Registration using Firestore (Firestore Login And Reigister) ( Android Studio Project ) 1.Register Information To Firestore Database  2. login with these Registered  Informations  3.fully Working with Firestore Database                                DOWNLOAD SOURCE CODE in  Android Studio    1.the Project will look like  Register Login 1.create a Project in Google Fire store and download the respective google service JSON file and Replace with the same file in app folder   2.Down load  the source code for  Android Studio   from the above link and explore google fire store.