<commit_before>Cordova BarcodeScanner Plugin For Blackberry 10
===============================================

This plugin scans all types of barcodes supported by the [ZXing](https://github.com/blackberry/zxing) library. 
The Rear Camera is used and it paints a viewfinder onto a Canvas for the user to target the barcode.
It is a version of the [BarcodeScanner BB10 Webworks extension](https://github.com/blackberry/WebWorks-Community-APIs/tree/master/BB10/BarcodeScanner) 
ported to Cordova. 

## How to setup the plugin and run the sample

1. Install Apache Cordova and Webworks. 
2. Clone the contents of the Webworks-Community-APIs repo into a directory of your choice.
3. Navigate to BB10-Cordova/BarcodeScanner/sample.
4. Add the com.blackberry.io plugin found in B10-Cordova/BarcodeScanner/ext:
```
cordova plugin add ../ext/blackberry.io 
```
Notice that this is only necessary to run the sample, not the actual plugin. 
5. Set Cordova's target device to ``` phone ```. 
6. Execute the ```run``` script: 
``` ./run ``` 
7. Wait for a few seconds. You now have the example running on your phone/simulator. 

## Javascript API


```javascript
/* Start scanning for barcodes. 
 * @param succ
 *			Function that executes when the barcode has been recognized 
 *			successfully. Expected signature: succ(read_data), where 
 *			read_data is a string.
 * @param fail
 * 			Function that executes when the barcode has not been recognized 
 *			successfully. Expected signature: fail(error_message), <commit_msg>Update installation procedure in Readme.<commit_after>Cordova BarcodeScanner Plugin For Blackberry 10
===============================================

This plugin scans all types of barcodes supported by the [ZXing](https://github.com/blackberry/zxing) library. 
The Rear Camera is used and it paints a viewfinder onto a Canvas for the user to target the barcode.
It is a version of the [BarcodeScanner BB10 Webworks extension](https://github.com/blackberry/WebWorks-Community-APIs/tree/master/BB10/BarcodeScanner) 
ported to Cordova. 

## How to setup the plugin and run the sample


1. Create a new project using ```cordova create```.
2. Copy the _www_ folder in the _sample_ directory over the default one created by that command. 
3. Run ```__bbndk-env.bat``` or ```bbndk-env.sh``` script if the NDK is not on your PATH. 
4. Add the _blackberry10_ platform to your project by running ```cordova platform add blackberry10```.
5. Add the _blackberry.io_ plugin that you will find in the ext folder to the project by using ```cordova plugin add /path/to/plugin_folder```. 
6. Then add the BarcodeScanner plugin to the project using ```cordova plugin add /path/to/project/plugin```
7. Finally, execute ```cordova run```

## Javascript API


```javascript
/* Start scanning for barcodes. 
 * @param succ
 *			Function that executes when the barcode has been recognized 
 *			successfully. Expected signature: succ(read_data), where 
 *			read_data is a string.
 * @param fail
 * 			Function that executes when the barcode has not been recognized 
 *			successfully. Expected signature: fail(error_message), 
{'fraction_non_alphanumeric': 0.11086190323614226, 'fraction_numerical': 0.010893944248638257, 'mean_word_length': 4.300509337860781, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 4, 'lorem ipsum': 0, 'www.': 1, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3382445', 'n_tokens_mistral': 947, 'n_tokens_neox': 886, 'n_words': 382}