Android的蓝牙打印机连接? [英] android bluetooth printer connection?
本文介绍了Android的蓝牙打印机连接?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我不得不J2ME应用程序打印数据字节打印机。
但现在,我已经到code转换到Android code。
i had J2ME application to print data byte to printer. But now, i have to convert that code to android code.
我的问题是:
我不能数据字节[]移动打印机从我的设备Galaxy Tab的升级Froyo通过蓝牙发送?
My problem is : i can't send data byte[] to mobile printer from my device Galaxy Tab Froyo via bluetooth?
在这里我简单的code:
here my simple code :
UUID MY_UUID = UUID.fromString("00001101-0000-1000-8000-00805F9B34FB");
BluetoothSocket btSocket btSocket = device.createRfcommSocketToServiceRecord(MY_UUID);
btSocket.connect();
OutputStream outStream = btSocket.getOutputStream();
String message = "this is message";
byte[] msgBuffer = message.getBytes();
outStream.write(msgBuffer.length);
outStream.write(msgBuffer);
当我看到LogCat中,它表明我通过与没有错误的所有进程。
when i see the LogCat, it show that i through all that process with no error.
谁能帮助我?
在预先感谢
AQL
推荐答案
这在我脑海的第一件事是 outStream.close()
,你忘了写。虽然我很可能错了。
The first thing that comes to my mind is outStream.close()
that you forgot to write. Though I am most probably wrong
这篇关于Android的蓝牙打印机连接?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文