Weird behavior on API >=23
See original GitHub issueSummary
When scanning for devices I’m getting devices with the wrong mac address on API >=23
Preconditions
Use a API >=23 device
Steps to reproduce actual result
fun scanAppliances(): Observable<Appliance> {
return rxBleClient.scanBleDevices()
.flatMap flatMap@ { scanResult ->
val uuids = AdvertisedServiceUUIDExtractor().extractUUIDs(scanResult.scanRecord)
val uuid = uuids.firstOrNull { servicesUUIDs.contains(it) } ?: return@flatMap null //this just filters out unwanted uuids
val bleDevice = scanResult.bleDevice
Timber.tag("scanAppliances")
Timber.d("--------------------------------------------------------\nnew scanResult")
Timber.d("device name: ${bleDevice.name} with macAddrs: ${bleDevice.macAddress} rssi: ${scanResult.rssi} UUID: $uuid")
val appliance = Appliance( //this is just my internal POJO
bleDevice.name,
uuid.toString(),
null,
bleDevice.macAddress
)
Timber.d("appliance created")
return@flatMap Observable.just(appliance)
}
}
Actual result
When scanning for devices on API 22 I only get one reading of each device, just like on this log:
This is what I’m expecting.
Expected result
When scanning on API 23 and API 25 devices, I get a endless stream of readings of the same device. The bigger problem is that sometimes the device appears with the wrong mac address. Using nF Connect
app I can see that the wrong address actually are from another devices that are near
Issue Analytics
- State:
- Created 6 years ago
- Comments:10 (5 by maintainers)
Top Results From Across the Web
android - Different selector behavior on API 21 and API 23
I am trying to implement a custom checkbox selector. After a couple of hours of trying to figure out what is wrong with...
Read more >Weird behaviour with selection on Android #29780 - GitHub
Description After reseting the selection on a text input, the input keep reseting the selection to the value, which makes the cursor ...
Read more >Behavior changes: all apps - Android Developers
The Android 12 platform includes behavior changes that may affect your app. The following behavior changes apply to all apps when they run...
Read more >Splash Screen Icon Not Displaying on API 31 when starting ...
The icon shows on api 30 and lower (tested back to api 23) however no icon ... It's a weird, inconsistent behavior not...
Read more >Let's use Android 12, Migration of our Android Apps to ...
“In this, I update one of my projects which was supporting Android11 (API 30) and was using a few third-party libraries I spent...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
As far as I know on Android 5.0+ the old API is using the new scan under the hood anyway but give it a try. I expect to have the new API scan implemented in the library somewhere next week. At least in the Snapshot.
Unfortunately it does not look like something that the library may fix if it works on another device properly. I cannot do more than suggest you to open an issue on Google’s issue tracker: https://issuetracker.google.com/issues?q=nexus 6p ble scan
Closing for now. If you will have more info or an idea what we could do from the library side - feel free to comment / reopen.
Best Regards