0

I am trying to make small android application that controls google sheets. I want the whole thing in html,css,js where I use api for google sheets. My problem is I cant find solution to login to javascript by the account witch is on the android device (when you open chrome, you have option sign in using main google account without password).

The app run on tablet as home screen so it autostarts & cannot be closed.

Currently I have:

I created app from scratch witch is in fullscreen mode & can be set as default app for home screen (done from AndroidManifest.xml). It runs nanohttpd server that read data from asset folder trough AssetManager (so the app is self contained & does not need hosting). Then there is WebView that have address to localhost.

This works just fine, I can login & fully use the app, but when I want to login there is no option to use the google account that is signed on the android device.

Things I also tried:

  • Apache Cordova
    • simple & easy to use
    • google does not support request from file:// witch cordova use
  • Chrome Custom Tabs
    • works like webview
    • have the login feature I want
    • cannot make it fullscreen & remove navigation bar
  • Trusted Web Activity
    • I looked to documentation & sucessfully compiled example
    • Feel too compicated & lack of good tutorials/examples

Is there anything like cordova but with the google api support?

1 Answers1

0

Neither Custom Tabs or Trusted Web Activity will provide APIs that allow you to inject JavaScript and control the embedded content. The Android WebView should allow doing that.

I'd recommend discussing this with the developer of the content being embedded, and if that's and if that's a use-case they support (it doesn't seem like something that Google Sheets is designed to support?).

Otherwise, your implementation will be flaky, both due to the lack of APIs and because they may change their content/APIs at any time.

andreban
  • 4,621
  • 1
  • 20
  • 49