Windows Phone 7 Certification

I submitted my 1st phone for certification last week.  It failed for 3 reasons:

1) Because I use the location service, I need to have a privacy policy.  I am sure some lawyers at MSFT cooked this one up – in any event since I don’t store or transmit the data my privacy policy is pretty vanilla.  I stuck it on the configuration page.  I am surprised that MSFT doesn’t look at the source code and determine if the location service is actually doing any transmission or storage.  I guess they are just doing a CYA.

2) I had some chrome in my screenshot.  It is kind of pain doing the screen shot because the GeoService does not work with the emulator so I have to rig up a faux-screen to use the snipping tool.  Oh well, I’ll do another one.

3) When the location service is disabled on the phone, the app does not handle it gracefully (it goes boom).  This is issue I am glad Microsoft caught – I didn’t know that the users can disable the location service in the settings of the phone.  I need to code around this problem by checking the status of the GeoLocationWatcher before calling any of its functions.  This issue makes me appreciate the certification process.

 

In any event, I plan to make these changes and release 1.1 by the end of the day.  Less blog, more code…

TSQL ‘IN’ Equivalent in LINQ

I needed to create an ‘in’ query in LINQ.  After searching around a bit, I came across this post.  Very handy:

var q = from l in context.RoadAlert_Location join at in alertTypeIds on l.AlertTypeId equals at select l; foreach (RoadAlert_Location location in q) { locations.Add(MapLocation(location)); }

GetName() fails in Windows Phone 7

I am finishing up my 1st real windows phone application and I am creating an “About” page. Instead of hard-coding in the version number, I thought I would take a trick form my old WinForm days and use System.Reflection

I whipped up some code like this:

protected override void OnNavigatedTo(System.Windows.Navigation.NavigationEventArgs e) { this.VersionTextBlock.Text = String.Format("Version {0}", Assembly.GetExecutingAssembly(). GetName().Version.ToString()); base.OnNavigatedTo(e); }

I then ran it and got the following error:

image

Ugh. I was going to figure out what was wrong but then I deferred to the example in Chapter 6 in Adam Nathen’s 101 Windows Phone Apps . I changed the code to this:

protected override void OnNavigatedTo(System.Windows.Navigation.NavigationEventArgs e) { string fullAssemblyName = typeof(AboutPage).Assembly.ToString(); int firstComma = fullAssemblyName.IndexOf("Version="); int secondComma = fullAssemblyName.IndexOf(",", firstComma); string versionNumber = fullAssemblyName.Substring(firstComma, secondComma - firstComma); this.VersionTextBlock.Text = versionNumber; base.OnNavigatedTo(e); }

That worked fine.

MSTest Name Conflicts

As part of my day job, I sometimes have to present a solution with a “before” and an “after” project.  Typically, I would create a before solution folder and an after solution folder and put the two different projects in into their respective folder.  I would then flip over to the file system and move the folders around so that the physical paths match the logical paths in VS2010.  I recently created a before and after C# project and I included a test proejct to accompany each working project.  When I tried to include both test projects in the same solution (even in different solution folders), I got this:

image

Apparently, MSTest is run at the solution level, not the project level.  The easiest way out of the problem was to rename the test projects to match Before/After and leave them at the solution level.  Not the best, but it solved my problem in a pinch

UX that suck

I am not the most anal-retentive person, but I do appreciate web pages that are well-designed.  I also resent professional organizations that make web sites that are less well-designed than a typical 8th grade class project.  I recently experienced one that falls more into the later category.  I had to pay a medical bill so I went to the hospital’s on-line payment site and filled in the information:

image

notice that I selected June 31 as her birthday.  I then hit submit and I got this:

image

 

Basic input validation should be part of any site –especially one that deals with medical/financial transactions.  I didn’t try to do a sql injection attack, but if I was a betting man, I would bet that this site is vulnerable to that too…