문제

Does the sample code from the official documentation work for anyone? After doing startLeScan, the onLeScan callback never gets called (Nexus 4, Android 4.3).

Meanwhile, another app that I have installed (BLE Heart Rate) doesn't seem to have any issues finding nearby Bluetooth LE devices (Fitbit One, Polar H7), so I must be missing something?

도움이 되었습니까?

해결책

I forgot to add the BLUETOOTH_ADMIN permission. Without this permission, one can still call startLeScan,it just won't ever discover any devices!

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

다른 팁

For me it works. Not very well though. (after some tests it will start disconnecting and I need to toggle the bluetooth on <--> off).

Have you missed something? What kind of device you are trying to find?

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top