protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); // Set our view from the "main" layout resource SetContentView(Resource.Layout.Main); textViewStatus = FindViewById(Resource.Id.textViewStatus) as TextView; textViewLocation = FindViewById(Resource.Id.textViewLocation) as TextView; locationManager = IALocationManager.Create(this); }
public override void ViewDidLoad() { base.ViewDidLoad(); // Perform any additional setup after loading the view, typically from a nib. Console.WriteLine("Starting"); locationHandler = new LocationHandler(); locationManager = new IALocationManager(); locationManager.SetApiKey("API-KEY", "API-SECRET"); locationManager.Delegate = locationHandler; locationManager.StartUpdatingLocation(); }
public override void DidUpdateLocations(IALocationManager manager, IALocation[] locations) { var cl = locations[0].Location; Console.WriteLine("lat: {0} lon: {1}", cl.Coordinate.Latitude, cl.Coordinate.Longitude); }