android – 通过蓝牙发送/接收数据

前端之家收集整理的这篇文章主要介绍了android – 通过蓝牙发送/接收数据前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我正在尝试从 Android设备发送/接收字符串.
我一直在谷歌搜索过去3个小时,我找不到任何有效的东西.
我得到的最接近的是: fella

我收到这些错误

02-19 15:44:17.680    4680-4680/com.example.jelle.bluetoothconnector W/System.err﹕ at com.example.jelle.bluetoothconnector.BluetoothConnection.init(BluetoothConnection.java:38)
02-19 15:44:17.680    4680-4680/com.example.jelle.bluetoothconnector W/System.err﹕ at com.example.jelle.bluetoothconnector.BluetoothConnection.<init>(BluetoothConnection.java:25)
02-19 15:44:17.680    4680-4680/com.example.jelle.bluetoothconnector W/System.err﹕ at com.example.jelle.bluetoothconnector.ConnectorActivity.btnBluetooth_onCLick(ConnectorActivity.java:92)
02-19 15:44:17.680    4680-4680/com.example.jelle.bluetoothconnector W/System.err﹕ at java.lang.reflect.Method.invoke(Native Method)
02-19 15:44:17.680    4680-4680/com.example.jelle.bluetoothconnector W/System.err﹕ at java.lang.reflect.Method.invoke(Method.java:372)

谁能帮我?我只需要一些可以通过蓝牙发送/接收字符串的代码来启动我

谢谢!

解决方法

最好,最全面的例子是Android的官方蓝牙聊天示例.您可能不需要更改大部分内容.看到这个:
https://github.com/googlesamples/android-BluetoothChat
原文链接:https://www.f2er.com/android/314651.html

猜你在找的Android相关文章