Comments (8)
nRF Connect is not using the scanner Compat Library. It actually allows you to switch between new and old scanning API in settings.
But in the app I'm not taking the name from BluetoothDevice, instead i parse the raw data. In the scanner library you may get the name from result.getRecord().getName()
. Such name is parsed from the received data, not taken from phone's cache. The name in BluetoothDevice object gets overridden by value from Device Name characteristic after connection and may be cashed and not updated.
from android-scanner-compat-library.
This is very weird, i do tried to take the bytes from scan record but only 0-30 indexes had a value the rest 31-63 was zeroes, and from debugging i saw that the name is sit in 31-42 indexes .
from android-scanner-compat-library.
The raw bytes contain both advertising data and scan response data, if such is present. Reach of them is 0-31 bytes going. The rest of the array indeed is filled with zeros. Perhaps your phone indirectly puts scan response to the raw data and then fails to parse it?
from android-scanner-compat-library.
I really don't know why this happens, because the bluetooth device for sure send the scan response (other phones can see it) , the real question is why the NrfConnect app do see 80% of our ble devices ( we develop smart locks with ble) , where i make the check i have about 200 - 400 ble devices, and my custom bytes parsing show that the are no name contained in the data.
from android-scanner-compat-library.
If you're parsing the raw data manually, did you check Shortened Local Name field? It also may contain the name.
from android-scanner-compat-library.
I checked, the short name not included in the data.
from android-scanner-compat-library.
Hi,
I am facing the same problem . I can not get names from either getDevice()
or getScanRecord()
. I am working on android 9 as well. I get null for 99% of the times but sometimes i get a device name. While the NRF connect app shows those devices with names.
from android-scanner-compat-library.
Hi, @khan-07 i think i found the root cause for this problem and even the solution (not tried yet)
Look at the last answer here
from android-scanner-compat-library.
Related Issues (20)
- Is there a non AndroidX version? HOT 1
- If the app is repeatedly killed, the device cannot be scanned
- Filter does not update in run time (using Pending intent) HOT 1
- Cannot stop scan when using PendingIntent.FLAG_IMMUTABLE or PendingIntent.FLAG_MUTABLE HOT 1
- NoClassDefFoundError: Failed resolution HOT 4
- Scan occassionally returns no results until restarted HOT 3
- Attempt to invoke virtual method 'int java.lang.String.hashCode()' on a null object reference HOT 1
- Android 12 cannot scan out beacon devices HOT 2
- (Long Range (Bluetooth 5.2)) LE Coded PHY HOT 3
- setUseHardwareBatchingIfSupported HOT 4
- No scan results - Pixel 6a Android 13 HOT 3
- 广播名没有修改
- Failed to resolve BluetoothLeScannerCompat when used through a library
- Hit
- Leaked scan callback when app be killed by task manager
- Could not find no.nordicsemi.android:thingylib:2.0.0. HOT 2
- Hello, I may need your help
- Not discovering "Limited Discoverable" devices in Android
- BLE Scanner not working in Android 14
- An error occurred when quickly switching Bluetooth on and off and stopping scanning status. HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from android-scanner-compat-library.