-
Notifications
You must be signed in to change notification settings - Fork 588
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for API level 21 (package android.bluetooth.le.*) #16
Comments
We are aware of the new scanning API. Thank you for showing your approach - we will check it. |
Or maybe we could backport some of them... Worth considering. |
I agree, we could try to backport as much as we can but for now we should call new API methods on Lollipop and above and fallback to old one's on previous versions of Android. |
Yes Please support api 21+. The improvements on the api are so great, it will be a waste not to use the earlier APIs. I can tell you, devices >21, little to few able problems using the new API. The older API on the other hand .. |
Why not to use the Android BLE Scanner Compat that NordicSemi has? It allows you to abstract like the official android compat libraries does. The license is BSD clause 3 so it doesn't have to suppose a problem to use its codebase. |
I would at least be interested to invert the exclusivity of the service UUID filter, so that I could find different devices with specific UUIDs that are contained in the list. e.g.: private boolean containsDesiredServiceIds(byte[] scanRecord) {
List<UUID> advertisedUUIDs = uuidUtil.extractUUIDs(scanRecord);
for (UUID desiredUUID : filterServiceUUIDs) {
if (advertisedUUIDs.contains(desiredUUID)) {
return true;
}
}
return false;
} |
@uKL @dariuszseweryn I've created pull request for ble scan v21 support #74. Please check if that's helpful for your project |
Summary: #16 #127 Reviewers: michal.zielinski, pawel.urban Reviewed By: pawel.urban Differential Revision: https://phabricator.polidea.com/D2279
Just added the new scanning API to |
As
BluetoothAdapter#startScan
has been deprecated, it would be interesting to support the calls from the mentioned package, which allow more control over the scanning process.As a temporary hack, I created (copy-pasted, in fact) a scan operation class that uses the new API. It can be found here. My idea is that the scan operation receives
ScanFilter
andScanSettings
and emitsScanResult
. All these classes are from theandroid.bluetooth.le
package.The text was updated successfully, but these errors were encountered: