Thursday 20 August 2020

Connecting Java Gradle With Google Drive | Part 1 | Groovy



You can download library from:- https://unpossiblepog.com/research-and-development/GRADLE+JAVA/Google-Gradle-API-In-Java-For-Google-Drive-And-Google-Calendar

Create a connection between java and google drive using gradle.

Quickstart link:-
https://developers.google.com/drive/api/v3/quickstart/java

Subscribe my Channel:-
http://www.youtube.com/user/SanketRooney?sub_confirmation=1

Facebook Page:-
https://www.facebook.com/UnpossibleNS

Twitter Account:-
https://twitter.com/UnpossiblePOG

Blog :-
https://unpossiblepog.blogspot.in/
------------------------------------------------

Hey guys.
This video is about creating a connection between java and your google drive through gradle.
In this part, we shall display files list in command prompt.
Linux OS is mostly recommended.
Java version 1.8 or greater & also gradle version 2.3 or greater are required.
You will also need google account with google drive enabled.
Open the browser and search “java google drive quickstart”.
Go inside this link.
Check versions in terminal or command prompt before proceeding forward.
Click on “Enable the Drive API” button.
Download configuration.
Create a folder.
Open it in terminal.
Paste the first command.
Select 1 for groovy and for second question, hit enter without typing anything.
It will create basic files & folders for gradle.
Second command will also create 2 more folders.
Now, copy that credentials.json file into src -> main -> resources folder.
Rename it if the file name is not credentials.json.
Go back and open build.gradle file in text-editor.
Paste the gradle code, save it and close it.
Create a java file with same name as they told at location src  -> main -> java.
Open java file in editor. Paste the code.
Remove _READONLY.
SetPageSize decides how many results do you want to be displayed.
I shall type 4.
Now open the command prompt and type “gradle run” and hit enter.
It will open link in browser.
Click on “allow".

Close the tab.
Now if you check terminal, you will see the list of files.
Lets try again, now it will not open any link on browser and will display results directly.
Required links are given in the description.
Don’t forget to like, share and subscribe.
Thanks for watching. 


No comments:

Post a Comment