acktie / acktie-mobile-android-barcode Goto Github PK
View Code? Open in Web Editor NEWAcktie Mobile Barcode module is an easy to use yet powerful barcode reader.
License: Other
Acktie Mobile Barcode module is an easy to use yet powerful barcode reader.
License: Other
No issue ... but it would be great if the scanner can also recognize DataMatrix code!
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.
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!
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!
Apps no longer work, crash with no error when using this module on a Marshmallow device.
Is there a reason that the requestedOrientation is set to portrait?
The scanner is not scanning some barcodes.
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.
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:
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();
}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.