Giter Site home page Giter Site logo

bluefletch / motorola-datawedge-cordova-plugin Goto Github PK

View Code? Open in Web Editor NEW
33.0 33.0 36.0 25 KB

This is a Cordova/Phonegap plugin to interact with Motorola ruggedized Android devices' Barcode Scanners and Magnetic Stripe Readers (eg, ET1, TC55, MC40). The plugin works by interacting with the "DataWedge" application configured to output scan and magstripe read events.

Java 82.90% JavaScript 17.10%

motorola-datawedge-cordova-plugin's People

Contributors

17cupsofcoffee avatar alanlampa avatar blakebyrnes avatar macmario avatar odlp avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  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  avatar  avatar  avatar  avatar

motorola-datawedge-cordova-plugin's Issues

Not receiving barcode callback

Hi,

I've managed to get my cordova app to initiate a barcode scan (softkey) on a Motorola TC55 but don't receive the callback with barcode data.

I've configured a new DataWedge profile to Broadcast intent & the default action of com.bluefletch.motorola.datawedge.ACTION in the profile itself. Using logcat in USB debugging I can see the app registering the broadcast receiver.

Do I need to configure the intent category in Datawedge, or add an intent filter to the AndroidManifest.xml?

Many thanks,
Oli

DataWedge version 1.7.6, Scanning framework 1.18.P03. Motorola TC55 running Android 4.1.2.

Cordova 5.4.0 with MC40 barcode event listener

Using the newest version of cordova. I have the datawedge app installed on the phone and configured to point to my app. I am having a hard time building the register for the event listener for when I can a barcode. Any ideas on what I could be missing? Thanks

var resultDiv;

var app = {
    // Application Constructor
    initialize: function() {
        this.bindEvents();
        document.querySelector("#startScan").addEventListener("touchend",
            app.startScan, false);
        resultDiv = document.querySelector("#results");

        console.log("Can I see this log !!!!!!!!!!");
    },
    // Bind Event Listeners
    //
    // Bind any events that are required on startup. Common events are:
    // 'load', 'deviceready', 'offline', and 'online'.
    bindEvents: function() {
        document.addEventListener('deviceready', this.onDeviceReady, false);
    },
    // deviceready Event Handler
    //
    // The scope of 'this' is the event. In order to call the 'receivedEvent'
    // function, we must explicitly call 'app.receivedEvent(...);'
    onDeviceReady: function() {
        app.receivedEvent('deviceready');

        datawedge.registerForBarcode(function(data) {
            console.log("Event!!!!!!!!!!!!!!");
        });
    },
    // Update DOM on a Received Event
    receivedEvent: function(id) {
        var parentElement = document.getElementById(id);
        var listeningElement = parentElement.querySelector('.listening');
        var receivedElement = parentElement.querySelector('.received');

        listeningElement.setAttribute('style', 'display:none;');
        receivedElement.setAttribute('style', 'display:block;');

        console.log('Received Event: ' + id);
    },
    startScan: function() {
        cordova.plugins.barcodeScanner.scan(
            function (result) {
                var s = "Result: " + result.text + "<br/>" +
                    "Format: " + result.format + "<br/>" +
                        "Cancelled: " + result.cancelled;
                        resultDiv.innerHTML = s;
            },
            function (error) {
                alert("Scanning failed: " + error);
            }
        );
    }
};

app.initialize();

Looking at logcat, when I do the scan and it finds something, this is what shows in the logs

D/libimgkit(  516): sysflags 35
E/V4LImagerAdapter(  516): Guard failed
E/NotificationService(  291): Ignoring notification with icon==0: Notification(pri=0 contentView=null vibrate=null sound=null defaults=0x0 flags=0x1 kind=[null])
E/TimeInterpolator(  123): Error: calling void android::TimeInterpolator::resume()() when not in PAUSED state
W/TimeInterpolator(  123): time is rewinding: -43450 Tf=1 t0=16849656860 pos0=-43480 dt=30 now=16849656890 last=0 now_last=0
D/AudioSpeexSRC(  123): AudioResamplerSpeex::reset()
E/V4LImagerAdapter(  516): Successfully sent 1 VIDIOC_S_EXT_CTRLS ioctl
I/ActivityManager(  291): START u0 {act=com.bluefletch.motorola.datawedge.ACTION flg=0x10000000 cmp=com.eBayEnterprise.picker/.MainActivity (has extras)} from pid 516
E/NotificationService(  291): Ignoring notification with icon==0: Notification(pri=0 contentView=null vibrate=null sound=null defaults=0x0 flags=0x1 kind=[null])
D/dalvikvm(30035): GC_CONCURRENT freed 578K, 8% free 9465K/10247K, paused 14ms+3ms, total 42ms
D/dalvikvm(  291): GC_CONCURRENT freed 1232K, 15% free 14785K/17287K, paused 23ms+8ms, total 225ms

Android : datawedge.switchProfile() does not seem to be working?

I am calling the switchProfile() method in my Cordova App, but I don't see any difference in the scanner functionality. In my case, I have 2 profiles created in the DataWedge.apk (app). One has the Keyboard output property enabled (x), and the other has it disabled( ). When I call the method to switch the profile, I don't see any difference (i.e. the scanner output is always placed onto the standard io/keyboard and ends up in the input field with focus). I have event tired setting it in the debugger (chrome device debugging) to be sure the method exists on the window.datawedge object (and it does). Here is the actual command being issues in Javascript:

window.datawedge.switchProfile("DisableKeyboard");

I have associated the default profile ('EnableKeyboard' in my case) to my app in the DataWedge profile configuration. DataWedge will not allow associating my app with more than one profile, so the 'DisableKeyboard' profile is not associated to any apps (makes sense as the DataWedge need so know the 'default' behavior - my guess...).

