• 1
name Punditsdkoslkdosdkoskdo

BLE device not detected on Moto g5 plus and lenovo k4 note

Android app is detecting BLE device on selected devices only.

I compiled the code from this link also to check if phones were detecting BLE devices, and tried it on different devices.

Is there some different way to interact with BLE on some devices?

It works on my Redmi note 3(android 6), but doesn't work on Lenovo k4 note(also android 6). It doesn't work on Moto g5 plus either(android 7.0), but works on Samsung Galaxy J7(android 6). I tested the same apk on all these devices.

Location permissions are enabled on all of these devices, and the app prompts if they are not. Also, the app has both fine as well as coarse location permissions.

NOTE: This question is not a possible duplicate because it has location access. All the other questions here on SO addressed only that issue.

NOTE 2: I also read while googling about how android 7.0 doesn't allow more than 5 ble scans in 30 seconds, but that is not the issue here. I've even waited for a minute before doing so.

NOTE 3: Tried same with NativeScript bluetooth, same problem.

This issue was caused due to platform build errors since I was initially compiling the app for a lower sdk version. To fix this, the app needed to be recompiled from scratch. I used tns platform remove android && tns run android.

  • 0
Reply Report