java - How to compile Zxing barcode scanner as a shared library to use in Android projects? -
i writing in delphi xe7 android platform, need , fast 2d barcode scanner. finding zxing's pretty good, not offer object pascal translation.
- is possible compile whole zxing project shared library, call barcode reader intent ?
i think wise implement bar code functionality in app. stumbled on easy library. seem union of zxing , zbar easier interpret. visit git-hub repo https://github.com/dm77/barcodescanner
how start: add following dependency build.gradle file.
compile 'me.dm7.barcodescanner:zxing:1.7.2'
or compile 'me.dm7.barcodescanner:zbar:1.7.2'
then make simplescanneractivity , add code.
public class simplescanneractivity extends activity implements zxingscannerview.resulthandler { private zxingscannerview mscannerview; @override public void oncreate(bundle state) { super.oncreate(state); mscannerview = new zxingscannerview(this); // programmatically initialize scanner view setcontentview(mscannerview); // set scanner view content view } @override public void onresume() { super.onresume(); mscannerview.setresulthandler(this); // register ourselves handler scan results. mscannerview.startcamera(); // start camera on resume } @override public void onpause() { super.onpause(); mscannerview.stopcamera(); // stop camera on pause } @override public void handleresult(result rawresult) { // result here log.v(tag, rawresult.gettext()); // prints scan results log.v(tag, rawresult.getbarcodeformat().tostring()); // prints scan format (qrcode, pdf417 etc.) }}
Comments
Post a Comment