#Region Project Attributes
Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.
Dim rp As RuntimePermissions
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 Button1 As Button
Dim g As GPS
Dim r As ESLocation2
End Sub
Sub Activity_Create(FirstTime As Boolean)
'Do not forget to load the layout file created with the visual designer. For example:
Dim bOk1 As Boolean
Dim bOk2 As Boolean
g.Initialize("gps")
r.Initialize("es")
Activity.LoadLayout("1")
rp.CheckAndRequest(rp.PERMISSION_ACCESS_FINE_LOCATION)
wait for Activity_PermissionResult (Permission As String, Result As Boolean)
If Permission = rp.PERMISSION_ACCESS_FINE_LOCATION Then
bOk1 = Result
End If
rp.CheckAndRequest(rp.PERMISSION_ACCESS_COARSE_LOCATION)
wait for Activity_PermissionResult (Permission As String, Result As Boolean)
If Permission = rp.PERMISSION_ACCESS_COARSE_LOCATION Then
bOk2 = Result
End If
If bOk1 And bOk2 Then
LocatePosition
Else
ToastMessageShow("The user did not permit the use of its location.", True)
End If
End Sub
Sub LocatePosition
Msgbox("Locating position.", "Title")
g.Start(5000, 50)
Msgbox("Started.", "Title")
g.Stop
Msgbox("Stopped.", "Title")
End Sub
Sub es_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)
End Sub
Sub gps_LocationChanged (Location1 As Location)
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub