none
How to pre-populate user's current location in the app? RRS feed

  • Question

  • Hi,

    How to get the logged in user's current location?

    How to convert the longitude and latitude values into respected location,city and country and how to save them into a database table?

    Thanks in advance

    Santhosh

    Monday, October 21, 2013 9:35 AM

All replies

  • To get the current location, you need to use the Windows Phone Location Service.  An example of how to do this is found in a Location Service Sample provided by Microsoft.

    To convert the coordinates to an address, you will need to convert the coordinates with a service.  Bing Maps has a Locations API that can do this for you.

    Monday, October 21, 2013 10:36 AM
  • Hey

    thanks Salzbburg..

    Can you please tell me more about Locations API?

    how to convert those coordinates to an address?

    Can i have any code on that using C# and xaml??

    Monday, October 21, 2013 10:57 AM

  • how to convert those coordinates to an address?

    Can i have any code on that using C# and xaml??

    There are links on the Locations API page that show how to use the API in VB and xaml.  There are a other services that provide geocoding as well.  Look at Converting Addresses to/from Latitude/Longitude/Altitude in One Step to see a list of a few other services available. 

    Generally, you will have to send a web request with the coordinates to convert and possibly a key as well and then read and parse the response to read the information.  

    Monday, October 21, 2013 11:41 AM