We really need to be able to shoot a picture from the phone camera (in my case, Android HTC Desire) and decode the QRcode picture on it.
Something equivalent to the following JS:
useFlash = off; // disable the camera’s flash light
status = camera.flash(useFlash); // on, off, auto - In this example: off
qr = camera.takePicture().getQRObject(); // Get QRCode object from the image object obtained right now from the camera
camera.flash(status); // put the flash as it was before
If (!qr.isValid) { // Property: QR object contais a valid QR code. Original image was a real QR code decoded ok.
alert(“Can’t detect the QR code. Take another picture closer and try not to shake please. : )”;
}
else {
alert("The QR code contains: "+qr.data.toString()); // Display the data encoded on the QR
}
//=====
Why? Many of us need a way of easy input data to the app like a barcode reader.
QRcodes are printed everywhere.
In Japan you can’t live without them.
On the past we used Windows Mobile with a barcode device attached to a pocket-pc. Today we use the cameras on the devices.
QRCodes are way better than barcodes. We can insert ANY kind of info on them.
personally i think it is undesirable to include such features directly into the API unless the compilation procedure can be changed to only include such items when required (eg same with openfeint etc)
otherwise we’re just going to end up with increased filesizes for stuff we dont need. it would be ok to include it in the simulator app during development process, but when publishing it through ansca for device i’d hope these items weren’t included unless “require”'d
for something like QR-reading i’d be happy with a pure Lua solution on top of some extra features such as [lua]getPixel()[/lua] and 2.5D transforms etc to actually do the image processing (not that I could make the solution but someone else would I’m sure!).
To be honest, I’d rather ansca spent time fixing bugs and implementing more wider-use features to allow other people to build these sort of custom features on top of
I agree that it should not be built into the distributable; however, some means of optionally including libraries and functions would be pretty important.
Barcode scanning libraries would vary between iOS and Android devices anyways.
Getting things like a base set of native controls would be higher on my list - especially things like a datetime picker or spinner/list control.
Getting the ability to optionally include things like barcode scanner libraries would make Corona the best platform for doing business apps as well as games. [import]uid: 8237 topic_id: 839 reply_id: 15884[/import]
No need to build. RedLaser has both a great iPhone app and a great barcode SDK. Free to eval, $50 dev license, reasonable rates on per-user licensing fees for large scale roll-out.
Ansca, if you are serious to adding to your solution, maybe the answer is to license their stuff, or bridge to their license – but make it work in Lua since they are Objective-C base (I think). [import]uid: 10547 topic_id: 839 reply_id: 23318[/import]
There’s another way to do this, if you know the target device will have network access and your volume is low enough. Google provides a free QR code decoder at http://zxing.org/w/decode. They don’t publish an API for it, but it’s not hard to reverse-engineer using Fiddler or some other HTTP sniffer tool. You can hit that with an HTTP request that embeds the image of your QR code, and then very easily decode the plain text decode it sends back. Voila – [import]uid: 10547 topic_id: 839 reply_id: 23321[/import]
Kinda on the same topic, but I thought that only iPhone devices had camera access? The docs show Android not having anything like
camera.takePicture
Am I wrong?
Also, I’d be keen to purchase Corona SDK if I just knew that they could be a way around this current restriction. Has anyone ever taken a 3rd party non-Lua library and called it from Corona? I’m thinking I could write some simple Java as a way to access the Android camera and call it from my Lua code. Is that approach even possible? [import]uid: 30488 topic_id: 839 reply_id: 23529[/import]