質問

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