Android Question Assistance with Google Drive File Deletion via B4A (Android)

I’m trying to enable full control of my Google Drive from my Android phone — specifically, the ability to delete files.
So far, I have successfully managed to read and write to Google Drive using the ContentResolver library and an intent such as:
Dim i As Intent
i.Initialize("android.intent.action.OPEN_DOCUMENT", "")
i.AddCategory("android.intent.category.OPENABLE")
i.SetType("*/*")..........


However, I haven’t found any way to gain full control of Google Drive through B4A, particularly for file deletion.
I understand that it requires registering a project in the Google Cloud Console, but every method I’ve tried eventually led to a dead end:
  1. I created a Service Account, but couldn’t obtain usable tokens.
  2. I tried creating a Web, Android, and even a Desktop project — I received a Client ID and Client Secret, but couldn’t successfully handle the OAuth2 redirect process.

Since I couldn’t find a clear solution in the forum, I would greatly appreciate guidance on how to properly gain full control of Google Drive, including file deletion, using B4A.
 

emexes

Expert
Licensed User
Longtime User
This is just brainstorming, but:

this gentleman has an excellent library for interfacing with Google Sheets, and seems to be edging towards fuller control of Google documents (and files) generally:


so perhaps look at that library. Like, if you don't find another way to delete files, and the files you want to delete are all spreadsheets, then an alternative might be to load the spreadsheet, delete everything in it, and save the empty spreadsheet back to Google cloud. Sounds crazy, but I did say this was just brainstorming, and maybe a crazy idea from me might trigger less-crazy ideas from people smarter than me. 🙃

I'm pretty sure you can try the library for free. The price is reasonable enough that, if you get any good out of it whatsoever, then you have an easy way to say thank you. 🍻
 
Upvote 0
Top