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. 


Monday 17 August 2020

Root Cause & Solution Of The UnsupportedClassVersionError | Linux Only |...




Error: A JNI error has occurred, please check your installation and try again
Exception in thread "main" java.lang.UnsupportedClassVersionError: JavaProgram has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0

Commands:-
update-alternatives --config java
update-alternatives --config javac

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.
Now we shall find out the root cause & solution of the UnsupportedClassVersionError which occurs while running java program for LINUX users only.
This thing occurs when we successfully compiles the code using javac command but throws an error when we run the program.
Lets create a program.
I am opening the terminal where our java file is present.
Now, there is nothing wrong with syntax, compiling is successful but this error is thrown.
The main reason is that we are using different JVM version for compiling and different JVM for running the code.
Don’t forget to add sudo before commands.
Type your password.
If we check runtime version, the version 8 is set.
Press enter or already set number.
However, if we check compiler version, the 11th version is set.
So to change it, enter the SELECTION number which is in front of it. In my case, its 2.
And now, if we recompile and execute, it shall work fine.
Code is given in the description.
Don’t forget to like, share and subscribe.
Thanks for watching. 


Sunday 2 August 2020

Google Calendar API Tutorial #3 | Delete Events | Get Event IDs | 2020




Download VENDOR Folder (Only for PHP version 7.2+): https://unpossiblepog.com/research-and-development/php/Vendor-Folder-For-Google-Sheet-Drive-Calendar-With-PHP-Version-7.2-And-Onward

PHP Google Calendar Delete EVENTS.

Google Calendar PHP Connection:-
https://youtu.be/Q-498CAa1xE

Google Update Alert :-
https://youtu.be/5COjnEc4d9E

Delete event Code Link:-
https://developers.google.com/calendar/v3/reference/events/delete

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.
In this tutorial, we shall delete google event using PHP code.
For that, you must first connect PHP with google calendar which are shown in those tutorials.
Both of those links are given in the description.
Now, if you are able to display or add events, you can continue watching further.
I gave a link in the description for a code for deleting event.
In that function, first argument is calendar ID and second is event id.
To find calendar ID, follow my steps.
You will find calendar ID here, which I am already using in code.
Now, we can get the event ID in two ways.
1, while adding a new event. And 2nd by getting events list from LOOPS.
1st, I shall comment the loop code, and add the event.
Here, use getID function.
Lets run the code.
We do get the ID, but ignore the “slash N”, which I accidentally printed in code.
You can store that ID in database or session or anywhere for later use.
Comment that ADD-EVENT code.
Now we shall just copy that in our code directly.
Now we use that provided code.
And use calendar ID and event ID.
As you can see, the event was added by the code is here.
If we refresh, it will be vanished as you can see.

However what if you don’t have event ID, so for that, enable the DISPLAY EVENT code.
& use that delete function here.
Lets create some events manually.
Notice that the third event is from different calendar which will not be delete as it belongs to different calendar.
Now they are vanished like a magic.
Code link & other required links are given in the description.
Don’t forget to like, share and subscribe.
Thanks for watching.