【问题标题】:send/receive data via Bluetooth通过蓝牙发送/接收数据
【发布时间】:2015-04-21 00:09:34
【问题描述】:

我正在尝试从 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 sockets bluetooth android-bluetooth bluetooth-socket


    【解决方案1】:

    最好最全面的例子是安卓官方的蓝牙聊天例子。您可能不需要更改大部分内容。看到这个: https://github.com/googlesamples/android-BluetoothChat

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-11-24
      • 1970-01-01
      • 1970-01-01
      • 2014-11-16
      相关资源
      最近更新 更多