手上有个蓝牙设备,想用手机接收设备上发送出来的数据,数据是十六进制的。网上看到可以用bluetoothSocket虚拟串口实现,但没有类似的例子,哪位仁兄能帮下忙指点一下啊
解决方案 »
- 程序太大求教高手。
- 这几句代码是什么意思啊?
- android中声音录制问题
- 如何在Linux下用命令行运行aapt工具
- 一个简单的layout问题,两行两列,其中一列合并的layout问题
- 如何在命令行下使用android sdk 编译项目 PS:人品好才是真的好 100%结帖率。欢迎各位达人踊跃参加
- Faild to fetch url请大牛解答
- 在eclipse的android的项目中导入自己用写的jar包疑问
- 求各位大牛教教利用listview传值的方法,在线等急用啊
- 历史记录和下拉提示使用同一个ListView的问题
- android 怎么拍摄出来最好的照片
- 如何在一个Activity中通过不同的VIEW来刷新界面?
public class BluetoothOppRfcommTransport implements ObexTransport { private final BluetoothSocket mSocket; public BluetoothOppRfcommTransport(BluetoothSocket socket) {
super();
this.mSocket = socket;
} public void close() throws IOException {
mSocket.close();
} public DataInputStream openDataInputStream() throws IOException {
return new DataInputStream(openInputStream());
} public DataOutputStream openDataOutputStream() throws IOException {
return new DataOutputStream(openOutputStream());
} public InputStream openInputStream() throws IOException {
return mSocket.getInputStream();
} public OutputStream openOutputStream() throws IOException {
return mSocket.getOutputStream();
} public void connect() throws IOException {
} public void create() throws IOException {
} public void disconnect() throws IOException {
} public void listen() throws IOException {
} public boolean isConnected() throws IOException {
//return mSocket.isConnected();
// TODO: add implementation
return true;
} public String getRemoteAddress() {
if (mSocket == null)
return null;
return mSocket.getRemoteDevice().getAddress();
}}