Git Product home page Git Product logo

acktie-mobile-android-barcode's People

Contributors

acktie avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

acktie-mobile-android-barcode's Issues

DataMatrix?

No issue ... but it would be great if the scanner can also recognize DataMatrix code!

UPC alone not working.

When the UPC array is used (per the example), Android devices fail to recognize any barcodes. Only when UPC includes EAN are you able to scan UPC barcodes.

Ti SDK 5.1.2.GA and Android API 23 exception

It worked fine on Ti SDK 5.0.2.GA and Android API 21, now it is not working anymore.

[ERROR] :  linker: /data/app/com.myapp-1/lib/arm/libiconv.so: has text relocations
[ERROR] :  TiApplication: (main) [12,178] Sending event: exception on thread: main msg:java.lang.UnsatisfiedLinkError: dlopen failed: /data/app/com.myapp-1/lib/arm/libiconv.so: has text relocations; Titanium 5.1.2,2015/12/16 19:00,ca822b2
[ERROR] :  TiApplication: java.lang.UnsatisfiedLinkError: dlopen failed: /data/app/com.myapp-1/lib/arm/libiconv.so: has text relocations
[ERROR] :  TiApplication:   at java.lang.Runtime.loadLibrary(Runtime.java:372)
[ERROR] :  TiApplication:   at java.lang.System.loadLibrary(System.java:1076)
[ERROR] :  TiApplication:   at com.acktie.mobile.android.barcode.AcktiemobileandroidbarcodeModule.<clinit>(AcktiemobileandroidbarcodeModule.java:24)
[ERROR] :  TiApplication:   at com.myapp.MyappApplication.onCreate(MyappApplication.java:159)
[ERROR] :  TiApplication:   at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1013)
[ERROR] :  TiApplication:   at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4707)
[ERROR] :  TiApplication:   at android.app.ActivityThread.-wrap1(ActivityThread.java)
[ERROR] :  TiApplication:   at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1405)
[ERROR] :  TiApplication:   at android.os.Handler.dispatchMessage(Handler.java:102)
[ERROR] :  TiApplication:   at android.os.Looper.loop(Looper.java:148)
[ERROR] :  TiApplication:   at android.app.ActivityThread.main(ActivityThread.java:5417)
[ERROR] :  TiApplication:   at java.lang.reflect.Method.invoke(Native Method)
[ERROR] :  TiApplication:   at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
[ERROR] :  TiApplication:   at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)

Please, it is by far the best barcode scanner module out there!

Question About App Backgrounding Crash

I know you guys are probably not doing much more work on this having moved off of titanium (from what I remember), so this is more just a question incase you have any thoughts (as it's causing a much larger issue than I assumed it would :) ).

I'm seeing a crash happen a lot any time I'm on a page with a BarcodeView on it and I background the app. The crash seems to happen as soon as I open the app back up (or possibly after backgrounding, I'm not quite sure yet as I don't notice it until I open it again).

The log coming from the crash is:

0   
java.lang.NullPointerException
1   
at com.acktie.mobile.android.camera.CameraSurfaceView.surfaceCreated(CameraSurfaceView.java:87)
2   
at android.view.SurfaceView.updateWindow(SurfaceView.java:586)
3   
at android.view.SurfaceView.onWindowVisibilityChanged(SurfaceView.java:236)
4   
at android.view.View.dispatchWindowVisibilityChanged(View.java:7802)
5   
at android.view.ViewGroup.dispatchWindowVisibilityChanged(ViewGroup.java:1080)
6   
at android.view.ViewGroup.dispatchWindowVisibilityChanged(ViewGroup.java:1080)
7   
at android.view.ViewGroup.dispatchWindowVisibilityChanged(ViewGroup.java:1080)
8   
at android.view.ViewGroup.dispatchWindowVisibilityChanged(ViewGroup.java:1080)
9   
at android.view.ViewGroup.dispatchWindowVisibilityChanged(ViewGroup.java:1080)
10  
at android.view.ViewGroup.dispatchWindowVisibilityChanged(ViewGroup.java:1080)

I'm going to keep looking around, it looks somewhat related to this (http://stackoverflow.com/questions/7850419/android-surfaceview-crashes-when-go-to-background) but if anything comes to mind that mind help I'd be extremely grateful!

Thanks!

Android Scan Crop

Currently the Android version lacks real-world applicability due to the inability to determine what is being scanned when codes are close together. Store shelves, warehouses, and other places where products are grouped together will not work in this instance. zBar has a scan crop method but I am not sure zBar is being utilized in this way, so I am unable to correctly add to the module.

App force closes

Using essentially the code from your sample app the barcode scans, the barCodeWindow closes, and the module calls my success function (which opens a new window). Upon closing that window, I see the following in Monitor:

10-09 10:37:18.739: E/AndroidRuntime(15566): FATAL EXCEPTION: main
10-09 10:37:18.739: E/AndroidRuntime(15566): java.lang.NullPointerException
10-09 10:37:18.739: E/AndroidRuntime(15566):    at com.acktie.mobile.android.camera.CameraSurfaceView.surfaceCreated(CameraSurfaceView.java:87)
10-09 10:37:18.739: E/AndroidRuntime(15566):    at android.view.SurfaceView.updateWindow(SurfaceView.java:569)
10-09 10:37:18.739: E/AndroidRuntime(15566):    at android.view.SurfaceView.onWindowVisibilityChanged(SurfaceView.java:231)
10-09 10:37:18.739: E/AndroidRuntime(15566):    at android.view.View.dispatchWindowVisibilityChanged(View.java:7544)
10-09 10:37:18.739: E/AndroidRuntime(15566):    at android.view.ViewGroup.dispatchWindowVisibilityChanged(ViewGroup.java:1039)
10-09 10:37:18.739: E/AndroidRuntime(15566):    at android.view.ViewGroup.dispatchWindowVisibilityChanged(ViewGroup.java:1039)
10-09 10:37:18.739: E/AndroidRuntime(15566):    at android.view.ViewGroup.dispatchWindowVisibilityChanged(ViewGroup.java:1039)
10-09 10:37:18.739: E/AndroidRuntime(15566):    at android.view.ViewGroup.dispatchWindowVisibilityChanged(ViewGroup.java:1039)
10-09 10:37:18.739: E/AndroidRuntime(15566):    at android.view.ViewGroup.dispatchWindowVisibilityChanged(ViewGroup.java:1039)
10-09 10:37:18.739: E/AndroidRuntime(15566):    at android.view.ViewGroup.dispatchWindowVisibilityChanged(ViewGroup.java:1039)
10-09 10:37:18.739: E/AndroidRuntime(15566):    at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1211)
10-09 10:37:18.739: E/AndroidRuntime(15566):    at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:989)
10-09 10:37:18.739: E/AndroidRuntime(15566):    at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:4351)
10-09 10:37:18.739: E/AndroidRuntime(15566):    at android.view.Choreographer$CallbackRecord.run(Choreographer.java:749)
10-09 10:37:18.739: E/AndroidRuntime(15566):    at android.view.Choreographer.doCallbacks(Choreographer.java:562)
10-09 10:37:18.739: E/AndroidRuntime(15566):    at android.view.Choreographer.doFrame(Choreographer.java:532)
10-09 10:37:18.739: E/AndroidRuntime(15566):    at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:735)
10-09 10:37:18.739: E/AndroidRuntime(15566):    at android.os.Handler.handleCallback(Handler.java:725)
10-09 10:37:18.739: E/AndroidRuntime(15566):    at android.os.Handler.dispatchMessage(Handler.java:92)
10-09 10:37:18.739: E/AndroidRuntime(15566):    at android.os.Looper.loop(Looper.java:137)
10-09 10:37:18.739: E/AndroidRuntime(15566):    at android.app.ActivityThread.main(ActivityThread.java:5041)
10-09 10:37:18.739: E/AndroidRuntime(15566):    at java.lang.reflect.Method.invokeNative(Native Method)
10-09 10:37:18.739: E/AndroidRuntime(15566):    at java.lang.reflect.Method.invoke(Method.java:511)
10-09 10:37:18.739: E/AndroidRuntime(15566):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
10-09 10:37:18.739: E/AndroidRuntime(15566):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
10-09 10:37:18.739: E/AndroidRuntime(15566):    at dalvik.system.NativeStart.main(Native Method)
10-09 10:37:18.747: W/ActivityManager(379):   Force finishing activity com.myorg.demo/org.appcelerator.titanium.TiActivity

