Encode/Encrypt – using Javascript and WebViewString


click image to see gif of example app in action

This one probably has a multitude of uses, many of which I have not thought of yet, but use for passwords, creating secret data for exchange with a php server, lock down your app if it contains sensitive data… this list will go on.

I found the code on stack overflow whilst looking for something completely different – so all credits must go there. I initially looked to replicate the scriipt with blocks, but came up against the vastness of the UTF-16 character set, and decided it would be better / easier to use an html page and webviewstring.

In essence you have a single script that can both encode (encrypt?) and decode (decrypt?) a string using a number code. Continue reading “Encode/Encrypt – using Javascript and WebViewString”

Tabulate with listviews (demo)

Many people on the forum are looking to handle long lists of data, usually with code information, e.g. AB-1025, and wanting to select from a list. A single column list can become unwieldy, therefore I decided to have a look at using multiple listviews to display the data, Continue reading “Tabulate with listviews (demo)”

OCR Images (with text) using Google Drive and Google Apps Script

This works remarkably well, both for images on file and those taken with the device’s camera. A shot of a somewhat crumpled petrol receipt returned all the text on the original.

You are going to have to do some layout and formatting with the returned text, but very little word editing.

For this I used two google apps script web apps, one for the image upload to google drive, the second to carry out the OCR. I attempted to combine them into one, but couldn’t get my “blob” to play nicely. Google Docs will OCR jpg, png, gif and pdf files, but sadly no pdf functionality in this version, yet to resolve base64 encoding of pdf files on AI2, this only seems viable with images at present.

I used two extensions, ghostfox’s base64 Encoder extension, and
Taifun’s Image extension. And a nod also to Digital Inspiration and Tanaike for some of the code. Gratitudes to all of you 🙂

Once again assuming you are reasonably competent with AI2 and google apps scripting…. Continue reading “OCR Images (with text) using Google Drive and Google Apps Script”

CRUD with Google Sheets, Web App and AI2


That is create / read / update / delete to the uninitiated and the base requirement for the management of the data in a database.  There are many solutions on AI2 already that access remote data and database systems, and I have already explored some of the possibilities for connecting with Google Sheets, but never really put it all together. This effort aims to address that and to provide a single web app, built from google apps script as an interface between AI2 and a Google Sheet. This means you can keep your google sheet private yet provide access to the data via the mobile app.

Working this thing up will require some knowledge of google sheets, google apps script / javascript, and building apps in Appinventor 2.

I was partially driven to this by the lack of usable / functional  / (free) online data storage solutions that everyone can easily use, the upcoming demise of fusion tables and loss of firebase access from Ai2, and as said above, the need to pull various previous efforts together in one place.

We will start with the google sheet, then move on to the web app, and finally the AI2 app. Some rigour will be needed in order for all this to work, so I have set out some requirements and indicators along the way:  Continue reading “CRUD with Google Sheets, Web App and AI2”

Export CSV data (multiple data) to Google Sheet

From our lists in Appinventor we create suitably formatted strings for each “column” (e.g. ID or NAME) and send the entire string to the webapp as a single parameter. You can of course pull in a csv file using the file component.

Continue reading “Export CSV data (multiple data) to Google Sheet”

Decode a simple JSON using the Webviewer, webviewstring and some javascript

At the time of writing, the built in JsonTextDecode block:

returns a simple json in alphabetical order – by the key, as opposed to the same order in which it is presented. The method below uses a webviewer, the webviewstring, and some javascript to return a csv row string which can then be converted to a list in AppInventor Continue reading “Decode a simple JSON using the Webviewer, webviewstring and some javascript”