首页 > TAG信息列表 > android-ble

Android BluetoothGatt无法接收特征通知BluetoothGatt#writeDescriptor(desc)返回false

我正在开发需要与Bluetooth LE设备通信的应用程序. 这是我用来设置CharacteristicNotification的代码 public boolean setCharacteristicNotification( BluetoothGattCharacteristic characteristic, boolean enable) { if(mBluetoothAdapter == null || mBluetoothGatt == n

android-BluetoothDevice始终在getName()上返回null

我在Android 4.4、5和6中始终遇到此问题. 我正在执行BLE蓝牙设备扫描,然后可以访问它们的地址(getAddress())和其他数据.但是,如果我调用device.getName(),则每次都会返回null. 该文档没有帮助,它只说如果“有问题”,则返回null:https://developer.android.com/reference/android/bl

Android – BLE绑定以编程方式不适用于所有CoolPad Note 3

我正在使用下面的广播接收器来捕获绑定请求并在没有用户弹出请求的情况下绑定它. private static BroadcastReceiver pairingBroadcastReceiver = new BroadcastReceiver() { @Override public void onReceive(Context context, Intent intent) { if

android – 如何使用服务连接的BLE连接在不停止服务或断开连接的情况下跨活动使用?

我有3个组件. > Activity1具有用于连接和断开BLE连接的按钮 > Activity2需要从BLE设备获取数据.>服务所有连接逻辑(如getRemoteDevice(),connectGatt等)属于服务. Activity1通过绑定服务连接到BLE设备. Intent gattServiceIntent = new Intent(mContext,BleService.class);//In Ac

android – 蓝牙GATT onConnectionState更改不适用于Lollipop

我目前有一种方法可以写入BLE设备发出蜂鸣声.我的蓝牙回拨如下: public class ReadWriteCharacteristic extends BluetoothGattCallback { public ReadWriteCharacteristic(Context context, String macAddress, UUID service, UUID characteristic, Object tag, Activity acti

在API级别22中不推荐使用android – stopLeScan()和startLeScan() – 如何使用stopScan()和startScan()替换它?

我看到stopLeScan()&在Android 5.1.1中不推荐使用startLeScan().我有问题替换我的stopLeScan()& startLeScan()方法.这是我的以下代码: @Override protected void onListItemClick(ListView l, View v, int position, long id) { final BluetoothDevice device = mLeDeviceList