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)”

Save Any File to Google Drive

I have been working on doing this for quite some time within AppInventor, but the tools required on board are just not quite there to do it yet. However, I have come up with a “slingshot” solution using a combination of web technologies that will get a file from your device up to google drive.

In order to achieve this, you will require the following:

  1. A google web app
  2. An https web server with php and ftp access
  3. A couple of php scripts / pages
  4. Ai2 developed app

Credits to Scott Ferguson for the postfile howto, Digital Inspiration for the bones of the apps script, and to Taifun for the File extension 🙂

Again I assume that you have a good grip of AI2, writing and publishing google app script web apps, and the ability to ftp to your web space on an https server (Google Drive will NOT accept urls from non https servers)

Continue reading “Save Any File to Google Drive”

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

CRUD

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”

Calculate End Date for Treatment Plan (weekdays only)

This is one of those questions asked on the forum that you think, that should be easy enough to figure out, but when it comes down to it, there was a fair bit of thinking involved. The developer wanted to set a start date for a treatment plan (which had to be a weekday), then enter the number of days required for the treatment, and to then work out the end date for the treatment, which could only take place on weekdays…

 

Continue reading “Calculate End Date for Treatment Plan (weekdays only)”

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”