Manatee Works Barcode Scanner Plugin

Version 1.9.1

Guide on how to add the Manatee Works Barcode Scanner Phonegap plugin to your project(s)

For more in-depth info, visit our website at www.manateeworks.com

##Install using CLI interface (Phonegap 3.0 and above)

     phonegap plugin add manateeworks-barcodescanner


or   

    phonegap local plugin add https://github.com/manateeworks/phonegap-mwbarcodescanner.git
or   

    phonegap local plugin add LOCAL_PATH_TO_THE_FOLDER_WITH_PLUGIN (if you are adding from local folder)   
or  install using plugman: (your platform should be already built)

    plugman install --platform ios|android --project platforms/ios|platforms/android --plugin com.manateeworks.barcodescanner --plugins_dir plugins/ --www www/ 
    <form style="width: 100%; text-align: center;">
        <input type="button" value="Scan Barcode" onclick="scanner.startScanning()" style="font-size: 40px; width: 300px; height: 50px; margin-top: 100px;"/>
    </form>

###How to build online with bulid.phonegap.com:

    <form style="width: 100%; text-align: center;">
        <input type="button" value="Scan Barcode" onclick="scanner.startScanning()" style="font-size: 40px; width: 300px; height: 50px; margin-top: 100px;"/>
    </form>

##How to scan an image

##How to scan in partial screen view

##Important change in 1.9

New feature: Parsers. Users can now parse the scanned result.

 mwbs['MWBsetActiveParser'](constants.MWP_PARSER_MASK_ISBT);
    Available options:
           MWP_PARSER_MASK_NONE
           MWP_PARSER_MASK_AUTO 
           MWP_PARSER_MASK_GS1 
           MWP_PARSER_MASK_IUID
           MWP_PARSER_MASK_ISBT
           MWP_PARSER_MASK_AAMVA
           MWP_PARSER_MASK_HIBC

##Important change in 1.8.8

Support for android app permissions requires using Cordova-Android 5.0.0+. In order to use our plugin on Cordova-Android <5.0.0 consider downgrading to 1.8.7

##Important change in 1.5

This library is now thread safe and multithreading is enabled. Users have the option to set the maximum number of threads (CPUs) the scanner can use by adding this line in the decoder initialization:

 mwbs['MWBsetMaxThreads'](NUM_OF_MAX_THREADS)

###Important change in 1.4

Users now can put decoder initialization and callback in separate Javascript file, so that they don’t lose their changes when they update the plugin. Sample file is js/MWBConfig.js.

To use the custom script, user need to include it in the index file like so:

<script type="text/javascript" src="js/MWBConfig.js"></script>

and start the scanner with:

scanner.startScanning(MWBSInitSpace.init,MWBSInitSpace.callback);

All init and callback function can still be declared inside MWBScanner.js file, but will be overwritten on plugin update.

 

WP8 Note

It’s seems there’s a bug in Phonegap 3.0 so you have to add html '<script type="text/javascript" src="cordova.js"></script>' in index.html (or other html files) manually

##Manual Install (Phonegap 2.x or 3.0)

###Android:  

    <activity android:name="com.manateeworks.ScannerActivity"
        android:screenOrientation="landscape" android:configChanges="orientation|keyboardHidden"
        android:theme="@android:style/Theme.NoTitleBar.Fullscreen">
    </activity>
    <script type="text/javascript" src="js/MWBScanner.js"></script> 
    <form style="width: 100%; text-align: center;">
                <input type="button" value="Scan Barcode" onclick="startScanning()" style="font-size: 20px; width: 300px; height: 30px; margin-top: 50px;"/>
       </form>

For Phonegap 2.x

    <plugins>
        ... 
        <plugin name="MWBarcodeScanner" value="com.manateeworks.BarcodeScannerPlugin"/>
        ...
    </plugins>

For Phonegap 3 *

    <feature name="MWBarcodeScanner">
             <param name="android-package" value="com.manateeworks.BarcodeScannerPlugin" />
    </feature>

<!-- --> http://docs.phonegap.com/en/3.0.0/cordova_notification_notification.md.html

<!-- --> <uses-permission android:name=“android.permission.CAMERA” />

  ###iOS:  

    <script type="text/javascript" src="js/MWBScanner.js"></script> 
    <form style="width: 100%; text-align: center;">
                <input type="button" value="Scan Barcode" onclick="startScanning()" style="font-size: 20px; width: 300px; height: 30px; margin-top: 50px;"/>
        </form>

For Phonegap 2.x

    <plugins>
    
        ...
        <plugin name="MWBarcodeScanner" value="CDVMWBarcodeScanner"/>
    
        ...
    </plugins>

For Phonegap 3

    <feature name="MWBarcodeScanner">
            <param name="ios-package" value="CDVMWBarcodeScanner" />
    </feature>

  ###Windows Phone 8:  

    <script type="text/javascript" src="js/MWBScanner.js"></script> 
    <form style="width: 100%; text-align: center;">
 
        <input type="button" value="Scan Barcode" onclick="scanner.startScanning()" style="font-size: 40px; width: 300px;height: 50px; margin-top: 100px;"/>
 
    </form>

For Phonegap 2.x

    <plugins>
    
        ...
        <plugin name="MWBarcodeScanner" value="MWBarcodeScanner"/>
    
        ...
    </plugins>

For Phonegap 3

    <feature name="MWBarcodeScanner">
            <param name="wp-package" value="MWBarcodeScanner" />
    </feature>

Add a notification plugin (if not already present):

     <plugin name="Notification" value="Notification"/>

  ###Changes in 1.9:  

  ###Changes in 1.8.8:  

  ###Changes in 1.8.6:  

  ###Changes in 1.8.2:  

  ###Changes in 1.8:  

  ###Changes in 1.7.1:  

  ###Changes in 1.7:  

  ###Changes in 1.6:  

  ###Changes in 1.5:  

 

###Changes in 1.4:  

  ###Changes in 1.3:  

It now contains complete camera handling functionality, other files from camera folder are not necessary

  ###Changes in 1.2:  

You can now enter your licensing info without changing the native code of plugin;

  ###Changes in 1.1:  

You can now choose between Simple Image Overlay and MW Dynamic Overlay, which shows the actual viewfinder, depending on selected barcode types and their respective scanning rectangles;

Now there’s only a single function for supplying orientation parameters which makes tweaking the controller for changing scanner orientation no longer needed;

Added option to choose between high or normal resolution scanning to better match user application requirements;

Added option to enable or disable the flash toggle button;