Project Name | Stars | Downloads | Repos Using This | Packages Using This | Most Recent Commit | Total Releases | Latest Release | Open Issues | License | Language |
---|---|---|---|---|---|---|---|---|---|---|
H Ble | 167 | 5 years ago | 4 | Java | ||||||
Android Ble类库,基于回调,暴露搜索、连接、发送、接收、断开连接等接口,无需关心细节操作即可进行Ble通信。 | ||||||||||
Sample Bluetooth Le Gattserver | 162 | 2 years ago | 8 | apache-2.0 | Java | |||||
Build a Bluetooth GATT server with Android Things | ||||||||||
Pebble_watchface_framework | 19 | 17 days ago | 15 | apache-2.0 | C | |||||
Working, ready to build Bare-Bones watch face for Pebble (OG/Classic, Time, and Round) Aplite, Basalt, Diorite, and Chalk. With configuration and settings support. | ||||||||||
Real_time_bn | 8 | 7 years ago | 7 | C | ||||||
Real-Time Bluetooth Networks - UTAustinX | ||||||||||
Arduino Watch | 8 | 12 years ago | 3 | Java | ||||||
A watch based on an Arduino - uses Amarino to talk to Android | ||||||||||
Android Bluetooth Current Time Service | 7 | 7 years ago | mit | Java | ||||||
An implementation of the Bluetooth Current Time Service (CTS) for Android applications communicating with a Bluetooth peripheral |
Android Ble类库,基于回调,暴露搜索、连接、发送、接收、断开连接等接口,无需关心细节操作即可进行Ble通信。
具体使用请参考本项目提供的例子
<uses-permission android:name="android.permission.BLUETOOTH" />
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
定位权限必须添加,否则Android 5.0以上的手机搜索不到设备
打开BleController.class
修改以下成员变量的值为自己所要通信的BLE模块对应的UUID
private static final String BLUETOOTH_S = "0000fff0-0000-1000-8000-00805f9b34fb";
private static final String BLUETOOTH_NOTIFY_C = "0000fff7-0000-1000-8000-00805f9b34fb";
private static final String BLUETOOTH_WRITE_C = "0000fff6-0000-1000-8000-00805f9b34fb";
变量名最后一位字母:
S 代表service的UUID;
C 代表characteristic的UUID;
如果硬件没有提供UUID,可以下载Ble调试助手进行查看 http://download.csdn.net/detail/hansion3333/9753311
本库满足Android 4.3以上手机和BLE模块之间的连接与互发数据。
本库并未将常用Ble手表、心率计等设备的UUID加入其中自动匹配。所以有此需求可以使用其他支持的库。