Setting up for success while working from home
This post is an excerpt from an internal company email sent by our CEO Jeremy Johnson to all Andela ...
Scan for all available Android devices supporting BLE, Use any Android device with Android OS starting from 4 to 10 to Scan.
1. Successful scanning has inconsistent development requirements over different Android OS
2. Official docs are outdated and don’t mention these inconsistencies explicitly, also samples accompanying the docs are using deprecated APIs
This is not a tutorial! this article covers the missing and confusing parts in the Android Developers overview article on Bluetooth Low Energy. It is highly recommended reading.
1. The first problem I faced was that I needed to make sure that the device’s Bluetooth is not only On but also Visible. That was mentioned explicitly in the documentation but after thorough readings!
Findings: no need to request Bluetooth permission if discoverability is requested, also to stay discoverable infinitely through development set EXTRA_DISCOVERABLE_DURATION to 0, but that was not recommended in real use cases by docs
2. If your app targets Android 6+, you must not only declare ACCESS_FINE_LOCATION or ACCESS_COARSE_LOCATION in the Manifest, but also request Runtime Permissions in your app, or while in development mode, set your location permissions on for your app explicitly. If you didn’t, it would never be discoverable or even discover other devices.
A- In development mode give permission manually through settings.

B- or add Runtime Permissions to activate it momentarily once user asks for scanning
3. Please use latest BluetoothLeScanner API to start and end scanning instead of bluetoothAdapter instance, this was the outdated part in the docs
Then voila! All devices from Android 4 to 10 will be scannable in your app.
Please, check the full sample app code here
This post is an excerpt from an internal company email sent by our CEO Jeremy Johnson to all Andela ...
Registration is now open for the Google Africa Developer Scholarship program supported by Grow with ...
Poor onboarding can be devastating to engineering teams. A Bamboo survey found that 33 percent of te...
With millions of tech businesses working in all-remote mode for the first time, companies are confro...
The massive shift to remote work caused by the coronavirus has exposed the limitations of some outso...
Technical expertise is a prized value on engineering teams. But when it comes to team leadership, su...
Scan for all available Android devices supporting BLE, Use any Android device with Android OS starting from 4 to 10 to Scan.
1. Successful scanning has inconsistent development requirements over different Android OS
2. Official docs are outdated and don’t mention these inconsistencies explicitly, also samples accompanying the docs are using deprecated APIs
This is not a tutorial! this article covers the missing and confusing parts in the Android Developers overview article on Bluetooth Low Energy. It is highly recommended reading.
1. The first problem I faced was that I needed to make sure that the device’s Bluetooth is not only On but also Visible. That was mentioned explicitly in the documentation but after thorough readings!
Findings: no need to request Bluetooth permission if discoverability is requested, also to stay discoverable infinitely through development set EXTRA_DISCOVERABLE_DURATION to 0, but that was not recommended in real use cases by docs
2. If your app targets Android 6+, you must not only declare ACCESS_FINE_LOCATION or ACCESS_COARSE_LOCATION in the Manifest, but also request Runtime Permissions in your app, or while in development mode, set your location permissions on for your app explicitly. If you didn’t, it would never be discoverable or even discover other devices.
A- In development mode give permission manually through settings.



B- or add Runtime Permissions to activate it momentarily once user asks for scanning
3. Please use latest BluetoothLeScanner API to start and end scanning instead of bluetoothAdapter instance, this was the outdated part in the docs
Then voila! All devices from Android 4 to 10 will be scannable in your app.
Please, check the full sample app code here
Tap into a global talent pool and hire the “right” developers in days, not months.
Accelerate your career by working with high-performing engineering teams around the world.
We take great pride in matching our developers with the best partners. Tell us about your team below!