imrankst1221 / thermal-printer-in-android Goto Github PK
View Code? Open in Web Editor NEWThermal printer in Android
Home Page: https://youtu.be/emedLinWHR4
Thermal printer in Android
Home Page: https://youtu.be/emedLinWHR4
The App was working fine, but I think that after a update of android when I try to print, in the DeviceList activity the screen stay in blank.
I was debugging, and I found what the mBTReceiver never is called, I'm trying to fix this bug but I'm sure that you solve faster.
Mi Android version: 9 PKQ1.180904.001
Xiaomi version(MIUI): 11.0.3.0 (PEIMIXM)
but I test in anothers phones with the same problem.
Help me please, how to coding android to print Thai character on Bluetooth printer?
After installing APK file in my mobile, it is turning on bluetooth, but not showing available devices. It is just showing the white screen without any data
I tried to print arabic text but i failed?
any idea please?
printText("بسم الله الرحمن الرحيم");
i Want to costume this app for print bill.
Where for read documentation code for Thermal??
UUID uuid = btDevices.getItem(position).getUuids()[0] .getUuid();
getUuids() returns null.
Line number 215 (DeviceList.java)
Hi. I'm trying to use the app to print from web to the android app, but I haven't able to do that, because when I make the call it's opening the app store. And I need to print the text I send it.
window.location.href = "intent://" + textEncoded + "#Intent;package=infixsoft.imrankst1221.printer;end;";
Hello Imran,
Thanks for your your solution. Please do let me know what is the issue
02-20 14:22:43.443 29100-29229/infixsoft.imrankst1221.printer W/BluetoothAdapter: getBluetoothService() called with no BluetoothManagerCallback
02-20 14:22:43.686 29100-29229/infixsoft.imrankst1221.printer W/System.err: java.io.IOException: read failed, socket might closed or timeout, read ret: -1
at android.bluetooth.BluetoothSocket.readAll(BluetoothSocket.java:740)
at android.bluetooth.BluetoothSocket.readInt(BluetoothSocket.java:752)
at android.bluetooth.BluetoothSocket.connect(BluetoothSocket.java:374)
at infixsoft.imrankst1221.printer.DeviceList$2.run(DeviceList.java:245)
02-20 14:22:43.687 29100-29229/infixsoft.imrankst1221.printer W/System.err: at java.lang.Thread.run(Thread.java:818)
Please do let me the solution.
Thanks
Amit
i get the list of my bluetooth printer, when i click to it, it says "cannot establish connection", is there anything im missing?
Can i connect more than 1 printer ?
I have one printer in for invoice e other for the food.. can i have two instances? @imrankst1221 can u help me?
Hi I am working on printing receipt.
But i am stuck in printing image in the center of the reciept. i am using 80mm paper and black copper printer. when i am aligning the text using the public static byte[] ESC_Align = new byte[] {0x1b, 0x61, 0x01 } command it center the text perfectly with no issue, but when i try to center the image and the barcode it doesn't center it.
Can you please guide me how to solve this issue?
It will be your kind pleasure.
How can multiple connections be made? can you change your project for this?
Thanks
Hello @imrankst1221 , how can I modify the max width and height for image printing, in Utils.decodeBitmap?
if (widthHexString.length() > 2) {
Log.e("decodeBitmap error", " width is too large");
return null;
if (heightHexString.length() > 2) {
Log.e("decodeBitmap error", " height is too large");
return null;
device list activity shows blank screen
Man, great work but i have some proble how to set align left for any word also set align right for any word in one line ?
Thankyou dude, i tried it always align right both of that words.
Sorry for my bad english
The printer always print the logs whenever it connected and disconnected through the Bluetooth. can we stop printing these logs?
I know It is not bug .I use this code . It works fine with me . I want to keep connection so if user closed application and the application connected with thermal printer.
I want when the app open again it becomes connected with thermal printer.
i know i should i use service but i cannot know how can i use it with this code
Sorry for english
I couldn't see a ESC/POS command for beeping the internal buzzer.
Work in MPT III?
I tried to print QrCode and alignt it to center, didn´t workout, ou have any example on how to align images to center?
This code will work for all the thermal printers?
How to write pragmatically support Hindi language in Thermal-Printer-in-Android printer. have any idea ? Please let me know.
mPrinter.printText("नमस्कार नमस्कार नमस्कार नमस्कार नमस्कार नमस्कार ");
I try this but it not working .
hi
thanks for sharing your code, I have a question to this line code in your decodeBitmap function.
String commandHexString = "1D763000";
1D is so far clear for me, I guess :-) , but what are doing the others?
Best fishme
Hello @imrankst1221
if i set height up to 255 in CreateBitmap method.
Bitmap bmpGrayscale = Bitmap.CreateBitmap(OriginalBitmap.Width, 257, Bitmap.Config.Argb8888);
then DecodeBitmap
method return null
byte[] command = Utils.DecodeBitmap(bmpGrayscale);
Please guide me
How can i print pdf file?
Can you please add the pdf print support?
Please help me
i want to large text more
byte[] bb3 = new byte[]{0x1B,0x21,0x10}; // 3- bold with large text
How to modify height to large height image to print?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.