QRcode generator

106 views
Skip to first unread message

Paul Bowers

unread,
Nov 2, 2023, 4:21:34 AM11/2/23
to Sailforms Users
So the request was could we create QR codes from data in a Sailforms app. my initial solution was looking to see if I could build a solution 100% contained in sailsforms and use the sprite approach. It soon became evident that there would be problems. The lacj of ability to dynamically rescale the screen to be able to present the full qrcode - a requirement to be able to scan it. With this issue the largest QR code would therefore be a Micro QR code with 11 to 18 blocks - which limited it to 38 character. The second issue was while space between the blocks - there is no effective way I could remove them using the standard black blocks I have used previously in my Sprite approach.

Therefore another approach was needed. I have two solutions in this example - 1 using an online service and the second an offline more tightly coupled and better looking solution.

Bothe solutions use an URI intent. The first one is easy - just construct the URL required and call it. But you need to be online and the website doesn't allow any customisation to make it look more part of the app. 


Solution 2 is my preferred - but a little more involved but not complicated. - This solution takes the open source online and creates an offline self contained HTML JavaScript applet (I have attached it below) - this means you can call it locally using the same URI method that I used for calling and displaying images / photos external to the sailforms DB.  

Method: 
1) download and install from Google Play store SImple-HTTP server - run it and select restrict network interfaces - select lo (local 127.0.0.1) and then set root folder (to a location on your phone where you will place qr.html - or any content you wish to access on your browser - web pages, photos, videos) - I also set it to autostart - this is a tiny app so have no impact on your phone memory or CPU. - Dont forget to press START to enable the service

2) install by QR sfg app - and then run the QR creator page .

My demo have a link to both the local and online demos - i have also placed a static test qr code on the demo - it was created using this app and screen grabbed to test it is scannable etc.

Enjoy.





Screenshot_20231102-080035_Chrome.jpgScreenshot_20231102-080020_Pro.jpg
QRCode_1.sfg
qr.html

Paul Bowers

unread,
Nov 2, 2023, 6:55:54 AM11/2/23
to Sailforms Users
thumbnail_image.png
Reply all
Reply to author
Forward
0 new messages