Zebra EM 220, Print Code 128 barcode using Android

Alereerak

New Member
I want to print a code 128 barcode using the Zebra's EM 220 SDK for Android.
I tried to print it using the PrintBarcode() method like this :\[code\]BxlService bxl = new BxlService();bxl.Connect(macAddress);String data = "http://stackoverflow.com/questions/15814381/123589647525";bxl.PrintBarcode(data.getBytes(), data.length(), BxlService.BXL_BCS_Code128, 100, 3, 0, BxlService.BXL_BC_TEXT_NONE);bxl.Disconnect();\[/code\]but the printed code can't be scanned by Android scan applications, like ZXing.After searching on the web, I understood data had to be formatted (even if I am a little surprised Zebra SDK doesn't do that...) and found the barcode4j library that help to encode data. However, even with the library, the printed barcode can't be scanned.\[code\]BxlService bxl = new BxlService();bxl.Connect(macAdress);DefaultCode128Encoder dce = new DefaultCode128Encoder();String data = "http://stackoverflow.com/questions/15814381/123456679857";int[] i = dce.encode(data); String barcode = "";for (int j : i) { barcode += j;}bxl.PrintBarcode(barcode.getBytes(), barcode.length(), BxlService.BXL_BCS_Code128, 100, 3, 0, BxlService.BXL_BC_TEXT_NONE);bxl.Disconnect();\[/code\]So, my question is simple : how to print code 128 barcode using the Zebra's EM 220 SDK for Android ?
 
Back
Top