Gps enabled / disabled, but does it work?

I am studying an app that includes LocationSensor
Via commands blocks the gps is enabled and disabled (LocationSensor.enable=true / false)
When the GPS is disabled, the symbol in the upper right corner of phone display, indicating the presence of the active GPS, disappears
But, if I look to the settings (wifi, bt, vert / horiz, gps, …) I see that the gps symbol is still active
Same thing if I start the app for position detection, and the gps in the settings is off, the app does not seem to activate it
The question is: does the LocationSensor.enable property turn on the gps peripheral hardware module or not?
I ask this because I would need to reduce consumption at certain times and having the GPS always on does not allow me to reach the goal

The devices location settings can only be set manually.

The LocationSensor.Enabled = true or false disables the LocationSensor component from
actively using the GPS receiver. It does not deactivate the devices ability to use the GPS receiver (it cannot programably turn it off or on.)

If the GPS is activated manually, it stays on until the USER changes the Android Settings to deactivate it. To deactivate use of the receiver, uncheck in the Settings Location sources Use GPS satellites

LocationSettings
(The actual screen appears differently on different Android OS versions.)

Yes, the USER must turn the GPS receiver on or off manually and it can only be controlled manually.

Regards,
Steve

how to open the settings for the user to enable GPS see the example app “Get Available SSIDs” here https://puravidaapps.com/wifi.php

Taifun


Trying to push the limits! Snippets, Tutorials and Extensions from Pura Vida Apps by Taifun.

ActivityStarterIntents to use an intent to display the Android Settings screen. A USER must manually make his/her selections.

Actually, this is all the code necessary to evoke the Location Settings screen.


The Extras blocks only work on older Androids.

1 Like