Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.
End Sub
Sub Globals
Dim LocationClient1 As LocationClient
End Sub
Sub Activity_Create(FirstTime As Boolean)
Dim GooglePlayServicesHelper1 As GooglePlayServicesHelper
Dim ServiceStatus As Int=GooglePlayServicesHelper1.IsGooglePlayServicesAvailable
Select ServiceStatus
Case GooglePlayServicesHelper1.SUCCESS
Log("GooglePlayServicesHelper IsGooglePlayServicesAvailable service available")
LocationClient1.Initialize("LocationClient1")
LocationClient1.Connect
Case Else
Log("GooglePlayServicesHelper IsGooglePlayServicesAvailable returned: "&ServiceStatus)
End Select
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub
Sub LocationClient1_Connected
Log("LocationClient1_Connected")
Dim LocationRequest1 As LocationRequest
LocationRequest1.Initialize
LocationRequest1.SetPriority(LocationRequest1.PRIORITY_BALANCED_POWER_ACCURACY)
Dim LocationListener1 As LocationListener
LocationListener1.Initialize("LocationListener1")
LocationClient1.RequestLocationUpdates(LocationRequest1, LocationListener1)
End Sub
Sub LocationClient1_ConnectionFailed(ErrorCode As Int)
Log("LocationClient1_ConnectionFailed ErrorCode="&ErrorCode)
End Sub
Sub LocationClient1_Disconnected
Log("LocationClient1_Disconnected")
End Sub
' ** the GPS library must be enabled to work with Location objects **
Sub LocationListener1_LocationChanged(Location1 As Location)
Log("LocationListener1_LocationChanged")
Log(Location1.Latitude&", "&Location1.Longitude)
End Sub