I'm using BlackBerry Java Plugin 1.3 Eclipse.
And Simulator of 9300.
You can download the package classes here.
Example of Usage:
BarcodeScanner scanner;
BarcodeDecoder decoder;
BarcodeDecoderListener listener;
Field viewFinder;
BarcodeDecoder decoder;
BarcodeDecoderListener listener;
Field viewFinder;
Hashtable hints = new Hashtable(1);
Vector formats = new Vector(1);
formats.addElement(BarcodeFormat.QR_CODE);
hints.put(DecodeHintType.POSSIBLE_FORMATS, formats);
decoder = new BarcodeDecoder(hints);
listener = new BarcodeDecoderListener() {
public void barcodeFailDecoded(Exception ex) {
}
public void barcodeDecoded(String rawText) {
synchronized(Application.getEventLock()){
barcodeResult.setText(rawText);
}
}
public void barcodeDecodeProcessFinish() {
synchronized(Application.getEventLock()){
UiApplication.getUiApplication.
popScreen(ViewFinderScreen.this);
}
}
};
try {
scanner = new BarcodeScanner(decoder, listener);
viewFinder = scanner.getViewFinder();
scanner.getVideoControl.setDisplayFullScreen(true);
add(viewFinder);
scanner.startScan();
} catch (Exception e) {
Status.show(e.getMessage());
e.printStackTrace();
}
Vector formats = new Vector(1);
formats.addElement(BarcodeFormat.QR_CODE);
hints.put(DecodeHintType.POSSIBLE_FORMATS, formats);
decoder = new BarcodeDecoder(hints);
listener = new BarcodeDecoderListener() {
public void barcodeFailDecoded(Exception ex) {
}
public void barcodeDecoded(String rawText) {
synchronized(Application.getEventLock()){
barcodeResult.setText(rawText);
}
}
public void barcodeDecodeProcessFinish() {
synchronized(Application.getEventLock()){
UiApplication.getUiApplication.
popScreen(ViewFinderScreen.this);
}
}
};
try {
scanner = new BarcodeScanner(decoder, listener);
viewFinder = scanner.getViewFinder();
scanner.getVideoControl.setDisplayFullScreen(true);
add(viewFinder);
scanner.startScan();
} catch (Exception e) {
Status.show(e.getMessage());
e.printStackTrace();
}
To stop scan
try {
scanner.stopScan();
} catch (MediaException e) {
e.printStackTrace();
}
Dowload sample usages here
QR Code Sample