Sub Process_Globals
End Sub
Sub Globals
Dim lm As LocationManager
Dim BStart As Button
Dim BStop As Button
Dim EAccuracy As EditText
Dim EAltitude As EditText
Dim EBearing As EditText
Dim ELatitude As EditText
Dim ELongitude As EditText
Dim EProvider As EditText
Dim ESpeed As EditText
Dim ETime As EditText
End Sub
Sub Activity_Create(FirstTime As Boolean)
Activity.LoadLayout("main")
lm.Initialize("Location")
Activity.AddMenuItem("Update location","mnuLocation")
Activity.AddMenuItem("Stop Listening","mnuStopListening")
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub
Sub mnuLocation_Click
lm.requestMobileLocation
End Sub
Sub mnuStopListening_Click
lm.stopMobileListening
End Sub
Sub Location_LocationChanged (Longitude As Double, Latitude As Double, Altitude As Double, Accuracy As Float, Bearing As Float, Provider As String, Speed As Float, Time As Long)
'Longitude = طول
'Latitude = عرض
'Altitude = بلندی از سطح دریا
'Accuracy= درجه دقت
'Bearing = سمت حرکت . زاویه حرکت به سمت
'Provider = مهیا کننده . بدست آورنده
'Speed = سرعت
'Time = ساعت
EAccuracy.Text=Accuracy
EAltitude.Text=Altitude
EBearing.Text=Bearing
ELatitude.Text=Latitude
ELongitude.Text=Longitude
EProvider.Text=Provider
ESpeed.Text=Speed
ETime.Text=DateTime.Time(Time)
End Sub
Sub Location_ProviderDisabled (Provider As String)
Msgbox("Provider","Provider Disabled")
End Sub
Sub Location_ProviderEnabled (Provider As String)
Msgbox("Provider","Provider Enabled")
End Sub
Sub Location_StatusChanged (Provider As String, Status As Int)
Msgbox("Provider: " & Provider & CRLF & "Status: " & Status,"Status Changed")
End Sub
Sub BStop_Click
lm.stopGPSListening
End Sub
Sub BStart_Click
lm.requestGPSLocation
End Sub