Tuesday, January 22, 2019

Deploy Google Apps Script web app as an Android application

The main advantage of serverless Google Apps Script against of serverless Cloud Functions is online editor (IDE) not only for writing code for server-side, but even for client-side. You can create HTML web application with HTMLService


Google has recently introduced (G Suite update 12/2018) option to deploy web application as a native Android application for G Suite users. If you are reading this, you are probably power-user so you can imagine what you are able to do now! Yes, deploy native Android application with Google Apps Script.

Notes:
-To use web apps, your user’s devices must have Google Chrome installed

1) Create a new Script at https://script.google.com

2) Insert code snippet into code.gs


3) Create a new HTML file and rename it to "view.html"



4) Edit HTML for your future ├╝ber-cool-application (just for now, insert Hello World!)

5) Open menu Publish --> Deploy as web app and copy URL address



6) It is time setup in G Suite. Open Google Admin console (https://admin.google.com) and pick category Device management

7) Then choose App Management from left panel.

 8) In App Management you will see section in the middle of page - Manage apps for Android devices. This section contains button Manage whitelisted apps. Click it.



9) Now you are in mobile application management. First, you have to Add a new whitelisted application (with yellow circle button)


10) You will see Google Play directory. Change category (left panel) to Web Apps.



11) For now, you have to again click at Add button (circle button at right bottom of page.



12) Now you can define behaviour of your Android application.
- Title is name of application on home screen
- URL of your Google Apps Script (from step 5)
- I recommend you for display choose Full screen or Standalone
- Icon of your Android application


13) After you click at Create button it will take about 10 minutes to prepare your application.
(There is a small text Not available yet below during preparation )

14) When your application is successfully prepared, then you can click at desired icon



15) During distribution strategy, you can distribute application for all G Suite users or subset according to Organization unit.




16) Last step contains option to automatically install application on all devices (This option doesn't work for me)



17) When you visit Google Play at your phone, then navigate to section Work Apps. Click to application and install it.

The was a final step. Your Google Apps Script application is on mobile's homescreen