Skip to content
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

Handle Bluetooth state/permission changes correctly #6

Closed
sandy-8925 opened this issue Feb 3, 2021 · 5 comments
Closed

Handle Bluetooth state/permission changes correctly #6

sandy-8925 opened this issue Feb 3, 2021 · 5 comments
Labels
bug Something isn't working

Comments

@sandy-8925
Copy link
Owner

sandy-8925 commented Feb 3, 2021

  • For Bluetooth APIs to work, Bluetooth atleast must be enabled, and sometimes Location too. Location permissions may also be needed.
  • The app has to listen for changes to Bluetooth, Location setting and location permission changes and react correctly
  • For example, the background device scanning code has to start/stop scanning based on these state changes (already implemented)
  • The UI must also react accordingly - DeviceServiceExploreActivity and CharacteristicActivity must gracefully exit when Bluetooth is disabled (since they depend on working Bluetooth APIs to create a connection to the device and interact with it).
@sandy-8925 sandy-8925 added the bug Something isn't working label Feb 28, 2021
@sandy-8925
Copy link
Owner Author

sandy-8925 commented Mar 24, 2021

So it seems that Bluetooth connection and interaction device works fine without location services or permission - it's only the Bluetooth scanning that requires location permissions and services to be enabled. That part is already handled properly by RxAndroidBle.

Also, if location (or any other permission) is denied, Android will kill the app process, so we don't have to worry about handling that scenario.

@ildar
Copy link

ildar commented Mar 25, 2021 via email

@sandy-8925
Copy link
Owner Author

this all sounds like for recent versions of Android. I just hope you wont drop older versions support. Thanks.

No, I'm not planning to drop support for the older versions. It's just that we need to also support the newer versions properly (e.g location permissions requirement). Anyway, I've finally raised the target SDK version to API 23 (Android 6.0 Marshmallow). Will raise it soon, all the way to API 29.

@sandy-8925
Copy link
Owner Author

Finished implementing as of 995951f

@sandy-8925
Copy link
Owner Author

@ildar

Also, wanted to inform you that I've done all of my new work in a new branch here - https://github.com/sandy-8925/BLExplorer/tree/modernization_v2

I doubt I'll be able to merge this upstream, since I've made a huge number of changes and ligi hasn't reviewed that initial change yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants