IDAutomation's Java Barcode Font Encoders are compatible with Android 2.2 or greater
and can be used in conjunction with IDAutomation's
barcode
fonts to encode data strings and produce readable barcodes on Android devices.
Android Barcode Symbology Compatibility |
Linear Barcodes |
Code 39, Extended Code 39, Code 128 (with character
sets Auto, A, B & C), GS1-128 (aka: UCC/EAN-128),
USS-128, NW7, Interleaved 2 of 5, Codabar, UPC-A, UPC-E,
MSI, EAN-8, EAN-13, Code 11, Code 93, ITF, Bearer Bars, PLANET, USPS OneCode 4CB,
Intelligent Mail and Postnet. |
2D PDF417 |
PDF417 with text and base256 (byte) encoding. AIM
Specification USS PDF417. |
2D Data Matrix |
Data Matrix with ECC200 error correction. Encoding
modes of Text, ASCII, C40 and Base256 (byte) encoding
are supported. AIM Specification ISS Data Matrix. |
2D MaxiCode |
MaxiCode with support for modes 2-6. AIM Specification
ISS MaxiCode. |
2D Aztec |
Aztec with support for appending messages across
multiple symbols, and scanner initialization. |
2D QR-Code |
QR-Code with support for Byte, Numeric, and Alpha-numeric
encoding modes, and automatic Version selection. |
GS1 DataBar (RSS) |
GS1 DataBar Truncated, Stacked, Stacked Omni-directional,
Limited, Expanded, Expanded Stacked Omni-directional. |
Once installed, several different method parameters and properties may be
used from the java font encoder to encode the input.
The method to use from the encoder will depend on the barcode type that
will be generated. Here are some implementation examples of using the java font encoder
for android with a specified barcode font.
Applying the Barcode Font to a Text View
//used to set the text views to the barcode fonts protected
Typeface BarcodeFontFace;
//set the font of the text box to the Code 128 font
BarcodeFontFace = Typeface.createFromAsset(getAssets(),"Fonts/IDAutomationC128.ttf");
BarcodeTextView.setTypeface(BarcodeFontFace);
Code 128 Implementation Example
//set the font of the text box to the Code 128 font
Typeface
BarcodeFontFace = Typeface.createFromAsset(getAssets(),"Fonts/IDAutomationC128.ttf");
BarcodeTextView.setTypeface(BarcodeFontFace);
//initialize the Linear encoder to generate the encoded string
LinearFontEncoder BCEnc = new LinearFontEncoder();
//set the barcode text view to the BarcodeView ID
TextView BarcodeTextView = (TextView) findViewById(R.id.BarcodeView);
//set the text of the TextView to the encoded string
BarcodeTextView.setText(String.format("%s",BCEnc.Code128(barcodedata,true)));
QR Code Implementation Example
//set the font of the text box to the 2D barcode font
Typeface
BarcodeFontFace = Typeface.createFromAsset(getAssets(),"Fonts/IDAutomation2D.ttf");
BarcodeTextView.setTypeface(BarcodeFontFace);
//initialize the Linear encoder to generate the encoded string
QRCodeEncoder QREnc = new QRCodeEncoder();
//set the barcode text view to the BarcodeView ID
TextView BarcodeTextView = (TextView) findViewById(R.id.BarcodeView);
//set the text of the TextView to the encoded string
BarcodeTextView.setText(String.format("%s",
QREnc.FontEncode(ReplaceCR(barcodedata), true, 0, 0, 0)));
PDF417 Implementation Example
//set the font of the text box to the PDF417 font and adjust the font size.
Typeface
BarcodeFontFace = Typeface.createFromAsset(getAssets(),"Fonts/IDAutomationPDF417n2.ttf");
BarcodeTextView.setTypeface(BarcodeFontFace);
BarcodeTextView.setTextSize(12);
//initialize the PDF417 encoder to generate the encoded string
PDF417Encoder PDFEnc = new PDF417Encoder();
//set the barcode text view to the BarcodeView ID
BarcodeTextView = (TextView) findViewById(R.id.BarcodeView);
//adjust the columns, and set the text of the TextView to the encoded string
PDFEnc.setPDFColumns(3);
BarcodeTextView.setText(String.format("%s",PDFEnc.fontEncode(ReplaceCR(barcodedata))));
Method to Remove Extra Carriage Returns for 2D Barcode Implementations
protected String ReplaceCR(String data)
{
return data.replaceAll("\n", String.valueOf((char)13));
}
Code 128 Barcode FAQ | QR Code
Barcode FAQ
| PDF417 Barcode FAQ
Related Products & Information
The following product and information links relate to this product and may be
of interest:
Android Barcode Integration Support
Free product support is available by reviewing the
font
problems and solutions information that IDAutomation has documented and by searching resolved
public
forum threads.
Pre-sales and existing customer support is available by
contacting
IDAutomation, and additional technical support may be attained with the
purchase of the one year
Priority Support
and Upgrade Subscription.