Hi,
For a small project for demonstration, I have unfortunately no time at the moment. I hope I can do it later.
A good start is the oAuth2 tutorial from Erel.
In addition, you need the source of the OkHTTPUtils and must insert these two modules into the project (instead of the Libary).
https://www.b4x.com/android/forum/threads/54723
To the HttpJob Class add the follow Code:
Code:
'Sends a PATCH request with the given string as the post data
Public Sub PatchBytes(Link As String, Data() As Byte)
req.InitializePatch2(Link, Data)
CallSubDelayed2(HttpUtils2Service, "SubmitJob", Me)
End Sub
Then the class appended in Post 1 must be imported.
(Dim GDrive As GoogleDrive)
1. Initialize: GDrive.Initialize(Me, "Drive", clientId, clientSecret)
2. Connect: GDrive.ConnectToDrive (Connect, Test the Connection, Refresh the Token, if necessary)
-> Call Connected or ConnectFaild (Faild in the Main, can be made better)
3. You can Search for Folders, Files, Upload and Download Files.....
- Files are identified by ID, not by name!
- to search for files in subfolders, the ID of the Parrent folder must be specified
- Folder are special Files
4. The event which is raise when the job is completed can be viewed in the code, e.g. CallSub2 (evModule, evName & "_FileFound", fileEntry.Get ("id"))
greetings