Any ideas?

I am getting a resource not loaded on cordova 3.5.0

I am getting a failed to load resource on the device when it is loading. Using the telerik appbuilder environment i have loaded the plugin file:
<script type="text/javascript" charset="utf-8" src="Plugins/motorola-datawedge-cordova-plugin-master/datawedge.js"></script>

This is where the item is failing.

What version of Cordova do you support for this plugin.

Is there anything in the android.xml file that i need to add since i am using the defaults for the datawedge.

What am i missing?

Motorola CS3070

Hey, i got question. Can i use this plugin to develop android app which will be used in standart mobile phones no zebra device or something like that...? Im trying to send data via bluetooth from Motorola CS3070 to android app directly and not to keyboard. I tried many bluetooth plugins to connect and send data but i cant even connect and i dont know how..so can i used this plugin for my purpose?

onReceive isn't triggert

I receive no response intent from the datawedge scanner. The Scanner is starting, scanning, stopping and logging the result and the sending of the broadcast to my defined "de.schnti.todo.SCAN" action. I defined this URL here:

datawedge.start("de.schnti.todo.SCAN");

here

<intent-filter>
     <action android:name="de.schnti.todo.SCAN"/>
    <category android:name="android.intent.category.DEFAULT"/>
</intent-filter>

and in the DataWedge App.

However, I get no result. The

    private BroadcastReceiver dataReceiver = new BroadcastReceiver() {
        @Override
        public void onReceive(Context context, Intent intent) {
             Log.i(TAG, "Data receiver trigged");

issn`t triggert

Scanning stops on TC51

Hi,
I am trying to use this cordova plugin with TC51. The scanner hangs after continuos scans. The error message is "Unexpected error occurred during scanning service". Please let me know if this plugin supports TC51. Also do let me know if anyone else has encountered this issue.

Thanks,
Sandeep

Unable to run code

Hey, I'm new to this type of developing and I would greatly appreciate some help. I am using telerik app builder which uses a cordova framework. I added the plugin and the example code but I receive the error "Uncaught ReferenceError: datawedge is not defined". Do you know what could be causing this?

Not getting callback in datawedge.registerForBarcode event in Datawedge plugin

Hi,

Requirement:

I am using Motorola's T70 Device and we are making a hybrid application using HTML5+CSS with Javasript framework angular JS and stuck in scanning realated activity. We want to get the scanned value without tapping on input field (textbox).

Issue:

I am not able to get the callback in datawedge.registerForBarcode event in Datawedge plugin. Any help would be appriciated. Thanks in advance.

What we implemented yet

To implement the barcode scanning functionality in the device we are using the Datawedge Plugin and after installation of plugin we are not getting the scanned value in callback event (datawedge.registerForBarcode) when user scan the barcode.

Below are the extra details and information

Device : Motorola T70 Barcode scanner
Scanning Framework: 3.0..38
Datawedge App in device(T 70) version : 2.1.7
Profile we are using in Device: Default Profile
Motorola Cordova Plugin: 0.1.0
Plugin ID: com.bluefletch.motorola

Code related details:

document.addEventListener('deviceready', function () {
if (window.datawedge) {

        datawedge.start(); //uses default

    }

    datawedge.registerForBarcode(function (data) {
        var labelType = data.type,
            barcode = data.barcode;
    });

}, false);

//We have configured the same action in the datawedge default profile as mentioned below and also put the blank in the category option.
//Plugin.xml



//AndroidManifest.xml









question about multiple screens and this plugin

I have multiple screens in my application that use the datawedge to push input into the textbox on my screen. Each screen uses the barcode input differently.

How do i register the event processor in the plugin to service the screen that is currently in use? Then when i change screens, i would like to have the button on the MC40 trigger the barcode read, and have the results into the screen displayed? Can you send me a snippet that will do this. Currently each textbox has a dataclick event to process the reads from the camera, but i would like to use the scanner button on the MC40 to do this.

Killing the app and restarting makes scanner stop working

Hi,

I am testing this scanner on Motorola TC55, Android versin 4.1.2

Running datawedge.start(), datawedge.registerForBarcode and datawedge.startScanner() work just fine when the app is run the first time from Eclipse (with USB debugging)

But when I kill the app on the phone (swipe it off from Recent apps), and launch it again,
now the scanner stops calling its callback registered with registerForBarcode

I am using IBM Worklight, and using this plugin with default settings.

Please help..

Intent category "DEFAULT"

First of all - great plugin!

I am on the Motorolo MC40N0. Just wanted to add that I had to set the Intent category to "DEFAULT" using profil0 what, in my opinion, is not clear reading the readme.

Callback settings on MC3200

I had some troubles with custom profile and registerForBarcode callback on MC3200, the combination that finally worked was:

  • Defaults for javascript - datawedge.start();

  • Setup custom profile's intent with empty category

    action: com.bluefletch.motorola.datawedge.ACTION
    category: empty
    delivery: startActivity

mc3200-intent-1 mc3200-intent-2

  • Specify DEFAULT category in AndroidManifest.xml

        <intent-filter>
            <action android:name="com.bluefletch.motorola.datawedge.ACTION" />
            <category android:name="android.intent.category.DEFAULT" />
        </intent-filter>
    

Perhaps you could add the category to plugin.xml if it doesn't affect other devices?

Continuous read not working

Hi, I'm using this plugin in an ionic 3 application and testing it on a TC55. I created a soft button to start the scanner and it works great. However when I configure the datawedge profile ReaderParams and set the Aim Type to 'Continuous Read', it still closes the scanner after each read. Is there any way to let the scanner remain active after each read?

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.