You need to be a premium member to use this feature. To access it, you'll have to upgrade your membership.
Become a sharper developer and jumpstart your career.
$0
$
. 00
monthly
For Basic members:
$10
For Premium members:
This article describes how to create a Geo Location Service in Windows Phone.
IntroductionWith the change of Windows Phone 7.5 to Windows Phone 8 API we have many changes in terms of layout, architecture and bug fixes, but there are many changes regarding the Geo Location classes. With Window Phone 8 SDK we have improvised classes that does the same job and is easy to use.Agenda
ProceduresStep 1Create a Blank Windows Phone Silverlight Project and try to mock the following layout.And, enable ID_CAP_LOCATION the Capability in Properties > WMAppManifest.xml as in the following:Step 2Now, we need to define the Geo Locator.So, create a callback method for the Button's click event. //SetUp GeoLocator
Here, we created an instance of the Geolocator class where we set the two fields, in other words DesiredAccuracyInMeter and DesiredAccuracy. Step 3Next, we need to define the Geopositon class that will provide the value of Latitude and Longitude. try
The final code will look like:
OutputAfter doing all this, we will get something like this.ConclusionIn this demo app we have done something old that we have done earlier in Windows Phone 7.5 SDK, but this time we have used Windows Phone 8 SDK's class that let us do the same job in a few lines of code. Next, we will try to put this latitude-Longitude in a map.For this demo, if you experience any issue then try to figure it out from the enclosed solution file.
Step into Windows Phone 8