Android Question Detect the location option

Cebuvi

Active Member
Licensed User
Longtime User
I have an application that I want to detect the option enabled in location services.
I have used the following code that works fine

B4X:
Sub Detectar
    Dim Phone1 As Phone
    Dim LP As String


    LP = Phone1.GetSettings("location_providers_allowed")
   
    lblModo.Text=LP


End Sub

But the constant " LOCATION_PROVIDERS_ALLOWED" is deprecated in API level 19.
I am trying to replace with "LOCATION_MODE" , but I do not get any results.
What can be the solution?

Thanks.

 

Cebuvi

Active Member
Licensed User
Longtime User
At the moment it works, but I would like to use the most recent constant to avoid problems with future updates.
 
Upvote 0
Top