Further details:

  • I am using a custom build of your module because the GUID used on your GitHub repo has been reused or something. I get license verification errors if I use one of the dist versions.
  • I changed the paths to my SDK, NDK, etc. but did not change your actual module code in any way.
  • I have tried building with both the 3.5.1.GA and 5.0.0.GA Titanium SDKs and get the same result with both.
  • I am testing on a Galaxy Nexus running Android 4.2.2. I see the same error on a S5 running 5.0.0.
  • My test app is a tab-based app. A button on a tab launches the code I adapted from your sample app, specifically the scanBarcodeFromCamera() function. Thus, your code has me opening a non-modal window atop a tab group, which is generally not something Titanium likes you to do.
var barcodescanner;
function showScanner() {
    barcodescanner = require("com.acktie.mobile.android.barcode");
    var CODE = [
        "CODE39",
        "CODE93",
        "CODE128",
    ];
    var options = {
        backgroundColor: 'black',
        width: '100%',
        height: '90%',
        top: 0,
        left: 0,
        allowZoom: true,
        userControlLight: false,
        barcodes: CODE,
        success: success,
        cancel: cancel,
        error: error
    };

    scanBarcodeFromCamera(options);
}

function success(e) {
    // async func here to look up the barcode and open 
    // new window on success. this works, however, closing
    // that new window shows the crash
    lookupBarcode(e.data, onSuccess, onError);
}

function scanBarcodeFromCamera(options) {
    var barcodeCodeWindow = Titanium.UI.createWindow({
        backgroundColor: 'black',
        width: '100%',
        height: '100%',
        theme: "Theme.AppCompat.NoTitleBar.Fullscreen"
    });
    var barcodeCodeView = barcodescanner.createBarcodeView(options);

    var closeButton = Titanium.UI.createButton({
        title: "Cancel",
        bottom: 0,
        left: 0
    });
    var lightToggle = Ti.UI.createSwitch({
        value: false,
        bottom: 0,
        right: 0
    });

    closeButton.addEventListener('click', function () {
        barcodeCodeView.stop();
        barcodeCodeWindow.close();
    });

    lightToggle.addEventListener('change', function () {
        barcodeCodeView.toggleLight();
    });

    barcodeCodeWindow.add(barcodeCodeView);
    barcodeCodeWindow.add(closeButton);

    if (options.userControlLight !== undefined && options.userControlLight) {
        barcodeCodeWindow.add(lightToggle);
    }

    // NOTE: Do not make the window Modal.  It screws stuff up.  Not sure why
    barcodeCodeWindow.open();
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.