Search code examples
androidwakeup

Android: Wake up App when Location is significantly Changed


I am converting an iOS app to Android. I am looking for what tools to use to do the following:

When the location of the device significantly changes, if the app is in the background, or off, it should be brought to the foreground and passed the new location details, or similar.

Do I need to use a service, or is there built in functionally like on iOS's SignificantLocationCh . ange option


Solution

  • You should use a service to do this. A service can run almost indefinitely in the background and notify your application of a change.

    You can use LocationListener to get the current location and then do comparisons from there. There is no default function that I know of to listen for a significant change.