Skip to main content

How to create a QR code reader in Sketchware

A QR Code is a two dimensional optical bar code which is used for carrying data. QR stands for "Quick Response". Each QR Code normally contains an identifier, a locator and a url. These codes were initially used for tracking of auto parts but have become more popular in recent years. Nowadays they are used for providing easy access to website as well as for tracking purposes. That has made them a key marketing tool.

Instead of typing a url, a user can simply scan a code and be redirected to a specific page on a website. You can however adapt the QR Code and use it as you wish. Some time back I mentioned a tracking app for employees or students... using a QRCODE and your listviews, you can create a powerful tracking app.

So let's create a simple app which generates a QR Code using the data that we will provide. 

How it will work

A user can type something in an edittext field and when they click a button, we will call the QR code using an API to generate a code. We will then display that code in an imageview. So this code will be carrying whatever we put in our edittext field. In the first image I sent... if you scan it using a scanner app, you will see the message "ndeipi wangu".

Creating the layout

All we need to do is add the following:

1. Edittext- this is where we will type what the QR Code should hold. *NB- you can use other means of getting the data. e.g. you could allocate a username and get the current time without the user typing a thing

2. A button- this is where we will place our logic to translate the words we type into a QR code.

3. Imageview- this will display our QRCode So it will look like this 


qr code scanner

Use the logic below onbutton click. Set imageview fro url join the link and the textview that you will be using to enter your text. Then set the image visible when an image is displayed.

qr code on button click

The link text is

https://api.qrserver.com/v1/create-qr-code/?size=150x150&data=

The final app will look like this:

qr code final app



Comments

Popular posts from this blog

How to easily create background notifications in Sketchware(original)

How to easily create background notifications in Sketchware(original) One of the keys to building a successful app is to find mechanisms that will keep your users engaged. You can do this by using background notifications. This tutorial will show you how to do that in Sketchware. We will cover: 1. How to create notifications in Sketchware 2. How to show these notifications even when the app is closed.

How I got started with Sketchware

Background As I explored the Playstore sometime in June 2018, I stumbled upon an app to create other apps. Out of curiosity I downloaded it, did some research and played around with it. I soon realised I could actually create a “real” app from scratch and make money. See, some years earlier I had downloaded Android studio and done a few lessons on programming. So I had a basic understanding of Java and android programming, but this new app that I had found, used simple drag and drop features and you could actually run the app on your device or send your app to friends in just a few clicks. I was not a professional programmer but using this app I could easily create “proper” mobile apps without cracking my head over code.  You can check out my app made using Sketchware; Business Builder- Small Business Management Suite here . Fast forward to a few months later and I had created an app that I felt was ready for the big leagues… Play Store baby!! Note, that I was at a low point f...

Happy Birthday Memes: Laugh Your Way to Someone's Heart

Happy Birthday Memes: Laugh Your Way to Someone's Heart Introduction Birthdays are a special occasion to celebrate another year of life, and what better way to do it than with a good laugh? That's where happy birthday memes come in! These hilarious images are the perfect way to put a smile on someone's face and let them know you're thinking of them on their special day.