GD Connector V2

Google Drive & Sheets Connector for AppInventor

A Web App designed to connect an AppInventor App to a user's Google Drive & Sheets

For the user ( someone who has downloaded and installed a compatible app to their phone)

You have downloaded and installed an app, and to run it you are being asked to give permission (to authenticate) for it to access your google account:

  • Read the privacy policy above, and the privacy details supplied by the app developer of the app you have installed.

  • Your (android) device should have an active google account associated with it.

  • The permission you give will only provide access via your installed app to you google account, and only you can control this. This web app and the app you will use provides absolutely no access to your google drive or documents, or to any data you use/transfer between your device and you google drive, to any third parties.

  • The web app can be verified by Google's Trust and Safety team, if it shows as unverified then, as the user, you must decide whether to proceed or not.

  • If you choose to not authenticate with the web app, then your installed app may not work at all, or any elements that interact with your google drive will not work, and you will receive a permissions error alert.

  • You will get at least one email from Google to your account confirming you have given access to GD Connector. you may get additional messages from Google if you have not previously logged into Google using your browser.

  • To remove permission for GD Connector to your google account then go to your Google Account Permissions Page where you can do just that

  • Please note: Google sign in and authentication can behave differently on different devices and setups, I have observed (so far...) three different behaviours from Google when initially authenticating the google web app(GDConnector):

    • As seen in my phone/emulators and shown on the website images

    • Automatic authentication with no need for the user to login (although they have to login inside the app)

    • When user not logged into their account in Google, once logged in, not need to log in again to complete authentication (although they have to login inside the app)

      Whatever method it takes, please remember, once you have started the authentication process with Google, you are still "in the app", so do not deviate or get side-tracked.

If you have any further concerns then please contact the AppInventor App developer or here.

For further detail, you can read the developer notes and information below:

For app developers:

It has always been an issue for AppInventor developers to provide their users access to their own google account features. This is now possible using the GD Connector web app and AI2!

All the user needs to do is authenticate with the web app on first use, then they are able to view and manage their google drive, and create, edit and delete folders, docs, sheets and slides, working within their AppInventor app.

The web app:

  • can be designed to meet particular needs and requirements for individuals and groups.

  • does not have a UI, it is accessed only by url and parameters

  • can be verified for use and distribution by Google's Trust and Safety team, which should give confidence to users.

  • is free to use by AppInventor developers, all I ask is:

    • you use the web app only for the purpose intended, and do not contravene any of MIT's or Google's policies in its use

    • a fee may be charged (agreed on request) for the development of custom features. Once completed, these custom features will be shared with all other developers

Also provided are a demo and barebones aia project files, which demonstrates how to best connect your app to your user's google drive.

When developers create their own version of the web app, it is recommended they get the app verified:

https://developers.google.com/apps-script/guides/client-verification

Get in touch should you wish to delve into the deeper mysteries of the script. ;)


Context

This app has been developed for a particular niche use with the android application program AppInventor.

Many app developers provide connectivity between the apps they develop and google features such as drive and sheets, but this connectivity is always to the developers own google account. This web app aims to overcome this issue, and to provide end users with access to store files and data on their own google account.

MIT, the AppInventor developers, provide a connection between their app environment and the android webview embedded in the app. This is called the webviewstring. With use of this element, and suitable html/javascript, it is possible to pass data back and forth from the app to the webview...and to a web app. The web app uses GET and POST requests sent through the webview, and returns an HtmlService output, including setting the webviewstring, which can then be accessed by the AppInventor app.


Usage

In practice, the end user will, on first run of their AppInventor app, be asked to authenticate with the web app (there are some prerequisites: the device should be using a google account, and this account should be the one the user will want to use). Once this is done, then the end user will be able to access the features of the web app to access google drive and docs, as determined by the intention of the AppInventor app. For example, the user needs to store data generated on the Appinventor app. They will be able to create a folder on their own Google Drive, then create a spreadsheet, then store the data in the spreadsheet. Later they can recall the data stored back to the AppInventor app for further processing.

Because of the authentication by the user, only they have access to the files and data used and generated, there is no third party access, and the developer / owner of the AppInventor app and Google Apps Script web app, therefore does not have access to any user data.

To remove permission for GD Connector to your google account then go to your Google Account Permissions Page where you can do just that

Here is an extract from some of the test scripts. "Under the hood" the user is sending the web app a GET request with parameters which will generate certain actions:

Functions:

  1. Create Folder in Root

  2. Create Sheet in Root

  3. Create Folder/Sheet/ in a Folder

  4. Upload a File to Root

  5. Upload a File to Folder

  6. Get the name and ID of every folder in the root of the user's Drive

  7. Get the name and ID of every file in the root of the user's Drive

  8. Get a List of Folders in a Folder

  9. Get a List of Files in a Folder

  10. Get a List of Files by Type in a Folder

  11. Download A File

  12. Move Files or Folders to Root or other Folder

  13. Set/Unset Sharing of File or Folder By User

  14. Set/Unset (Global) Sharing of File or Folder

  15. Get the Data in a Sheet/Grid Range

  16. Get all Data in a Sheet/Grid

  17. Get all Grid Names for Sheet

  18. Append Row of Data to specified Sheet

  19. New Grid for Sheet

  20. Delete a File/Folder(if empty)

  21. Delete An Empty Folder

  22. Query A Grid on a Sheet

  23. Set Data to a Grid on a Sheet

  24. Set Data to a Range

  25. Set Data to a Cell

  26. Insert/Remove Column & Data

  27. Insert/Remove Row & Data

  28. Utility function to return constants - e.g. Last Row, Last Column, Sheet Name


Functions for working with documents and presentations are currently not available

Contact: