In this chapter, we will learn how to use the significant location change monitoring feature.
Create a new Single View Application in Xamarin Studio and name it SLCApp
. Add a label and two buttons on the view of the controller.
Perform the following steps:
Add the following
ViewDidLoad
method in theSLCAppViewController
class:private CLLocationManager locationManager; public override void ViewDidLoad () { base.ViewDidLoad (); // Perform any additional setup after loading the view, typically from a nib. this.locationManager = new CLLocationManager(); this.locationManager.LocationsUpdated += LocationManager_LocationsUpdated; this.btnStart.TouchUpInside += (s, e) => { this.lblOutput.Text = "Starting monitoring significant location changes..."; this.locationManager.StartMonitoringSignificantLocationChanges(); } ; this.btnStop.TouchUpInside += (s, e) => { this.locationManager.StopMonitoringSignificantLocationChanges...