Reputation: 1392
I would like to use the front camera of the Nexus Tablet to scan a QR code, and while the QR code paper is being positioned the app should show the camera image in a square box on the screen, so the person can align the QR code accordingly. Should I be using ZXing and if so I wonder how to embed the ZXing in my screen?
Upvotes: 1
Views: 609
Reputation: 2320
The recommended option is to use an Intent to call ZXing by bundling the ZXing Android integrator into your app. This will prompt the user to download the ZXing barcode scanner application if it isn't installed, then open it to handle the scan request.
The other option is to checkout the ZXing source, remove all the bits you don't need and bundle a Frankenstein version of it into your app. I did this recently to make the main barcode screen a Fragment rather than an Activity. There are a lot of dependent classes (camera, database for history, encoding functions etc) so it is a little time consuming and you do end up republishing a lot of code.
Upvotes: 1