可以在 www.IOTSDK.com 下载一个SDK,解决~!
android4.2以上蓝牙开发稳定兼容Samsung BLE SDK、Broadcom BLE SDK、Google BLE SDK
1. 拷贝依赖库
将如下 jar 包拷贝到 libs 目录下:
- blelibrary-0.1.jar
- com.broadcom.bt.jar
- commons-codec-1.8.jar
- samsung_ble_sdk_200.jar
2. 添加权限
在 AndroidManifest.xml 中添加如下权限
<uses-permission android:name="android.permission.BLUETOOTH" />
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />