To get a Git project into your build:
Add it in your root build.gradle at the end of repositories:
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}
dependencies {
compile 'com.github.ohjongin:android-barcode:1.0.1'
}
private void drawBarcode() {
String barcode = "7761010114033430";
Code128 code = new Code128(this);
code.setData(barcode);
Bitmap bitmap = code.getBitmap(680, 300);
ImageView ivBarcode = (ImageView) findViewById(R.id.code128_barcode);
ivBarcode.setImageBitmap(bitmap);
}