Internationalization and GPSThis was one of those obvious things once I figured it out. We always are aware of internationalization with regards to user facing information. Making sure all thing foreign are correct. But I got nabbed by something internal. The Windows Phone GPS sensor returns position coordinates for latitude and longitude in decimal format (49.1343121, 22.234221). Which I stored in a tracking file. However when I went to play back the track internally I used LinqToXML to load it into a list assigning that same lat and long to a "double" type variable. Well, if you are in, say, France, a decimal place is represented as a "," comma. The Windows Phone GPS sensor still returns data as a decimal but when trying to load that back into a double variable it died an awful death with a data type exception. To overcome the problem there was two things I could do. Figure out how to make The Windows Phone GPS sensor produces coordinates compatible with the native format or just change the conversion to double (from the XML string). I chose the latter: (the useful bit is the "CultureInfo.InvariantCulture")
double latitude = Convert.ToDouble(myStringLatitude, CultureInfo.InvariantCulture);
SkyDrive Permissions and User NameMy app uses SkyDrive integration to upload recorded tracks. Always worked great for me and didn't get complaints from users. Until I got an email from one user who could not upload tracks to SkyDrive. I spent some back and forth time trying to figure out what was going on before he mentioned that his company had black listed SkyDrive for security purposes. Now here is a lesson in not taking things at face value. I bounced a few ideas off a couple of Nokia Developer Ambassadors (what a great resource) and then went back to the user to dig deeper. I got the user to send me a screenshot of his SkyDrive (Live Login) screen. Well, first it was in a foreign language so I had to translate it (used bing translate). Then I noticed, eventually, that one bit of information was missing. It wasn't asking permission to share your name. Not a big deal, and I could live with out it. So I dug into the code and found that because I couldn't get the name it didn't complete the connection bits. Turns out that when you sign up for a Live Id you don't need to provide much other than an email address, then there is no name to share.
The takeaway? Always check carefully what you are asking the Live SDK to provide. You may be asking for more than you need and you should NEVER do that.
Post a Comment