Android library for bluetooth thermal printer.
Currently still in Alpha. Make sure to use java 8+ configuration. Documentation is in progress. Just take a look at sample project as an example.
But here for an insight:
Show dialog to choose bonded device bind your device initially from the bluetooth config:
Printama.scan(this, printerName -> {
...
});Print Text
Printama.with(context).connect(printama -> {
printama.printText(Printama.CENTER,
"-------------\n" +
"This will be printed\n" +
"Center aligned\n" +
"cool isn't it?\n" +
"------------------\n");
printama.close();
});Print Bitmap / Image
Printama.with(context).connect(printama -> {
Bitmap bitmap = BitmapFactory.decodeResource(getResources(), R.mipmap.ic_launcher);
printama.printImage(bitmap); // original size, centered as default
printama.close();
});- Dialog to choose bonded bluetooth device.
- Print Text with Custom Alignment.
- Print auto grayscale Bitmap with Custom width and Alignment.
- Tested with 58mm Bluetooth Thermal Printer.
You can simply :
- a pull request, or
- raise an issue ticket, or
- request additional feature by raise a ticket.
Minimum Android SDK Version 16
Step 1. Add it in your root build.gradle at the end of repositories:
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}Step 2. Add the dependency
dependencies {
implementation 'com.github.anggastudio:Printama:0.8.1'
}just visit the jitpack page Printama Jitpack
- utsmannn
- you (maybe)