Looking to re-write an existing app in Corona SDK

Hi,

I have a non-game app on the Play Store written in another language (another game engine) and looking to re-write it because what it’s currently written in has awful and buggy text boxes and it’s unlikely they will ever improve them. I’m currently researching different options and I keep coming back to Corona as it looks like one of the easiest ones for me to learn. Starting again is already a bit daunting so it’s important there’s not a massive learning curve. I’ve looked at Xamarin but it scares me >.<

From what I can see I can do everything the current app does in Corona but I’m unsure how easy it is to implement a QR code generator and scanner. I can see that there’s a plugin on the market place for a QR scanner for $20 a year but it doesn’t mention having the option to generate QR codes. I’ve also found a few plugins floating about on GitHub while searching Google but almost none of them have any real documentation and I’m not sure how easy they are to implement, or even if they can be implemented. I’ve also not found one that generates and reads codes.

If I ever do find a plug-in (and not use the one on the store which seems to be a reader only) do I need to find a plugin for both versions of OS i.e. one for Android and one for iOS? That’s the impression I get from the help pages here on the corona site. It’s a little confusing.

From my limited testing of text boxes they seem so much better than the current ones I have to work with so it seems a shame to have to cross Corona off the list because it’s not easy to implement a QR code generator and scanner. I have QR codes working in the current version of the app as it was built into the game engine language without needing to include any third party plugins.

I did stumble across one post on these forums suggesting sending data to a server and generating a QR code that way and download the image to display in the app. And when it comes to scanning a code, send the data from the captured image to a server and decode a QR code that way before sending back the string to the app. Does this sound like a sensible approach?

Thanks in advance

I should probably mention that the current app generates a QR code which is encoded with a unique ID (that ID is stored in a MySQL database on a server). The user then shares that QR code for other users to load. When they load it they then get the settings that the original user set, and the settings are stored in the database.

To make that a little clearer you could imagine that the QR code when scanned would download a level that the original user set up based on the ID that’s encoded in the QR code. Like I’ve mentioned it isn’t a game and users aren’t sharing levels but that might help make it clearer why I’m using QR codes. Users are sharing settings/configurations in the app that others can load. I could do a way with these completely and share text strings or somehow have URLs that when clicked would open the app and download the settings but the current version does have QR codes and they’ve been shared publicly on the web so it would be a shame to have them stop working completely because the new version of the app can’t read them.

The Marketplace entry for each plugin should list what platforms it’s supported on. Some developers will make an iOS only or Android only plugin, some build plugins for both. Look at each plugin’s page. 

I also used this Lua module: https://github.com/speedata/luaqrcode along with our Memory Bitmap plugin: https://marketplace.coronalabs.com/plugin/memory-bitmap

The speedata/luaqrcode returns a table of on/off values that can be used to draw black and white rectangles and you can then use that data with memory bitmap to produce a Corona display object.  Unfortunately I’ve misplaced the code that ties the two together.  I did have to modify the speedata code to turn it into a Lua module and I have that code.  So what you want to do can be done.

Rob

Thanks Rob. I did find that Lua QR code generator but couldn’t see in the code how it would output to an image. I did see that it created a table/array of data.

That’s promising if I can then get Corona to also scan and read a QR code. Although I guess that single QR scanner plugin on the market place would solve that. I didn’t see if it was available for both Android and iOS. That’s also important.

The QR Reader plugin states in the description of the plugin that it’s available for iOS and Android only.

Thank you. I did just look myself again too when you gave me the link to the Memory Bitmap plugin. I also found the developers forum post for the plugin and found this in one of the comments which looks perfect if I can’t get the generator plugin to work

network.download(

"https://chart.googleapis.com/chart?chs=150x150&cht=qr&chl=I+Love+QR+Codes!++HI+MOM!&choe=UTF-8",
“GET”,
networkListener,
params,
“myQRCode.png”,
system.TemporaryDirectory
)

Thanks for your help. It looks like I’m going to probably be able to do everything I need and more with Corona.

I should probably mention that the current app generates a QR code which is encoded with a unique ID (that ID is stored in a MySQL database on a server). The user then shares that QR code for other users to load. When they load it they then get the settings that the original user set, and the settings are stored in the database.

To make that a little clearer you could imagine that the QR code when scanned would download a level that the original user set up based on the ID that’s encoded in the QR code. Like I’ve mentioned it isn’t a game and users aren’t sharing levels but that might help make it clearer why I’m using QR codes. Users are sharing settings/configurations in the app that others can load. I could do a way with these completely and share text strings or somehow have URLs that when clicked would open the app and download the settings but the current version does have QR codes and they’ve been shared publicly on the web so it would be a shame to have them stop working completely because the new version of the app can’t read them.

The Marketplace entry for each plugin should list what platforms it’s supported on. Some developers will make an iOS only or Android only plugin, some build plugins for both. Look at each plugin’s page. 

I also used this Lua module: https://github.com/speedata/luaqrcode along with our Memory Bitmap plugin: https://marketplace.coronalabs.com/plugin/memory-bitmap

The speedata/luaqrcode returns a table of on/off values that can be used to draw black and white rectangles and you can then use that data with memory bitmap to produce a Corona display object.  Unfortunately I’ve misplaced the code that ties the two together.  I did have to modify the speedata code to turn it into a Lua module and I have that code.  So what you want to do can be done.

Rob

Thanks Rob. I did find that Lua QR code generator but couldn’t see in the code how it would output to an image. I did see that it created a table/array of data.

That’s promising if I can then get Corona to also scan and read a QR code. Although I guess that single QR scanner plugin on the market place would solve that. I didn’t see if it was available for both Android and iOS. That’s also important.

The QR Reader plugin states in the description of the plugin that it’s available for iOS and Android only.

Thank you. I did just look myself again too when you gave me the link to the Memory Bitmap plugin. I also found the developers forum post for the plugin and found this in one of the comments which looks perfect if I can’t get the generator plugin to work

network.download(

"https://chart.googleapis.com/chart?chs=150x150&cht=qr&chl=I+Love+QR+Codes!++HI+MOM!&choe=UTF-8",
“GET”,
networkListener,
params,
“myQRCode.png”,
system.TemporaryDirectory
)

Thanks for your help. It looks like I’m going to probably be able to do everything I need and more with Corona.