[mono-android] Introducing the Xamarin Mobile API Preview

devbuzz derek at fieldmetrix.com
Wed Jan 4 11:22:02 EST 2012


A quick question about the geolocation API - I couldn't find any docs :)

I'm grabbing GPS positions in a service using this code:

  geolocator = new Geolocator (this) { DesiredAccuracy = 50 };

  if (!geolocator.IsGeolocationEnabled)
    return;

  geolocator.PositionChanged += gps_LocationChanged;

  if (!geolocator.IsListening)
  {
    geolocator.StartListening(minTime: GPSTimerInterval_ms, minDistance: 0);
  }

The problem is that gps_LocationChanged never runs?

Am I correct in assuming that if StartListening has been run  then as soon
as geolocator gets a fix gps_LocationChanged will run?

Just want to make sure I'm using it correctly - in the sample I see a call
to GetPositionAsync - but that looks like it's for an immediate check?

--
View this message in context: http://mono-for-android.1047100.n5.nabble.com/Introducing-the-Xamarin-Mobile-API-Preview-tp5015136p5120073.html
Sent from the Mono for Android mailing list archive at Nabble.com.


More information about the Monodroid mailing list