Search code examples
codenameone

Overaly image functionality for cn1-codescan lib


I am using this lib https://github.com/codenameone/cn1-codescan to scan QR codes in my application. As I understand there is no functionality to change scanning/camera view right now in this lib

Currently, scanning view for Android it is just fullscreen camera view and for iOS smth like this http://zbar.sourceforge.net/iphone/userguide/scanning.html

Is there any way to add an overall image or change that camera view? Or is there any plans to add some LayredPane to the camera view in this lib?


Solution

  • This won't work for cn1-codescan since that library is implemented as an external native view. So we're effectively leaving Codename One to perform the scan. You can implement this natively within the library.

    Alternatively you can build a library that uses a widget approach instead of moving to a separate activity/view like the current solution. If it uses a peer component (like the camera kit or the Google Maps cn1libs) then you can implement overlays in Codename One.

    Notice that we only use zbar on iOS and on Android we use an activity which uses an external app to do the scanning. There's a 3rd party QR scanner (from Little Monkey) which embeds an Android implementation into the cn1lib. I'm not sure about the overlay implementation there.