I'm an Android newbie
I need to invert colors of a QR code captured by the camera (my codes will come as white-on-black) and then send it to ZXing to recognize the code (preferably on all Androids since 2.3.3).
I've got the library dependency working in my project and can recognize standard codes (using the IntentIntegrator
class) but don't know how to do anything more sophisticated.
This thread https://forums.xamarin.com/discussion/21906/zxing-get-scanned-picture says I need to somehow use OnPreviewFrame
. Then, this tutorial http://www.codepool.biz/how-to-implement-a-simple-barcode-scan-application-on-android.html shows I can use it with an event handling code:
private Camera.PreviewCallback mPreviewCallback = new Camera.PreviewCallback()
{
@Override
public void onPreviewFrame(byte[] data, Camera camera) {
// TODO Auto-generated method stub
}
};
But Android Studio tells me PreviewCallback
is not recognized and the online documentation says it has been deprecated since API21.
How to do this properly?