Friday, November 22, 2013

Barcode Scanner and Generator (Version 2)



On November 4th, 2012 we launched QR Code Scanner and Generator V1

(http://abhinavasblog.blogspot.sg/2012/11/creating-your-qr-code-scanner-and.html)


THANK YOU FOR YOUR SUPPORT TILL DATE


Since then we made numerous progres on the library and updated it time and again.

Time has now come to welcome better smarter version of BarCode fragment library.


Please welcome Barcode Fragment Lib V2

The library is located at https://code.google.com/p/barcodefraglibv2/ .The library has better features and more detailed samples.

Unlike previous versions you can now simply add a jar in your app and start using the complete scanner functionality.
You can download the jar's from here: BarcodeLibraryFragment and Barcode Core (Please note both jars are mandatory)

Library now also support some added barcode types (e.g Aztec, Datamatrix).

Please read the wiki located at https://code.google.com/p/barcodefraglibv2/wiki/HowTo to start using the library.

There is a sample implementation for easier understanding of usage at : : https://code.google.com/p/barcodefraglibv2/wiki/SampleImplementation

I am also looking for the contributors for maintaining the library. Please let me know if you are interested to enhance this library.

4 comments:

Chris Foulds said...

This works great, thanks for the work - however I would also like to scan UPC codes - how can this be enabled as it's already part of ZXING ?

Anonymous said...

It works !!.. But when i try to run the sample activity why the camera is reversed 90 degree

Anonymous said...

Hi,

Just got it up and running in a fragment in my test app in no time at all. Thanks!
You mention on the Wiki that to load and remove the fragment in order to enable/disable it. Would it be possible to update the sample code to do this as well? Ive only been developing on Android for a few months and fragments are a new thing for me......

Thanks in advance!

Mat

Slim Tonnech said...

I'm trying to run the sample exemple of barcodefraglibv2: it run but it can't detect the barre code.
this is my activity :

public class SampleMainActivity extends FragmentActivity implements IScanResultHandler {

BarcodeFragment fragment;
Button btn;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
fragment = (BarcodeFragment)getSupportFragmentManager().findFragmentById(R.id.sample);
fragment.setScanResultHandler(this);
btn = ((Button)findViewById(R.id.scan));
btn.setEnabled(false);

// Support for adding decoding type
fragment.setDecodeFor(EnumSet.of(BarcodeFormat.EAN_13));
}

@Override
public void scanResult(ScanResult result) {
btn.setEnabled(true);
Toast.makeText(this, result.getRawResult().getText(), Toast.LENGTH_LONG).show();
}

public void scanAgain(View v){
fragment.restart();
}

}