Application I'm working on uses both Locations and BLE and if location or bluetooth are disabled I have to ask user to enable them.
Latest Google Play Services provides a standard way to do that using LocationSettingsRequest
which checks requirements and raises standard popup if changes to settings are required. It works like a charm for location alone but once I add SetNeedBle (true)
to LocationSettingsRequest
I get a status SETTINGS_CHANGE_UNAVAILABLE
.
The only my guess was I need to add AddApi (FitnessClass.BLE_API)
call to a GoogleApiClientBuilder
as it might be vital for BLE functionality, but then I got connection to Google Play Services failed with SIGN_IN_REQUIRED
status which is confusing as I just need BLE part of Fitness service.
Does anyone know good example of LocationSettingsRequest
usage to prompt user for both locations and bluetooth?