WP7 - Can You Monitor Location Change?

Someone asked on Stack Overflow:

Is there a good way to monitor a phone’s location? I’m working on an app that lets you check in to places, but I want to automatically check the user out if their phone leaves the place. So the app would need to wake up every 10 or 15 minutes, whether the phone was locked or not, and compare its current location to the location of the last place it was checked in. If it’s not the same, it checks the user out.

The challenge is that the phone might be locked when the user leaves the location, and I don’t want to wait until the user unlocks their phone, or even worse, opens the app to update the location.

Is there a good way to do this in WP7?

I posted the following answer, which was chosen as the accepted answer and received 2 upvotes:

You will need to use the GeoCoordinateWatcher and the Background Tasks API. Using it in a background task causes it to use cached location data. This cache is updated every 15 minutes.

This API, used for obtaining the geographic coordinates of the device, is supported for use in background agents, but it uses a cached location value instead of real-time data. The cached location value is updated by the device every 15 minutes.

MSDN


Originally posted on Stack Overflow — 2 upvotes (accepted answer). Licensed under CC BY-SA.

signed letter b

Dad. Geek. Gamer. Software developer. Cloud user. Old Car enthusiast.  Blogger.


Top Posts


profile for Nate on Stack Exchange, a network of free, community-driven Q&A sites
a proud member of the blue team of 512KB club
Thoughts, opinions, and ideas shared here are my own. © 2026 Nate Bross.