Search Unity

Easy Code Scanner Unity plugin for Android and iOS

Discussion in 'Assets and Asset Store' started by C4MProdDev, Nov 22, 2012.

  1. WolfandVoid

    WolfandVoid

    Joined:
    Feb 20, 2013
    Posts:
    6
    I take it you never received my zip file with screenshots and crash logs I sent to Mathieu? Either way, thanks for fixing it, much appreciated!
     
  2. fanling3

    fanling3

    Joined:
    May 5, 2012
    Posts:
    12
    Hi, I'm interested in buying your product, but before that I want to confirm the features first.
    I will use this plugin on Android and PC, I need to generate QR codes for some users as userID on PC, print it out, and the user will bring the QR code to Android tablet, let the tablet reads it, and recognize his userID.
    Does your product serve this purpose? Thanks!
     
  3. C4M

    C4M

    Joined:
    Feb 7, 2013
    Posts:
    20
    Hi @fanling3, our product will only cover your need for Android. The code generation part is not included in our plugin.

    Best,
     
  4. Damien_C4M

    Damien_C4M

    Joined:
    Feb 8, 2013
    Posts:
    55
    The version 1.6 of EasyCodeScanner has been pushed to Unity3D few hours ago for review. It fixes the multiple scans issue and add landscape support for iOS above 5.0.
     
  5. fixitchris

    fixitchris

    Joined:
    Mar 16, 2011
    Posts:
    21
    checking 1.6 out now...

    doh.... for review...

    i'll wait patiently.
     
    Last edited: Apr 3, 2013
  6. angelodelvecchio

    angelodelvecchio

    Joined:
    Nov 15, 2012
    Posts:
    170
    Hi! hello folks!, an old employee used this plugin to make a great application! you can buy blindly!, many thanks for that!. I am having an issue, this employee no long works here, and now i have to make it again from scratch, and i am really low profile coder and i am having a problem: When i try to "Build and Run" it says:

    NI: Unable to find field id for 'currentActivity' (static)
    UnityEngine.AndroidJavaObject:GetStatic(String)
    EasyCodeScanner:launchScanner(Boolean, String, Int32, Boolean) (at Assets/Easy Code Scanner v1.5/EasyCodeScanner.cs:88)
    EasyCodeScannerExample:OnGUI() (at Assets/Easy Code Scanner v1.5/EasyCodeScannerExample.cs:71)

    JNI: Unable to find method id for 'getClass'
    UnityEngine.AndroidJavaObject:CallStatic(String, Object[])
    EasyCodeScanner:launchScanner(Boolean, String, Int32, Boolean) (at Assets/Easy Code Scanner v1.5/EasyCodeScanner.cs:95)
    EasyCodeScannerExample:OnGUI() (at Assets/Easy Code Scanner v1.5/EasyCodeScannerExample.cs:71)


    JNI: Unable to find method id for 'getName'
    UnityEngine.AndroidJavaObject:CallStatic(String, Object[])
    EasyCodeScanner:launchScanner(Boolean, String, Int32, Boolean) (at Assets/Easy Code Scanner v1.5/EasyCodeScanner.cs:95)
    EasyCodeScannerExample:OnGUI() (at Assets/Easy Code Scanner v1.5/EasyCodeScannerExample.cs:71)


    JNI: Unable to find method id for 'launchScannerImpl' (static)
    UnityEngine.AndroidJavaObject:CallStatic(String, Object[])
    EasyCodeScanner:launchScanner(Boolean, String, Int32, Boolean) (at Assets/Easy Code Scanner v1.5/EasyCodeScanner.cs:95)
    EasyCodeScannerExample:OnGUI() (at Assets/Easy Code Scanner v1.5/EasyCodeScannerExample.cs:71)

    Perhaps i am missing something ?

    and when exported to tablet( android ), i click launch scanner it crashes.
    Sorry to bother. Many thanks!
     
  7. mandolesibruno

    mandolesibruno

    Joined:
    Apr 5, 2013
    Posts:
    2
    Hi,

    I tried to read all the posts, and here is what I did:

    I downloaded the asset
    switched to iOS
    copied the plugins into the plugins folder
    dragged EasyCodeScannerExample on the camera of the scene

    and here is my list of problems:
    When testing inside unity:
    The referenced script on this Behaviour is missing!

    $Screen Shot 2013-04-05 at 5.32.55 PM.png

    then I tried building with the latest release of xcode, and here is the errors screenshot.
    $Screen Shot 2013-04-05 at 5.34.50 PM.png

    What am I doing wrong?
     
  8. WolfandVoid

    WolfandVoid

    Joined:
    Feb 20, 2013
    Posts:
    6
    Hey mandolesibruno,

    in xcode you need to enable c++ exceptions. That should fix your problem :)

    $Screen Shot 2013-04-09 at 10.14.20 AM.png
     
  9. Hunkahunka

    Hunkahunka

    Joined:
    Jul 5, 2012
    Posts:
    7
    Thank you again for implementing the two new methods. How can I access the black and white information right before decoding the data string? I don't need the photo taken by the user, I need the raw recognized B&W information of a QR Code like
    0000111000000
    11110000011111
    11110000011111
    0011001100111
    where 1 means black, 0 means white

    Is this possible? If not, could you please add it?
     
  10. Damien_C4M

    Damien_C4M

    Joined:
    Feb 8, 2013
    Posts:
    55
    @angelodelvecchio :

    It is because you plugin is not at the right location and thus not copied to Xcode or android bundles. As already said in the previous posts you need to put the plugin content directly under "Plugins/Android" or "Plugins/iOS".

    Instead of "Assets/Easy Code Scanner v1.5/EasyCodeScannerExample.cs" for instance, you should have "Assets/EasyCodeScannerExample.cs"
     
  11. mandolesibruno

    mandolesibruno

    Joined:
    Apr 5, 2013
    Posts:
    2
    thank you! now it works on iOS
     
  12. fixitchris

    fixitchris

    Joined:
    Mar 16, 2011
    Posts:
    21
    re: iPad Landscape Mode in 1.6 preview.

    We have tested 1.6 and most bugs seem fixed. The only remaining issue is that when a Unity app is configured to run in landscape only, the plugin UI does not start up correctly in landscape. The device has to be rotated to portrait and rotated back to landscape for the UI to work properly. We have sent you an email with photos and video.

    Can you give us an ETA on a fix for this?

    -chris
     
  13. fanling3

    fanling3

    Joined:
    May 5, 2012
    Posts:
    12
    For existing project, should I edit the manifest file under \Temp\StagingArea or just simply place the Plugins folder under \Asset Unity will override itself? (I didnt modify the manifest file before I use Easy Code Scanner)
     
  14. Claude_V

    Claude_V

    Joined:
    Apr 16, 2013
    Posts:
    31
    Running some tests with this plugin. It seems to work nicely on iOS, on Android however (on most of the devices) the camera seems really bad. I tried on Asus nexus, Galaxy tab II, ... and the bar codes are bleeding and thus the plugin is unable to read them.
    QR Codes however, work fine.
    As I need a bar code reader, and not a QR Code is there anything that can be done ? A work around ?
     
  15. Damien_C4M

    Damien_C4M

    Joined:
    Feb 8, 2013
    Posts:
    55
    @fanling3 :
    You just have to put the plugin at the regular place (assets) and edit your own Manifest with the additionnal activities and the permission. The Manifest provided in the plugin should be used as is only in a test project. Dont Edit the manifest in the Temp folder.
     
  16. Damien_C4M

    Damien_C4M

    Joined:
    Feb 8, 2013
    Posts:
    55
    @Claude_V :
    The camera quality depends on the device and its possibility to auto-focus. As for Barcode, EasyCodeScanner can read a wide variety of codes. You just have to specify in the type of code

    /*
    typedef enum zbar_symbol_type_e {
    ZBAR_NONE = 0, < no symbol decoded
    ZBAR_PARTIAL = 1, < intermediate status
    ZBAR_EAN8 = 8, < EAN-8 /
    ZBAR_UPCE = 9, < UPC-E
    ZBAR_ISBN10 = 10, < ISBN-10 (from EAN-13). @since 0.4
    ZBAR_UPCA = 12, < UPC-A
    ZBAR_EAN13 = 13, < EAN-13
    ZBAR_ISBN13 = 14, < ISBN-13 (from EAN-13). @since 0.4
    ZBAR_I25 = 25, < Interleaved 2 of 5. @since 0.4
    ZBAR_CODE39 = 39, < Code 39. @since 0.4
    ZBAR_PDF417 = 57, < PDF417. @since 0.6
    ZBAR_QRCODE = 64, < QR Code. @since 0.10
    ZBAR_CODE128 = 128, < Code 128
    ZBAR_SYMBOL = 0x00ff, < mask for base symbol type
    ZBAR_ADDON2 = 0x0200, < 2-digit add-on flag
    ZBAR_ADDON5 = 0x0500, < 5-digit add-on flag
    ZBAR_ADDON = 0x0700, < add-on flag mask
    } zbar_symbol_type_t;
    */
    //for instance, only Barcode
    launchScanner( true, "Scanning...", 13, true);
     
  17. Claude_V

    Claude_V

    Joined:
    Apr 16, 2013
    Posts:
    31
    Thanks for the quick reply Damien!

    On the Nexus 7 I could notice that the photo-application gives a far sharper image than the camera results trough the plugin.
    If you can think of any reason...
     
  18. NeedNap

    NeedNap

    Joined:
    Nov 1, 2012
    Posts:
    22
    I have the same problem that @fixitchris has: I have a Unity app that works only in landscape mode but when the camera start to read the qr-code the UI layout is wrong and the camera is rotated 90°.
    I need to change the device orientation at least once then it works.

    I use the scan function as:
    EasyCodeScanner.launchScanner(false, "Scanning...", 64, true);

    I set the "forceLandscape" param equals to true but it seems that it's ignored.

    Help me: I need to submit my app as soon as possible ;)
     
  19. Damien_C4M

    Damien_C4M

    Joined:
    Feb 8, 2013
    Posts:
    55
    @fixitchris @NeedCap : a version 1.7 has just been submitted to unity3D for review which fixes the UI bug with wrong orientation. It should be available very soon.
     
  20. BenQi

    BenQi

    Joined:
    Mar 18, 2013
    Posts:
    8
    hi Damien , I have just use the plugin on Android,, the problerm is the autofoucus works well on the firstopen, when use a second time and the autofoucus is not working. i see you have instant the mPreview in onResume() but the unity not use it maybe.
     
    Last edited: Apr 20, 2013
  21. Damien_C4M

    Damien_C4M

    Joined:
    Feb 8, 2013
    Posts:
    55
    @BenQi : We've made some tests and on a Galaxy Nexus we don't have focus issue, the resume is called and the focus is re-activated when the camera activity shows up.
    On which device/OS are you testing? Do you have the lastest plugin (1.6 or 1.7)?
     
  22. BenQi

    BenQi

    Joined:
    Mar 18, 2013
    Posts:
    8
    I have just test the 1.7 Version,and the focus goes fine. we use custom device to make vr hand show for the Miners,and i use it to make a new Interactive form ,and it looks very cool, your plugin is easy to use.


    i have test further------------
     
    Last edited: Apr 23, 2013
  23. BenQi

    BenQi

    Joined:
    Mar 18, 2013
    Posts:
    8
    @Damien_C4M , I have get the problerm,that

    1\\\ if i change the default orientation to "Portrait" from the Player setting on Inspector, and the EasyCodeScanner.launchScanner(true,"scan",-1,true), the autofoucus works fine.

    2\\\ if the default orientation to "Landscape Left" , EasyCodeScanner.launchScanner(true,"scan",-1,true) autofoucus bad working.

    3\\\ default orientation to "Landscape Left", EasyCodeScanner.launchScanner(true,"scan",-1,false) the autofoucus works fine.

    4\\\ default orientation to "Portrait" and Screen.orientation = ScreenOrientation.LandscapeLeft ; on runtime , EasyCodeScanner.launchScanner(true,"scan",-1,true), app crash and Quit.

    and the same with 1.6 Version.
     
    Last edited: Apr 23, 2013
  24. endrit.ali

    endrit.ali

    Joined:
    Apr 23, 2013
    Posts:
    1
    I have a problem using this plugin for an android project! I get errors such as:

    JNI: Unable to find method id for 'launchScannerImpl' (static)
    UnityEngine.AndroidJavaObject:CallStatic(String, Object[])
    EasyCodeScanner:launchScanner(Boolean, String, Int32, Boolean) (at Assets/EasyCodeScanner.cs:96)
    EasyCodeScannerExample:OnGUI() (at Assets/EasyCodeScannerExample.cs:71)

    etc.. is there a fix, someone has found a solution? any help will be grateful!

    or if someone can give a working example would be even better! plz
     
  25. Damien_C4M

    Damien_C4M

    Joined:
    Feb 8, 2013
    Posts:
    55
    @endrit.ali : Make sur you compile for real device and not for emulator. Check also you have the EZCodeScannerViewController.mm correctly copied by Unity3D in the library folder of the XCode project.
     
  26. Damien_C4M

    Damien_C4M

    Joined:
    Feb 8, 2013
    Posts:
    55
    @BenQI : For the cases 1, 2, 3 you reported I don't have any focus issues on my side.

    For the Portrait mode in the player settings and then forcing LandscapeLeft at runtime, I also go an app not starting but I guess it is more due to unity3D (project even not starting) than due to the EasyCodeScanner plugin.
     
  27. NeedNap

    NeedNap

    Joined:
    Nov 1, 2012
    Posts:
    22
    The new version (v1.7) solve the UI issue when the application runs easy code scanner the first time, but if the phone orientation is landscape the camera rotation still remain in portrait mode.

    The code scan works still works well.

    It's a great plugin!!
     
    Last edited: Apr 26, 2013
  28. C4M

    C4M

    Joined:
    Feb 7, 2013
    Posts:
    20
    Hello you all scanning folks ! :)
    Just thought we'd do a bit of self promo here, we have our new plugin that's just out.
    What it does is let you integrate Google's latest Analytics into your game. Google Analytics has limitation, but it's respect of privacy and ability to handle big loads for free is unmatched.

    We developed this plugin to be able to track how players were using our latest game Tekken Card, as well as track campaigns efficiencies...

    You'll Easy Analytics here.

    Expect same constant support as for Code Scanner simply because we're using it in production titles.


    End of the promo alert!
     
  29. fanling3

    fanling3

    Joined:
    May 5, 2012
    Posts:
    12
    Hi I'm using the plugin it works well. However I wana to have a function, after let's say 30sec, if the scanner cant scan anything the scanner will quit. I'm not sure how to do this with the current plugin as it seems the program goes inside the launcher part and I have no control with it. Thanks!
     
  30. Damien_C4M

    Damien_C4M

    Joined:
    Feb 8, 2013
    Posts:
    55
    @fanling3

    You can archive that pretty easily.

    Android:
    Open the provided soiurce code in Eclispe and all you need is to add the following snippet in the onStart() method of the CameraActivity.java :


    mHandler.postDelayed(new Runnable() {
    @Override
    public void run() {
    onBackPressed();
    }
    }, 30000);


    Then in Eclipse export a new jar file to /Assets/Plugins/Android/EZCodeScanner.jar

    iPhone:

    Add the following piece of code for example in the iniWithUI method of EZCodeScannerViewController.mm

    [self performSelector:mad:selector(quit) withObject:nil afterDelay:30.0];


    Tell me if you manage to archive it.

    Regards
     
  31. fanling3

    fanling3

    Joined:
    May 5, 2012
    Posts:
    12
    Thanks for reply, when I open your project with Esclipse, there are many errors like:
    with those @Override

    So I removed all those errors by removing @Override and compile to jar file, I noticed that my compiled jar file is 2mb while your original one is only 22kb. After I replaced the new jar and export my project on Android. The scanner is able to launch, however after 30sec error message pops up, telling me the application stops running. Looks like there are errors with the new code.

    Here is my new OnStart function according to your reply:

    I'm using Eclipse3.7.2 on WindowsXP, with Android 4.2.2 API 17. It would be great help if you can provide a modified jar. Thanks!
     
    Last edited: May 22, 2013
  32. tmeyers

    tmeyers

    Joined:
    Aug 13, 2012
    Posts:
    5
    I'm having an issue with the QR Code Scanner on iOS. Our project's orientation is landscape right, and while holding it this way and starting the QR Scanner causes the camera to display incorrectly. The camera data is essentially displaying 90 degrees off, causing up and down movement to show the screen moving left and right. Holding the device any other way but the correct way causes the camera to display correctly, and rotating the device while the scanner is open fixes the camera for that instance. Know of any possible cause for this issue?
     
  33. Damien_C4M

    Damien_C4M

    Joined:
    Feb 8, 2013
    Posts:
    55
    @fanling

    You can replace the onBackPressed(); method by the finish() method to make it work correctly. Here seems that android doesn't like the super.onBackPress() done automatically.

    Please find the compiled jar file with the 30 sec time out:

    http://ftp.c4mprod.com/ezcodescanner/EZCodeScanner.jar
     
  34. Damien_C4M

    Damien_C4M

    Joined:
    Feb 8, 2013
    Posts:
    55
    @tmeyers : We've managed to reproduce the issue. the project has to be configured in landscape right, the plgin in force landscape but holding the phone in portrait position.
    We will update the plugin as soon as there is a fix. Thanks for pointing out the isssue
     
  35. fanling3

    fanling3

    Joined:
    May 5, 2012
    Posts:
    12
    It works! Your support is appreciated!
     
  36. WolfandVoid

    WolfandVoid

    Joined:
    Feb 20, 2013
    Posts:
    6
    Hey guys,

    was wondering if the delay after scanning is necessary or if it would be possible to remove without any problems?

    in readerView@EZCodeScannerViewController.mm: [self performSelector:mad:selector(quit) withObject:nil afterDelay:1.0];

    Thanks
    Phil
     
  37. C4M

    C4M

    Joined:
    Feb 7, 2013
    Posts:
    20
    Hello Phil,

    we put this delay to prevent rescanning of the same code. So it should be ok. I would still leave a delay, albeit shorter.

    (cool project you're working on :) Us, we're working on and developed the plugin for Tekken Card Tournament).
     
  38. apago

    apago

    Joined:
    Jun 5, 2013
    Posts:
    1
    hello
    I'm using the scanner version 1.7 on iPad and i notice it crashes sometime when i'm decoding a QRcode, it also happen with the example provided. Also do you know if it's possible to setup the video display correctly because when i build in landscape on left it looks rotated to 90° clockwise
    Thanks
     
    Last edited: Jun 5, 2013
  39. bubicus

    bubicus

    Joined:
    Apr 18, 2013
    Posts:
    8
    @tmeyers, @apago, etc:

    I was able to partially fix the rotation problem in iOS by adding this to the end of initCamera() in EZCodeScannerViewController.mm:


    Code (csharp):
    1.     UIDeviceOrientation orientation = [UIDevice currentDevice].orientation;
    2.  
    3.     [mReader willRotateToInterfaceOrientation:orientation duration:0.1f];
    The orientation will now be correct if the user starts in any mode,but the scanner view will still be messed up in portrait mode. Regardless, it does make the camera view have the correct orientation at startup. :D

    C4m, will the next version have an official fix for the rotation problems? Any ETA? (I have a deadline soon... my hack is OK, but a real fix would be preferred.)
     
  40. bubicus

    bubicus

    Joined:
    Apr 18, 2013
    Posts:
    8
    Actually, this code seems to fix the scanner view problem (I added a line to force the view controller to update, too):

    Code (csharp):
    1.     UIDeviceOrientation orientation = [UIDevice currentDevice].orientation;
    2.     [mReader willRotateToInterfaceOrientation:orientation duration:0.1f];
    3.     [UIViewController attemptRotationToDeviceOrientation];
    After forcing the view to rotate after initialization, the scanner view will no longer show multiple 'windows' in portrait mode.
     
  41. Damien_C4M

    Damien_C4M

    Joined:
    Feb 8, 2013
    Posts:
    55
    @ bubicus : a 1.8 version has been released and should be available on the store right now (have been notified this morning it has been accepted). It should fix the rotation issue.

    It doesn't have a forced orientation window but should correctly display the frame according to the rotation and orientations.

    You can give it a try if you wish.
     
  42. bubicus

    bubicus

    Joined:
    Apr 18, 2013
    Posts:
    8
    It seems to work correctly now. Thanks!
     
  43. claver

    claver

    Joined:
    May 29, 2013
    Posts:
    11
    I am running into a certain amount of issues with this plugin.

    Version 1.7 was very buggy with wrong rotations and the transparent border out of place.

    Version 1.8 doesn't seem to have the same issues but fixing the entire thing but the camera plane does
    not look very nice (OS 5.x) on OS 6.x the border follows the rotation however the camera plane jumps.
    At certain points the camera plane is wrongly turned.

    For now I have patched v1.7 and I have a very minor bug on ios5/iphone4s

    On Android...
    - Nexus 7 the camera is flipped horizontally and apart from having a hard time getting the bar codes read now and than the returned bar code is wrong.
    - Kindle fire has the screen flipped upside down. How can the user possibly scan something with the interfaces flipped

    HELP !!
     
    Last edited: Jun 12, 2013
  44. Damien_C4M

    Damien_C4M

    Joined:
    Feb 8, 2013
    Posts:
    55
    @claver : Thanks for the detailed feedbacks!

    First do you have the latest version 1.8? The previous post from Bubicus and our internal implementation of the plugin in our game (Tekken card tournament) solved the orientation issues.

    On Android we do also specifically test the plugin on a Nexus 7 and a Kindle Fire and haven't experienced the described issues so far.

    We will make a set of test and try to find out why you experience such issue and come back to you soon!
     
  45. claver

    claver

    Joined:
    May 29, 2013
    Posts:
    11
    Damien,

    I changed my post as I tested the 1.8 this morning. As I work on a product for a "big" client, they are very much picking on the rotation issues.

    I do not understand why you are not seeing the same on Kindle fire. In Unity I have auto rotation and landscape left and right ticked.
    The camera plane on Kindle is upside-down.

    On the Nexus 7 the camera plane is horizontally flipped, which I presume is "standard" for front cameras. However that one sometimes returns
    "valid" but wrong scanned bar codes.
    I have a code bar 3222475313462 which, when read on the nexus 7, sometimes is OK and sometimes gives me
    values starting with 7261... and 00718...

    13/06/2013 : the same issue is seen on the Kindle Fire. The bar codes scanned do not always return the right digits.
    The least I can say is that this is very annoying.

    13/06/2013 : Tested on different Android devices. When scanning multiple times the same bar code the scanned
    digits are validated by the scanner but are completely different from the scanned code bar value.


    Thanks.
     
    Last edited: Jun 13, 2013
  46. tmeyers

    tmeyers

    Joined:
    Aug 13, 2012
    Posts:
    5
    @Damien_C4M Version 1.8 fixed my issue, thanks for the support!
     
  47. Damien_C4M

    Damien_C4M

    Joined:
    Feb 8, 2013
    Posts:
    55
    @claver : On the Nexus 7, yes the image is mirrored and it is totally normal, and we were able to scan barcodes without wrong code returned. By the way since there is no autofocus and the camera resolution is super low it might be possible that it could wrongly decode some codes.

    On the fire I couldn't test it yet since the Kindle we have here is the normal one (not the HD) and there is no camera on it. Will get back to you when we grab a HD one with camera.
     
  48. claver

    claver

    Joined:
    May 29, 2013
    Posts:
    11
    Thanks for checking Damien.
    I figured the mirrored image is some "standard" thing on Nexus 7, though trying to scan a product with the camera mirrored is not so easy for the
    users.

    Concerning the wrong code bar values, this happens within the scanner. "Scanning..." changes into the read value before quitting. If I would have
    more time I would investigate, but unfortunately I haven't any time :( ... it may be the first scan happens right all the time and when scanning the
    same code bar multiple times it goes wrong...

    Thanks for your help !
     
  49. fanling3

    fanling3

    Joined:
    May 5, 2012
    Posts:
    12
    Hi I am facing a problem after I installed GMD Hide Bar. The screen will turn black most of the time (not 100% though but around 70%) after I scanned QR code successfully. The app is still running since I can hear the sound effect. I have to click the power button on my device once to turn off the screen and turn it on again to see my app again. I made some tests with the auto-quit function you gave me:

    It still makes the screen turning black but less often. It means it is caused by finish() or something. Any idea?
     
    Last edited: Jun 18, 2013
  50. Damien_C4M

    Damien_C4M

    Joined:
    Feb 8, 2013
    Posts:
    55
    @fanling3 : Yes It might be because of GMD Hide Bar and the combinaison of camera (the plugin) and Unity3D engine. I might not be able to find a workaround for that.