Enabling Location Permissions on AndroidUpdated 2 years ago
You may have noticed that some of our Android apps ask for Location Permissions when you use them. In a number of our apps, Location Permissions are required to scan for and find BLE (Bluetooth Low Energy) enabled Sphero robots nearby. We do not collect, store, or share any location information about our users. In most of our apps, displaying the Location Permission popup is required by Google and we have implemented it in order to comply with their developer documentation.
Sphero Android apps that do not require Location Permissions for Bluetooth scanning:
- Sphero Edu (with version 6.3.3 or newer)
Sphero Android apps that require Location Permissions for Bluetooth scanning:
- Sphero Play
- Sphero Edu Jr
- Specdrums Mix
As of version 6.3.3, the Android Sphero Edu app uses a companion pairing process, which removes the need for Location Permissions when scanning for nearby robots. In this implementation, Android handles the scanning process rather than the Sphero Edu app, which removed the technical need for Location Permissions.
Technical Breakdown of Location Permission Requirements
Google introduced changes to how they handle permissions and protect users in Android 6. As of Android 6, apps that use BLE to scan for Bluetooth hardware must declare either fine or course location permissions. See this official documentation from Google that covers the requirement.
The text below is applicable:
To access the hardware identifiers of nearby external devices via Bluetooth and Wi-Fi scans, your app must now have the ACCESS_FINE_LOCATION or ACCESS_COARSE_LOCATION permissions
In particular, note that we need the ACCESS_COARSE_LOCATION permission to use BluetoothLeScanner.startScan(), which is used to scan for available Sphero robots in range.
Google has added additional requirements in Android 10, including the need for the ACCESS_FINE_LOCATION permission when scanning for robots via BLE. See this documentation for additional details.
The text below is applicable:
If your app targets Android 10 or higher, it must have the
ACCESS_FINE_LOCATION
permission in order to use several methods within the Wi-Fi, Wi-Fi Aware, or Bluetooth APIs.Google has added additional requirements in Android 12 when scanning for robots via BLE. Similarly to Android 10, Android 12 requires ACCESS_FINE_LOCATION permissions. However, It allows users to choose if they give precise or approximate location data to the app. See this documentation for additional details.
The text below is applicable:
When your app requests both
ACCESS_FINE_LOCATION
and ACCESS_COARSE_LOCATION
, the system permissions dialog includes the following new options for the user:Precise: Provides the location accuracy that the
ACCESS_FINE_LOCATION
permission provides.Approximate: Provides the location accuracy that the
ACCESS_COARSE_LOCATION
permission provides.On Android 12, users must select "Precise" location to be able to scan for Sphero robots.
ACCESS_FINE_LOCATION and ACCESS_COARSE_LOCATION permissions result in the end user being prompted to enable Location Permissions. As a result, we will need to continue displaying Location Permission prompts to the end user to allow them to scan for BLE robots.