android - 低功耗蓝牙扫描失败

标签 android bluetooth bluetooth-lowenergy android-bluetooth

我目前正在开发一个将使用低功耗蓝牙的应用程序。

我正在使用以下链接,

http://developer.android.com/samples/BluetoothLeGatt/src/com.example.android.bluetoothlegatt/DeviceScanActivity.html

我无法扫描周围的 BLE 设备。

扫描设备,

mBluetoothAdapter.startLeScan(mLeScanCallback); 

private BluetoothAdapter.LeScanCallback mLeScanCallback = new BluetoothAdapter.LeScanCallback() 
    {

        @Override
        public void onLeScan(final BluetoothDevice device, int rssi,byte[] scanRecord) 
        {

            runOnUiThread(new Runnable() {
                @Override
                public void run() 
                {

                    mLeDeviceListAdapter.addDevice(device);

                    mLeDeviceListAdapter.notifyDataSetChanged();

                }
            });
        }
    };

最佳答案

我遇到了同样的问题,请将这些权限添加到您的 list 中

<uses-permission android:name="android.permission.BLUETOOTH"/>
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN"/>

关于android - 低功耗蓝牙扫描失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25884129/

相关文章:

android - 更新 android SDK 工具 - android studio?

safari - 来自蓝牙键盘的 IOS7 上 Safari 中的 onkeyup 事件

ubuntu - bluez-tools bt-adapter -d 需要在下次使用前重置 USB 加密狗

java - 无法连接到 selenium webdriver 中的主机 127.0.0.1 问题

java - android上传图片到服务器

iOS/swift : Automatically Pair With Bluetooth Classic Device

iOS 核心蓝牙 : State Preservation and Restoration

ios - CoreBluetooth 在 CBPeripheralManager 中接收通知

android - webview loaddata 滚动设置在单击之前不会更新

android - 通过蓝牙发送多个文件