Hi everybody¡¡
I'm triying to do an app to track our employes during working hours.
I've tested succesfully the FusedLocationProvider example in a service, and I can schedule it with startserviceat (some strange thing happend sometimes, but that's another story).
The point is I want the workers know when they are being tracked. I mean, we want a notify icon while the location service is active.
If I put the notification code and startserviceforeground in the same service that fusedlocationprovider service, I get the notify icon just while the fusedlocation locating is happening (less than a second)
If I have a service with the notify icon, start it foreground and call the fusedlocation service from this service, I just get the position one time (I've tried the startserviceat in both services, with same result)
Service1:
Thanks¡¡
I'm triying to do an app to track our employes during working hours.
I've tested succesfully the FusedLocationProvider example in a service, and I can schedule it with startserviceat (some strange thing happend sometimes, but that's another story).
The point is I want the workers know when they are being tracked. I mean, we want a notify icon while the location service is active.
If I put the notification code and startserviceforeground in the same service that fusedlocationprovider service, I get the notify icon just while the fusedlocation locating is happening (less than a second)
If I have a service with the notify icon, start it foreground and call the fusedlocation service from this service, I just get the position one time (I've tried the startserviceat in both services, with same result)
Service1:
B4X:
Sub Service_Start (StartingIntent As Intent)
Notification1.Sound = False
Notification1.SetInfo("My Company", "Tracking", Main)
Service.StartForeground(1, Notification1)
StartService(LocationService)
'******I've tried the next line here and in LocationService too
StartServiceAt(LocationService,DateTime.Now + (5 * DateTime.TicksPerMinute),True) '(60 * DateTime.TicksPerMinute)
Service.StopAutomaticForeground
End Sub
Thanks¡¡