Jasonchenlijian / FastBle

Android Bluetooth Low Energy (BLE) Fast Development Framework. It uses simple ways to filter, scan, connect, read ,write, notify, readRssi, setMTU, and multiConnection.
Apache License 2.0
5.28k stars 1.22k forks source link

I can't get Bluetooth device list #562

Open dhaval23996 opened 1 year ago

dhaval23996 commented 1 year ago

Hi, thank you very much for the project, I am using this dependancies. It will help me a lot! I have used below method to get bluetooth devices list can not get device list.

BleManager bleManager = BleManager.getInstance();
        BleScanRuleConfig scanRuleConfig = new BleScanRuleConfig.Builder().setAutoConnect(false)
                .setScanTimeOut(8000).build();
        bleManager.initScanRule(scanRuleConfig);
        BleManager.getInstance().scan(new BleScanCallback() {
            @Override
            public void onScanStarted(boolean success) {
                Log.e(TAG, "onScanStarted");
            }

            @Override
            public void onScanning(BleDevice bleDevice) {
                Log.e(TAG, "onScanning");
            }

            @Override
            public void onScanFinished(List<BleDevice> scanResultList) {
                Log.e(TAG, "onScanFinished: " + scanResultList.size());
            }
        });
sasa2211 commented 1 year ago

打开手机的gps,并动态获取手机的位置权限