[mono-android] Introducing the Xamarin Mobile API Preview

Eric Maupin eric.maupin at xamarin.com
Wed Jan 4 11:31:40 EST 2012


Hi Derek,

Be sure that you also listen for Geolocator.PositionError, add a handler
for that and make sure you're not getting any errors.
You're correct that GetPositionAsync is for one-off requests.

API Docs are available at http://betaapi.xamarin.com
Check the docs for StartListening here:
http://betaapi.xamarin.com/?link=M%3aXamarin.Geolocation.Geolocator.StartListening(System.Int32%2cSystem.Double)


On Wed, Jan 4, 2012 at 11:22 AM, devbuzz <derek at fieldmetrix.com> wrote:

> 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.
> _______________________________________________
> Monodroid mailing list
> Monodroid at lists.ximian.com
>
> UNSUBSCRIBE INFORMATION:
> http://lists.ximian.com/mailman/listinfo/monodroid
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/monodroid/attachments/20120104/0ba6911f/attachment.html 


More information about the Monodroid mailing list