我正在尝试从android studio 2修改这个项目,但是当我尝试从Android 4.4.2运行应用程序并连接到蓝牙设备时,它给出了这些错误消息。
06-02 14:51:30.126 12669-12669/com.example.ti.ble.sensortag E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.example.ti.ble.sensortag, PID: 12669
java.lang.IllegalArgumentException: null is not a valid Bluetooth address
我正在创建BLE设备和移动设备之间的ble连接。该连接首先是不安全的,但将更新到LESC,只是从设备端工作。
到目前为止,它工作得很好。
在Android (目标SDK 28)中,我想检查(最好是得到一个回调)蓝牙连接是否加密。我使用的是BLE UART服务示例。
我可以访问BluetoothGatt和BluetoothDevice对象。但我发现的所有方法和变量要么是私有的,要么是@SystemApi。
有人能帮上忙吗?
下面是类声明的一部分,显示了可用的对象:
public class UARTService extends Service {
private final static S
我可以从我的android应用程序扫描ble设备,然后我想向扫描的设备发送数据。怎么办?请分享我的例子代码,如果谁有。
我提到有人在这里回答了同样的问题[使用BLE Android4.3如何编写characteristics?](https://stackoverflow.com/questions/20043388/working-with-ble-android-4-3-how-to-write-charactaristics)
但是我并没有深入到代码下面。
BluetoothGattService Service = mBluetoothGatt.getService(your Ser