This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

nrf connect location services

Why does the nrf connect app on Android need my location services enabled for it to work? I believe that is the case for most (or all) of the nrf apps in Android.

Parents
  • @AF Android 6.0 introduced some changes with a requirement to have location permissions enabled, if not scanning for ble devices will not return any scan results, read BLE permissions section here. Also Android introduced run-time permissions where the user has to grant these permissions (permissions categorized as dangerous) during run-time where as older versions of android could simply declare these types of permissions that developers thought was necessary. That being said there are two types of permissions ACCESS_COARSE_LOCATION & ACCESS_FINE_LOCATION. The first permission is for an approximate location and the latter is for a very precise location which is user sensitive. This is up to the developer to decide, but in all Nordic Applications we use ACCESS_COARSE_LOCATION permission as there is no need for us to obtain any user sensitive data. In addition to this location permissions, there is location services in android settings which also has to be enabled in order for the device to return the scan results and this is the intended behavior from an Android OS 6.0 point of view for all apps. However when enabling this location services, its up to the user to select High Accuracy, Battery saving or Device only modes as this is not important to Nordic Apps i.e. nRF Connect only redirects the users to the settings screen to enable location services and from there on-wards selecting the location services mode is simply a user preference. So in a nutshell there are two things needed ACCESS_COARSE_LOCATION/ACCESS_FINE_LOCATION (we request for only the minimalistic ACCESS_COARSE_LOCATION permission) and Location services to be enabled in order to return BLE scan results. Hope this helps.

Reply
  • @AF Android 6.0 introduced some changes with a requirement to have location permissions enabled, if not scanning for ble devices will not return any scan results, read BLE permissions section here. Also Android introduced run-time permissions where the user has to grant these permissions (permissions categorized as dangerous) during run-time where as older versions of android could simply declare these types of permissions that developers thought was necessary. That being said there are two types of permissions ACCESS_COARSE_LOCATION & ACCESS_FINE_LOCATION. The first permission is for an approximate location and the latter is for a very precise location which is user sensitive. This is up to the developer to decide, but in all Nordic Applications we use ACCESS_COARSE_LOCATION permission as there is no need for us to obtain any user sensitive data. In addition to this location permissions, there is location services in android settings which also has to be enabled in order for the device to return the scan results and this is the intended behavior from an Android OS 6.0 point of view for all apps. However when enabling this location services, its up to the user to select High Accuracy, Battery saving or Device only modes as this is not important to Nordic Apps i.e. nRF Connect only redirects the users to the settings screen to enable location services and from there on-wards selecting the location services mode is simply a user preference. So in a nutshell there are two things needed ACCESS_COARSE_LOCATION/ACCESS_FINE_LOCATION (we request for only the minimalistic ACCESS_COARSE_LOCATION permission) and Location services to be enabled in order to return BLE scan results. Hope this helps.

Children
No Data
Related