Windows Phone 7 Home Country Discovery

Is there a way to programmatically find out what country the user phone is in when my application is open on the phone?

I have an application that I am developing that can use lbs / kg units , and if someone is from the United States, I want to enable lbs by default and if the phone is from another place, I want to show the default kilogram. (note that I don’t need to think to check where they connect will be accurate, because it may be that they are traveling or using a proxy server in another country).

+8
windows-phone-7 silverlight
source share
4 answers

You cannot get a country, but you must guess it:

Personally, I would not worry about the traveling scenario - traveling Americans buying your application represent a very small percentage of your downloads.

+7
source share

You can also use GPS to get your current position, and then use the Bing API to get a country with lat / long.

Using GPS includes its headaches, such as adding a Privacy Policy, but from Stuart's answer, this seems like the most accurate way.

+2
source share

System.Globalization.RegionInfo.CurrentRegion.DisplayName;

+1
source share

Why not just take a look at System.Globalization.RegionInfo.CurrentRegion.IsMetric?

Here is an example: http://msdn.microsoft.com/en-us/library/windowsphone/develop/system.globalization.regioninfo.ismetric(v=vs.105).aspx

0
source share

All Articles