It depends on your app requirements. Applications are moved to the background and eventually are killed by the OS. If it makes sense to stop the GPS when the activity is paused then do it from Activity_Pause.
When the OS kills the process, it kills it immediately.
But if I call StopService (starter) of Activity_Pause the Sub "Service_Destroy" is not performed, I see at least no log.
B4X:
Sub Activity_Pause (UserClosed As Boolean)
If UserClosed Then
'Service beenden
StopService(Starter)
End If
End Sub
Sub Service_Destroy
Log("Starter: Service_Destroy")
End Sub
Just made a test with this code and it does print the message in the logs:
B4X:
Sub Process_Globals
End Sub
Sub Globals
End Sub
Sub Activity_Create(FirstTime As Boolean)
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
If UserClosed Then
StopService(Starter)
End If
End Sub