#Region Service Attributes
#StartAtBoot: True
#StartCommandReturnValue: android.app.Service.START_STICKY
#End Region
Sub Process_Globals
Dim FluffyLocation As RSFluffyLocation
Dim LocationInfo As RSFluffyLocationInfo
Dim p As PhoneWakeState
End Sub
Sub Service_Create
Dim n As Notification
n.Initialize
n.Icon = Null
n.Vibrate = False
n.OnGoingEvent = True
n.SetInfo("armap", "Store GPS Info", Null)
Service.StartForeground(0, n)
End Sub
Sub Service_Start (StartingIntent As Intent)
p.KeepAlive(True)
p.PartialLock
FluffyLocation.EnableDebugging
If StartingIntent.Action = "com.rootsoft.rsfluffylocation.littlefluffylocationlibrary.LOCATION_CHANGED" Then
Log("FLUFFY - LOCATION CHANGED.")
LocationInfo = FluffyLocation.getLocationInfo(StartingIntent)
FluffyLocation_LocationUpdated
Else If StartingIntent.Action = "com.rootsoft.rsfluffylocation.littlefluffylocationlibrary.LOCATION_CHANGED_TICK" Then
Log("FLUFFY - LOCATION CHANGED TICK.")
LocationInfo = FluffyLocation.getLocationInfo(StartingIntent)
FluffyLocation_LocationUpdated
End If
If FluffyLocation.Initialize4("com.rootsoft.rsfluffylocation", True, 60 * 1000, 2 * 60 * 1000) = 1 Then
FluffyLocation_LocationUpdated
Else
Log("FluffyLocation is not supported.")
End If
FluffyLocation.ForceLocationUpdate
End Sub
Sub FluffyLocation_LocationUpdated
Log("Location update: " & LocationInfo.Longitude)
End Sub
Sub Service_Destroy
End Sub