0

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?

Val
  • 1,548
  • 1
  • 20
  • 36
  • `Camera.PreviewCallback()` is fine, the Camera1 API was deprecated, but barely any *devices* support Camera2. – EpicPandaForce Apr 04 '16 at 13:08
  • just tried compiling it again. logcat says "Error:(89, 19) error: cannot find symbol class PreviewCallback" – Val Apr 04 '16 at 14:04

0 Answers0