B4A Library Expanded Location Manager Library

Cebuvi

Active Member
Licensed User
Longtime User
Hi,

Is it possible to detect when the GPS is off?

Thanks

Cesar
 

Croïd

Active Member
Licensed User
Longtime User
B4X:
If ..... = DialogResponse.POSITIVE Then

GPS = p.GetSettings("location_providers_allowed")

If GPS.IndexOf("gps")> -1 Then

Msgbox("GPS","OK !")

Else

Msgbox("Activate GPS ! ","Carefulness")

StartActivity(GPS.locationSettingsIntent)
 

Cebuvi

Active Member
Licensed User
Longtime User

Thank you very much
 

peacemaker

Expert
Licensed User
Longtime User
Actually, in simplest way, most of app that needs LAST KNOWN coordinates - should have a class or lib, that has commands to:
* check and activate network location (WiFi and cell network), if avalable and allowed in the system settings; else return that not available, or not allowed
* check and activate GPS location, if avalable and allowed in the system settings; else return that not available, or not allowed
* command to get Last_known_location, by the date_time, among both above, and not important which

Such code module would be very ... interesting.
 

Croïd

Active Member
Licensed User
Longtime User
Does that work for you? (version 4.4 may be not work !)


reply : OK works well android V4.4 & V5
 
Last edited:

coslad

Well-Known Member
Licensed User
Longtime User
Doesn't works on Note 3 kitkat, without gps doesn't gets coordinate
 

achtrade

Active Member
Licensed User
Longtime User
HI,

How can i clear an old location that was found . my app seems to record the last location. how would i make the app get the new location instead. (based on network network).

regards,
Tom

I'm getting this same error. How can we fix this ?

My apps is getting the first location but after I call lm.findLastLocation("null") every 5 seconds, the result is the same. I don't need the GPS/WIFI location, please help

B4X:
Sub Activity_Create(FirstTime As Boolean)
    lm.Initialize("Location")
    myList.Initialize
end 

Sub timer2_Tick
    myList = lm.findLastLocation("null")
    passiveLat = NumberFormat(myList.Get(7), 0, 9)
    passiveLong  = NumberFormat(myList.Get(8), 0, 9)
End Sub
 

hookshy

Well-Known Member
Licensed User
Longtime User
My apps is getting the first location but after I call lm.findLastLocation("null") every 5 seconds, the result is the same. I don't need the GPS/WIFI location, please help

try to read myList size ...in this way you will find out that ..element number 7 and 8 does not exist
I am not the creator but I took some protections by code and try to read what is availlable
 

EduardoElias

Well-Known Member
Licensed User
Longtime User
I have a customer with a parking lot and want that people from the car ask for things to delivery to the car. So the guy park in a spot and using an app request stuff that will be taken to him. If I can triangulate with the Wifi antennas of that customer I could know in wich direction the car is parked.

Is it possible?
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…