Run google scripts from android device - android

I have a google script that fetches some data from an excel sheet. The data is returned as JSON. The excel sheet is shared between a set of users. I can run the script from browser, if I am logged in as google user. How can I execute the script from an android application. How do I execute the script as the user (user at the keyboard)?

I have some samples of a simple Android app calling an Content Service URL. You have to publish your apps to be accessible publicly.
https://github.com/entaq/GoogleAppsScript/tree/master/Android

By "excel sheet" you mean Google Sheets, right?
From what you explained, it seems that you script is published as a web-app. To access it on android, just open the browser and hit the app url. Running as the developer or the user is just an option when you're deploying the script as a web-app.

Related

Web app to write data from shared hosting webpage to firebase firestore

I tried of finding way to write data to firestore from shared hosting web page,
Not many tutorials for firestore on Google so
right now I am updating/writing data/docs through my android app admin panel but it hard to do in mobile
Tried for creating web page as per firebase docs and code lab
the code labs days
What you'll need
The IDE/text editor of your choices such as WebStorm, Atom or Sublime.
npm which typically comes with NodeJS.
A console.
A browser such as Chrome.
The sample code. See next step for this.
so as per google cod lab npm / nodejs is required
But firesbase docs say nothing,
even though tried on shared Linux hosting (Siteground) as per firebase docs
But no results
my question is now
is it possible to create a web app to write data/documents on plain shared Linux hostings (like blue hsost/sitegroung.com etc..)
is it possible to develop web page without node js to write data/docs to firestore on shared Linux hosting?
Is it possible to create a web app to write data/documents on plain shared Linux hostings?
Yes. You can host your web app anywhere. The connection is made directly from the web page in the user's browser to Cloud Firestore, so no special requirements are placed on the host.
is it possible to develop web page without node js to write data/docs to firestore on shared Linux hosting?
Yes. Node.js is not required to use Cloud Firestore within your web app, and it only used in the codelab to deploy to Firebase Hosting.

Android Instant App without having a verified website

To build an Instant App it is required to setup App Links. One of the steps requires to verify that you are the owner of the website you are linking your app to.
Is it possible to create an Instant App if I don't have any website but still want to have ability to send a link to my Instant App to a friend, share in on social media etc?
Basically the idea is to implement "share" feature in the app that will generate a link that will be leading to the instant app.
Instant Apps requires a link to a domain via App Links as Instant Apps are triggered/launched via a URL. There would be no way to launch an Instant App without connecting it to a domain. It's not necessarily required to host an actual website at that domain (aside from hosting the /.well-known/assetlinks.json file) although it is recommended (so that if a non-Instant App enabled device reaches that URL it actually shows something meaningful).
There's nothing to stop you registering and using some arbitrary domain and verifying it via App Links for the functionality you describe. You can use Firebase Hosting to very quickly set up hosting for free and add your assetlinks.json file (and of course there a multitude of other options to host that file as well).

How to send data from webpage to native app on mobile device, both Android and iOS?

The scenario is, a user is visiting my webpage, click the download button to download my apk package (on Android) or go to App Store (on iOS). Then install the app and open it.
What I want to do is, when the user visits my webpage, I store some data to somewhere, and when the app is installed and opened, it can somehow read the the data (so the custom url scheme doesn't work in this situation).
For example, the user is reading an article on my webpage and then he finds out that we have an native app. So he downloads the app and installs it. We hope that when he opens the app, it could automatically display the article he was just reading. Therefore, the native app needs to know the article id from the webpage.
Now I can think of two solutions to do this but have some difficulty to overcome:
When the user visits my webpage, I copy the data to system clipboard using document.execCommand('copy') and then in my app, I acquire the data from system clipboard. While, as you may know, this API are badly supported on mobile browsers due to security reasons.
Use remote server as media. Webpage sends data to the server and app fetches it. But the data is device sensitive, and I can't think of what can be used as a unique identifier for a device. Because all webpage can obtain is some navigator.userAgent information.
So, is there someone that can help me out here and find a perfect way to send the data from webpage to native app. I would be very grateful!
I think the best option you have is to :
-Store the data in a table
-Create a php page that will do the query to get the data
-Do a http query from you android/ios app to this php page, you've your data !

Access Google credentials from Cordova

What I want to do is log my users in via Google in my mobile app powered by Phonegap on Android.
To do so I use firebase SimpleLogin module which logs me in correctly thanks to the "InAppBrowser" plugin.
My problem is that the webview powered by the InAppBrowser does not have access to my Google credentials. I have to tap them manually each time.
Is there a way to tell the webview how to automatically get my Google credentials from my phone so that I don't have to write them each time ?
Thanks
Probably not. If you're only using the browser for auth, consider using Google+ Sign-in for Android instead.
The browser on Android, like web browsers in general, runs in a sandbox. This means it does not have access to system resources such as Android's AccountManager. This is done on purpose for security reasons.

How to give option to my web users of download my Android app

I have created my Android app with androidcreator.com and I have downloaded it.
Now I want to show to my web users that visit my web from an Android device the option of download the app when they visit my website.
My website uses php. Exists an "standard" php/javascript code to ask to my web users for download the Android app? (Only when they come from an Android device)
Thank you very much.
You can simple add link to Google Play.
If you want to be more proactive, you can check the user agent string from the client in PHP for 'Android' and use that to popup something to encourage them to download your app.
See:
Code to parse user agent string?

Categories

Resources