QR Code Generation

11 Oct

QR or Quick Response Codes are a type of two-dimensional barcode that can be read using smartphones and dedicated QR reading devices, that link directly to text, emails, websites, phone numbers and more. For example, QR code below can be scanned to take user to :

Preview of your QR Code

QR Codes can be programatically generated using App Inventor or AppyBuilder by invoking a RESTful API service. Below is a tutorial that will show you how to generate QR and how to save the generated code onto devices SD card.


This tutorial assumes that you have previous knowledge using AI2 or AppyBuilder

Live Testing:

For live testing, download a copy of AppyBuilder companion from Google Play Store HERE.

Design Editor:

To start, use your browser and go to Once there, create a new project called qrApp. Next start up your companion app and connect it for Live Testing to AppyBuilder:


Our design editor will include 2 buttons, a TextBox and a Canvas as shown below:


TextBox1 – will be used to enter a text that will be used for generating QR code; e.g.

Button1 – once clicked, will take TextBox1.Text and invoke REST API to generate QR.

Canvas1 – Used to display QR code into its background

Button2 – Used to save the Canvas1 Background image (the QR code image) onto SD card

Web1 – Used to encode a text so that it can be used in a URL

Blocks Editor:

We now switch to Blocks Editor for coding using blocks. As shown in blocks below, we use Web1.UriEncode to encode text in TextBox1 text field. We then create full URL string by concatenating the API URL passing it TextBox1 text as its data parameter. The API URL is:×150&data=

Next we set our Canvas background image to resulting URL:


Below is how screen will look like after Button1 is clicked:


To save this QR code image locally on the device, add blocks so that when Button2 is clicked, the Canvas1 background image is saved into a file foo.jpg. This file will be stored onto root folder of your device.  If you like, you can add a directory to your file name; e.g. /MyPics/foo.jpg



Above tutorial showed you how to easily add functionality to generate QR code and save the resulting QR onto devices external storage.

Please share and check out AppyBuilder HERE to see some of cool features / components.



Leave a comment

Posted by on October 11, 2016 in Uncategorized


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: