Hi all,
I would like to developed an application android to get my longitude & latitude of my current location
I have saw many examples and using different libs , so I did one example but still I got an error.
here is my code:
in this code I got missing parameter !! could any once help me please. thanks in advance.
I would like to developed an application android to get my longitude & latitude of my current location
I have saw many examples and using different libs , so I did one example but still I got an error.
here is my code:
in this code I got missing parameter !! could any once help me please. thanks in advance.
B4X:
Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.
Dim g As GPS
End Sub
Sub Globals
'These global variables will be redeclared each time the activity is created.
'These variables can only be accessed from this module.
Dim nav As Navigation
Private lbl_info As Label
End Sub
Sub Activity_Create(FirstTime As Boolean)
'Do not forget to load the layout file created with the visual designer. For example:
If FirstTime Then
g.Initialize("GPS")
End If
Activity.LoadLayout("1")
End Sub
Sub GPS_LocationChanged (location1 As Location)
lbl_info.Text = "Lat:" & location1.ConvertToSeconds(location1.Latitude) & "Long:" & location1.ConvertToSeconds(location1.Longitude)
lbl_info.Text=& CRLF&"UTM:"&nav.LatLonToUTM(6378137.0,1/298.257223563,location1.Latitude,location1.Longitude)
'= & CRLF & "UTM:" & nav.LatLonToUTM(6378137.0, 1/298.257223563, location1.Latitude, location1.Longitude)
'lblLon.Text = "Lon = " & location1.ConvertToMinutes(location1.Longitude)
End Sub
Sub GPS_userenabled (Enabled As Boolean)
End Sub
Sub GPS_gpsstatus(satellites As List)
End Sub
Sub Activity_Resume
If g.GPSEnabled = False Then
ToastMessageShow("Please enable GPS",True)
StartActivity(g.LocationSettingsIntent)
Else
g.Start(0, 0)
End If
End Sub
Sub Activity_Pause (UserClosed As Boolean)
g.Stop
End Sub