Only execute once the event LocationChanged

Xavier Massana Cuadras

New Member
Licensed User
Longtime User
A few days ago I started using basic4app. I want to make an application with gps. I take a day testing the gps and gpslog examples. When you execute the examples in a Samsung Galaxy tablet begins to detect the satellites properly and has to call the event call GpsStatus until after this event LocationChanged called about 3 or 4 times to the event and stands GpsStatus. After that the application remains as standing and no event is called. It's like a call to only allow LocationChanged event. Are there any restrictions on that? I do something wrong? Can you help? Thank you. :sign0085:
 

Xavier Massana Cuadras

New Member
Licensed User
Longtime User
The code is the same as the example for gps tutorial, however I copy here:

Sub Process_Globals
Dim GPS1 As GPS
End Sub

Sub Globals
Dim lblLon As Label
Dim lblLat As Label
Dim lblSpeed As Label
Dim lblSatellites As Label
End Sub

Sub Activity_Create(FirstTime As Boolean)
If FirstTime Then
GPS1.Initialize("GPS")
End If
Activity.LoadLayout("1")
End Sub

Sub Activity_Resume
If GPS1.GPSEnabled = False Then
ToastMessageShow("Please enable the GPS device.", True)
StartActivity(GPS1.LocationSettingsIntent) 'Will open the relevant settings screen.
Else
GPS1.Start(0, 0) 'Listen to GPS with no filters.
End If
End Sub

Sub Activity_Pause (UserClosed As Boolean)
'GPS1.Stop
End Sub

Sub GPS_LocationChanged (Location1 As Location)
lblLat.Text = "Lat = " & Location1.ConvertToMinutes(Location1.Latitude)
lblLon.Text = "Lon = " & Location1.ConvertToMinutes(Location1.Longitude)
lblSpeed.Text = "Speed = " & Location1.Speed
End Sub

Sub GPS_UserEnabled (Enabled As Boolean)
ToastMessageShow("GPS device enabled = " & Enabled, True)
End Sub

Sub GPS_GpsStatus (Satellites As List)
lblSatellites.Text = "Satellites:" & CRLF
For i = 0 To Satellites.Size - 1
Dim Satellite As GPSSatellite
Satellite = Satellites.Get(i)
lblSatellites.Text = lblSatellites.Text & CRLF & Satellite.Prn & _
" " & Satellite.Snr & " " & Satellite.UsedInFix & " " & Satellite.Azimuth _
& " " & Satellite.Elevation
Next
End Sub
 

Xavier Massana Cuadras

New Member
Licensed User
Longtime User
First thanks for the attention EREL.
I've been testing and in the end we found that the Samsung does not work correctly Table GPS, it seems to be giving a reading and close the GPS. So DDEL problem of the event. We checked with Google Map and similarly. Forgive yourself for the error. regards
 
Top