質問

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

役に立ちましたか?

解決

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.

他のヒント

I'm new to Android development... if a Google Play service can be considered almost part of the OS, there is GeoFencing api.

http://developer.android.com/training/location/geofencing.html

the api impacts less on battery life than an owned service.

Please correct me if I'm wrong

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top