Detecting home country of Windows Phone 7 - silverlight

Is there a way to programmatically find out what country a user's phone is from when my app is opened on their phone?
I have an app I'm developing that can use lbs/kg units and if someone's phone is from the United States, I want to enable lbs by default and if the phone is from anywhere else, I want to display kg by default. (note that I don't need think checking where they are connecting from would be accurate because it could be that they are travelling or using another country's proxy server).

You can't get the country, but you should be able to guess it from:
the Locale of the device - see How to get "region & language" settings in WP7 via code?
or from the TimeZone of the device - see TimeZoneInfo.Local - http://msdn.microsoft.com/en-us/library/system.timezoneinfo.local.aspx
Personally, I wouldn't worry about the travelling scenario - travelling Americans purchasing your app represents a very small percentage of your downloads.

You could also use the GPS to get their current position, then use the Bing API to get the country from the lat/long.
Using the GPS involves it's own headaches like adding a Privacy Policy, but from Stuart's answer, it seems like the most accurate way.

System.Globalization.RegionInfo.CurrentRegion.DisplayName;

Why not just look at System.Globalization.RegionInfo.CurrentRegion.IsMetric?
There is an example here: http://msdn.microsoft.com/en-us/library/windowsphone/develop/system.globalization.regioninfo.ismetric(v=vs.105).aspx

Related

To use google server

I have a android game designed by me. I want to release it to play store and want to know the name, phone number, mail id and score of the highest scorer at the end of day. How to link the game to google server to make this happen?
This article is a good place to start:
https://cloud.google.com/solutions/mobile/developing-mobile-games-on-google-app-engine-compute-engine/
It outlines everything you need to start work on a server-side to a mobile game, including high score tables.

Is there any software/application contain all the brand phone emulator,so that i can test phone apps on emulator?

Ask for help/share information.
Recently i develop some phone apps in ios,android,blackberry,window,nokia and others.
But i want to noe is there any software/application contain all the type of emulator,so that i can test it on different model of devices to see the layout.Something like Nokia-Remote Device Access, of coz inside only have nokia phone emulator.What i want is software/application that contain all hte emulator(iphone,samsung,backberry,etc) to use it.Hope anyone share out information no matter paid/free software.
thank you

WP7 - compass pointer

Sorry for the really general question, but I don't have a clue where to start. There's a component I want to develop for a WP7 application which is a an arrow that points in the direction (preferable X, Y, Z planes) of an address from where the user is currently located.
So for example, if you're lost in the woods and you have the address (long/latitude) of your house, it will always point you home.
Anyone know of any way to get started with this or samples or.....?
Thx in advance!
With the release of Mango you can now use the Compass class.
There is also the Raw Sensor Data Sample and How to: Get Data from the Compass Sensor for Windows Phone.
Unfortunately as of January 2011, Microsoft has not yet exposed the compass functionality with a public API. You'll have to wait till a later release for that.
If you are interested in the Latitude and Longitude, the GeoCoordinateWatcher is the place to start.
You can write so many miles East/West/North/South on the app page ( not worth much) if required.
You can even show a dynamic bing map with an indication of current location and destination using pins. But can't show the directions/orientation of the device w.r.t. actual direction.
You can get current GPS location and home GPS location. check the location service API http://msdn.microsoft.com/en-us/library/ff431803.aspx
Cant you use the GeoCoordinate.Course to get direction you are going?
Sebulba

Automatically Determine SMS Carrier-Provided Email from Mobile Number

Is there away to automatically determine the SMS carrier email domain from a mobile number?
(Similar to how you can look up a hostname from an IP address?)
Technically, it appears to be possible, considering these guys are doing it. Not sure how, though. Also, Verizon offers a service to check their own network: Verizon Wireless Network Checker
I would suggest NeuStar or use a Aggregator like OpenMarket
Just discovered that you can send SMS for free via google voice! Tested working for about a dozen countries so far (USA, Canada, Taiwan, Japan, Australia, China, France, Germany, Switzerland, UK) - likely others.
This would eliminate the need to use carrier-email checking to reduce spendings on third party SMS gateways.

Any way to get the location of a cell phone?

Is there any way to get the location of a cell phone (i.e. latitude/longitude) automatically when the user views a web page? This will primarily be used outside of the United States, so if there is some international standard that the US may or may not follow, that's what I'd need to know.
You can use their IP address to get a general idea. It's not very specific, but it works.
This place has a web service that will let you get their location with PHP or another server side scriping language.
http://www.geobytes.com/IpLocator.htm?Getlocation
There is no standard. The GSM and CDMA phone systems can easily be traced as per their design but you as a non government / network operator cannot trace a cellphone without a user's permission.
Do the words invasion of privacy come to mind?
I know that google has a service that can publish your GPS location if you wish, but this is opt in and you are able to switch it off.
As a iPhone user, I know that there is some applications that actually ask the user permission before geolocating there position. So there might be something in the iPhone SDK.
That way, it is reasonable to think that there is some way to do it.
Firefox 3.5 now supports geolocation, but it's not a very popular mobile browser.
http://en-gb.www.mozilla.com/en-GB/firefox/geolocation/
I'll probably try using Latitude with it's JSON feed.
See Yahoo's Fire Eagle service. Your user would require a Fire Eagle account.

Resources