Skip to content

Commit

Permalink
Add step for line in plugins.xml and some format clenaup
Browse files Browse the repository at this point in the history
  • Loading branch information
wader authored and Jesse MacFadyen committed Oct 20, 2011
1 parent 3b57f44 commit ca39b2c
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions Android/BarcodeScanner/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,17 @@ By Matt Kane
This plugin requires the end user to install [the ZXing Barcode Scanner app](http://code.google.com/p/zxing/)
If the user doesn't have the app install they will be promped to install it the first time the plugin is used.

1. To install the plugin, move barcodescanner.js to your project's www folder and include a reference to it
1. To install the plugin, move `barcodescanner.js` to your project's www folder and include a reference to it
in your html files.
2. Create a folder called 'src/com/beetight/barcodescanner' within your project's src/com/ folder.
3. And copy the java file into that new folder.

`mkdir <your_project>/src/com/beetight/barcodescanner`
mkdir -p <your_project>/src/com/beetight/barcodescanner
cp ./BarcodeScanner.java <your_project>/src/com/beetight/barcodescanner

4. Add a plugin line to `res/xml/plugins.xml`

`cp ./BarcodeScanner.java <your_project>/src/com/beetight/barcodescanner`
`<plugin name="BarcodeScanner" value="com.beetight.barcodescanner.BarcodeScanner"/>`

## Using the plugin ##
The plugin creates the object `window.plugins.barcodeScanner` with one method `scan(types, success, fail, options)`
Expand Down Expand Up @@ -67,12 +70,12 @@ Supported encoding types:

A full example could be:

window.plugins.barcodeScanner.encode(BarcodeScanner.Encode.TEXT_TYPE, "http://www.nytimes.com", function(success) {
alert("encode success: " + success);
}, function(fail) {
alert("encoding failed: " + fail);
}, {yesString: "Install"}
);
window.plugins.barcodeScanner.encode(BarcodeScanner.Encode.TEXT_TYPE, "http://www.nytimes.com", function(success) {
alert("encode success: " + success);
}, function(fail) {
alert("encoding failed: " + fail);
}, {yesString: "Install"}
);


## BUGS AND CONTRIBUTIONS ##
Expand Down

0 comments on commit ca39b2c

Please sign in to comment.