I'm not sure if this is the right section to post this kind of question. if not, please move the topic!
Anyway, i'd like to know if it is possible to have a QR code generator extension for iOS and Android exporters.
Thanks in advance!
I'm not sure if this is the right section to post this kind of question. if not, please move the topic!
Anyway, i'd like to know if it is possible to have a QR code generator extension for iOS and Android exporters.
Thanks in advance!


hi
if you work with a server you can make it very easily with the get object, php script and fastloop


I had headach with the same problem, and I can't wait until a hero create these extension so I will explain you my solutions even if it's not exactly what you request... :
Solution 1- You don't have a server :
you can symply use google API with the webview object : https://chart.googleapis.com/chart?chs=250x250&cht=qr&chl=your%20string%20here
With these method, you just have to download the qr code generated by google.
Solution 2- You have a server and want do it yourself
for my project I didn't work with google API for 2 reasons
I have to send / recieve sensitive data, and I want to set myself the qr code setting.
all exchange between my server and app are always crypted; but I will not show you these for more simplicity
I used this API and these tutorial (in french, sorry if you can't unterstand... I will explain you)
a- install these directory and its PHP script on your server for exemple in your www direrctory
b- install the following php scripts in the www directory
in my case I need two type of Php scripts :
- 1 that output directly create the qr code as an png picture that can directly donwload with the webview object (>> solution A)
- 1 that output the qr code as an text where the black square are 1, and the white are 0. (>>solution B)
------------------------------------------------------------------------------------------------solution A
------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------App create a qr code and download it
in this exemple the application will create an qr code and download it as an PNG image.
1- create a directory where the created png will be stored (in my exemple I create the directory "created-qrcode-directory "
(we have now in our server 2 directory one with the QR code library : "qr-code", and a second where will be stored the generated qr codes : "created-qrcode-directory")
these two directories are in the www directory of your server
2- put this php script in your www directory (not in the "qr-code" or "created-qrcode-directory" directories !!! it must be in the www directory (or directory parent from the two others...))
yes I know it's dirty... but I am not super programmer...PHP Code:<?php
include "phpqrcode/qrlib.php";
include('config.php');
// how to save PNG codes to server
$tempDir = "created-qrcode-directory/";
$input = $_POST['input'];
$file = $_POST['file'];
$codeContents = $input;
// generating
QRcode::png($codeContents, $tempDir.$file, QR_ECLEVEL_L);
// end displaying
echo 'done';
?>
Now your app can download the Qr code you want where you want.
I create a little exemple here where it create "coucou" qr code and download it as "coucou.png"...
Notice that you can change the correction level ( L, Q, H...) or the margin as you want ; refer to the documentation of the API...
------------------------------------------------------------------------------------------------solution B
------------------------------------------------------------------------------------------------------------
--------------------------------------------------------------App create dynamically the qr code itself
now, if you don't want that your app download a picture but that it create directly the qr code (for exemple to customize the square ect...) then maybe my solution B will interest you :
We will output a list of 0 and 1 that will represent the square of the qr code, and then with a active object create directly the qr code
1- put the following PHP script in the www directory of your server (not the directory of the library!!) :
'I know, it's dirty.... I am not a super programmerPHP Code:<?
phpinclude "phpqrcode/qrlib.php";
$input = $_POST['input'];
// text output
$codeContents = $input;
// generating
$text = QRcode::text($codeContents);
// displaying
echo join("", $text);
?>..... )
2- Now we will create an app that will use that PHP script to generate a Qr code ;
-----------------------------------------------------------------------------
Notice, for those who have no server; that you could use my server scripts so long it's for fair use and test only.
And sorry for my bad english practice
Qr-code-solution-A.mfa
Qr-code-solution-B-Solution-B.mfa


for those who want to build an qrcode object extension these documentation/tutorial might be interessing
Thank you for your thorough answer! I guess i'll go with solution 1 and use google API, it seems way easier.
It'll only work on android, right? (since there's no web view object on iOS)
Thanks again!


oh.... ****.... no Webview in IOS
The solution B it's not so difficult as you think; you just have to put php scripts on your server, and then use the litle code to generate so long qr code you want with GET object.
so it will be cross platform, and with an array you can custom it to create funny qr codes .
after you put the library and the script to your server, (if you have no you could use mine) you just have to give some simple parameters, depend of your projects :
that for an exemple for a project that display a big qr code
qr-code-solutionB-explain.jpg
then simply put the parameter in the value / string :
qr-code-solutionB-explain2.jpg
then when running it creat it directly :
qr-code-solutionB-done.jpg
It's appaer like complicated but in reallity it's very easy and you will have cross plateform qr code.


with solution B and checking north/south/east/west of the target cell; you can easily create customize Qr code like chuckie-cheese-qr.jpg


in line 10 was an error, I correct it : Qr-code-solution-B-Solution-B.mfa
notice that the Qr Pixel must always be √qr total size
notice.jpg


1- With Google API
1- you access to google api giving it the size and string to code
exemple with "hello world!"
https://chart.googleapis.com/chart?chs=250x250&cht=qr&chl=hello%20world!%20
then you can display/ download/ /use it with WebView object.
2- Without Google API
A- your app direct download a qr code
1- you upload the qr library in your server qr-code.zip
2- you write the php.script --> the first php script
3- app : you access this php script with GET (POST) and download the qrcode with WebView.PHP Code:<?
php include "phpqrcode/qrlib.php";
include('config.php');
// how to save PNG codes to server
$tempDir = "created-qrcode-directory/";
$input = $_POST['input'];
$file = $_POST['file'];
$codeContents = $input;
// generating
QRcode::png($codeContents, $tempDir.$file, QR_ECLEVEL_L);
// end displaying
echo 'done';
?>
Qr-code-solution-A.mfa
B - your app create the qr code during it is running
1- you upload the qr library in your server (if it was not made before)
2- you write the php script for displaying qr code as an 1 an 0 string "1111010101...." ---> the second php script
3- app : you access this php script with GET (POST) and run fast loops that create the qr codePHP Code:<?php
include "phpqrcode/qrlib.php";
$input = $_POST['input'];
// text output
$codeContents = $input;
// generating
$text = QRcode::text($codeContents);
// displaying
echo join("", $text);
?>
Attachment 19009


for my project, I try with 2A and 2B
But 2A is slow, too heavy, little unstable and not cross platform so long it's no webview in IOS...
2B is fast, lignt, stable, and cross platform, and permit to work with qr codes ( for funny custom qr codes) so I surely work just with it :
Screenshot_2016-01-28-08-50-43.jpg