Take Picture. Decode QRCode

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.


Best regards,

Rick.
[import]uid: 6011 topic_id: 839 reply_id: 300839[/import]

I don’t know for the other platforms, but for the Android it’s ready to be integrated:

The code:

http://code.google.com/p/zxing/

The Demo:

http://www.youtube.com/watch?v=-9hqB3-3vGI

[import]uid: 6011 topic_id: 839 reply_id: 1895[/import]

We will look into this and add the request to the features database.

Carlos [import]uid: 24 topic_id: 839 reply_id: 1907[/import]

Any update on barcode or native controls (like the datetime picker) & where they stand in the features list?

Thanks,
Chris [import]uid: 8237 topic_id: 839 reply_id: 15292[/import]

carlos,

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

j

[import]uid: 6645 topic_id: 839 reply_id: 15297[/import]

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.

See http://www.redlaser.com/SDK.aspx

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]

@daviding - can’t do that in corona.

c. [import]uid: 24 topic_id: 839 reply_id: 23791[/import]

Oh well. Do appreciate the reply though Carlos. [import]uid: 30488 topic_id: 839 reply_id: 23815[/import]