Specifying the Accuracy when retrieving the Location in Windows Phone App

In one of my previous blog post, I demonstrated how to get the current location in Windows Phone 8 using the Geolocator class. The Geolocator class allows the developers to specify the desired accuracy to either High or Default.

This will done by setting the DesiredAccuracy property of the Geolocator class to one of the below PositionAccuracy Enum.

  • Default
  • High

In case of the default value, the Operating System will decide the accuracy level and prefers the usage of cell tower and Wifi to identify the location. This is also one of the power optimized technique than GPS.

If the High value is used, the Operating System prefers GPS (if available) and thus provide better accuracy but at the cost of the reduced battery life.

Geolocator locator = new Geolocator();

// Desired Accuracy of High

locator.DesiredAccuracy = PositionAccuracy.High;

//Default Accuracy

locator.DesiredAccuracy = PositionAccuracy.Default;

The Geolocator class also exposes the property DesiredAccuracyInMeters which also lets the Operating System to choose the location providers for identifying the location. When this property is set with a non-null value, the DesiredAccuracy value is overridden. The lower the value will make the phone prefer the GPS.

Geolocator locator = new Geolocator();

locator.DesiredAccuracyInMeters = 20;

Leave A Reply

Your email address will not be published. Required fields are marked *

You May Also Like

In this post, you’ll learn about the Win32 Error “0x000019E5 – ERROR_COULD_NOT_RESIZE_LOG” that you get when debugging system erors in...
In this post, you’ll learn about the error “CO_E_DBERROR 0x8004E02B” that is returned when working with COM based APIs or...
In this post, you’ll learn about the Win32 Error “0x000019D0 – ERROR_LOG_BLOCK_VERSION” that you get when debugging system erors in...