... all I'm offering is the truth. Nothing more. RSS 2.0
# Wednesday, August 25, 2010

I have basically completed my first app for Windows Phone 7, I am poised to register it on the Marketplace. I am still gathering information about Windows Phone 7 as this is a new platform so there are still bits of critical information that are making its way into the developer community. I thought I would dedicate this post to the stream of information I have found over the last few weeks.

I also caught this video on Channel 9, and I started to feel a little guilty that I have never paid much attention to UI design or even UX over my career (I have left behind some cringe worth apps). I am really trying to assimilate the whole Metro theme (replicated in Xbox, Media Center, Zune and Media Room) and ensure my apps are balanced with the overall design concept. Happy design and coding!

Get Microsoft Silverlight

Wednesday, August 25, 2010 9:01:16 PM (Eastern Daylight Time, UTC-04:00)  #    Comments [2] - Trackback
Phones | Silverlight
# Saturday, August 21, 2010

This post is really just a design addendum to my previous post, an opportunity to revisit and redress the solution I presented for the problem of converting GPS data directly into US based Zip Code and while technically correct, I really did spend much time discussing or considering the the nature and architecture of the Windows Phone. In fact part of my solution would lead directly to poor phone performance, and so I wanted to take a couple of moments and discuss one of the fundamental differences in the approach of using and consuming services for WP7.

Lets consider the archetypal example where a button calls a service and that service returns some simple result. There are several ways to accomplish this using the WP7, however, you are guided toward a “pit of success” by being subtlety pushed toward the event driven model. In the traditional service call model you make a call and literally wait for the service to return some kind of result.

Waiting for the service to return the result with a potentially unreliable internet connection could lead to long wait times which in turn could produce a very inconsistent and unresponsive UI experience. Also note that this version of WP is a single threaded environment (it may change in the future) so we cannot offload this work to some background thread. What we can do is some simple event driven programming (you remember “call backs” from back in the day single proc PC days, same concept) which would look like this:

private void StartLocationButton_Click(object sender, RoutedEventArgs e)
{
  // The watcher variable was previously declared as type GeoCoordinateWatcher. 
  if (watcher == null)
  {
    watcher = new GeoCoordinateWatcher(GeoPositionAccuracy.High); // Use high accuracy.
    watcher.MovementThreshold = 20; // Plus or Minus 20m, helps ignore noise in the signal.
    watcher.StatusChanged += new EventHandler<GeoPositionStatusChangedEventArgs>(watcher_StatusChanged); //Define delegate
  }
  watcher.Start();
}
void watcher_StatusChanged(object sender, GeoPositionStatusChangedEventArgs e)
{
  Dispatcher.BeginInvoke(() => MyStatusChanged(e)); //Call BeginInvoke as discussed below…
}
void MyStatusChanged(GeoPositionStatusChangedEventArgs e)
{
  if (e.Status == GeoPositionStatus.Ready)
      // Use the Position property of the GeoCoordinateWatcher object to get the current location.
      GeoCoordinate co = watcher.Position.Location;
      LatitudeTextBlock.Text = e.Position.Location.Latitude.ToString("0.000");
      LongitudeTextBlock.Text = e.Position.Location.Longitude.ToString("0.000");
      //Stop the Location Service to conserve battery power.
      watcher.Stop();
  }
}

For those of us coming from the Web world there is a subtle “hoop” that is easily forgotten that is critical to Windows GUI programming i.e. only the thread that created a control can subsequently access and/or modify its contents (there are a couple of exceptions). Any attempts to update controls from other threads will result in unpredictable behavior and downright weird UI results. Whenever you need to update a control from a thread that did not initially create it, you need to wrap the call within a BeginInvoke call as show above (see Line 14).

 

Related Posts:

Saturday, August 21, 2010 12:26:11 PM (Eastern Daylight Time, UTC-04:00)  #    Comments [0] - Trackback
C# | Phones
# Monday, March 15, 2010

At the MIX ‘10 Keynote Scott Guthrie announced that you can immediately the Windows Phone Developer Tools at http://developer.windowsphone.com. They are free, and will be “free forever”! It includes the following:

  • Visual Studio 2010 Express for Windows Phone
  • Windows Phone 7 Series Add-in for Visual Studio, for developers already working with Visual Studio 2010 RC1.
  • Windows Phone 7 Series emulator.
  • XNA Game Studio 4.0

Happy coding!

Technorati Tags:
Monday, March 15, 2010 1:58:55 PM (Eastern Standard Time, UTC-05:00)  #    Comments [0] - Trackback
Phones | Programming
# Tuesday, October 21, 2008

I have been waiting for a while for the Windows Mobile 6.1 upgrade for the HTC Touch (Alltel), and finally HTC (Alltel and Microsoft) have released a 6.1 ROM upgrade.

The main problem with the mobile companies is that they all have slightly different implementations of Windows Mobile (WM) 6.1 based on the individual carrier requirements, as a result you cannot blindly update your phone with an off the shelf version of WM.

HTC and Alltel appear to have been very quiet about the upgrade, and I found out about its release by accident, to further the confusion it appears that the 6.0 upgrade will only be available for free until October 31st, a mere 3 weeks after 6.1 became available … very strange.

Tuesday, October 21, 2008 10:54:00 PM (Eastern Daylight Time, UTC-04:00)  #    Comments [0] - Trackback
Phones
# Wednesday, August 06, 2008

My Alltel contract finally allowed me to start looking at alternative phones and I settled on the HTC Touch. So far it is a very good phone, I now potentially have access to Email, IM and Web browsing whenever I chose. The touch screen interface is really easy to configure and use, and I have had no real issue writing brief texts to people. In fact I am already faster using the 'XT9' (Touch Keypad) than I was using my previous phone of 2 years. While I cannot imagine wanting to write a full email, for IM and text this phone is more than adequate.

images My wife and I have successfully ported our contacts to our new phones, I am aware there are several services that can do this, but I opted to simply import everything into the Live service cloud (using Windows Live Mail) and then logging into Live Messenger brings the contacts to the phone. I am not sure I will need to complete any Active Sync at all as I have a data plan that makes pulling down updates to contacts and calendars a breeze.

My main complaint is an echo of the oft repeated issue with Windows Mobile, once you get into core Windows Mobile setup it is not really geared to a Touch screen with the fingers, and you are subsequently forced to get out the stylus. Thankfully that is not something I have to worry all the time.


Overall I feel I have been introduced to a new world of freedom from the desktop\laptop. I have always opted to bring my laptop with me for overnight trips now I feel much more comfortable just taking my phone! My next step is to find and maybe even write a cool application for the WM6. I am really interested in knowing what is going on in the Apple universe.

Technorati tags: ,

Wednesday, August 06, 2008 5:41:17 PM (Eastern Daylight Time, UTC-04:00)  #    Comments [0] - Trackback
Phones
# Wednesday, April 02, 2008

I am taking a much more active look at the mobile\smart phone scene. I have been very happy with the quality of service provided by Alltel, however, I purchased the cheapest phone  I could at the time (text is painful, no camera, no IM, no blue tooth) and so I am way behind the technology curve. Our contract is up soon and we are eager to get a much better phone. I am eyeing the HTC Touch which seems to provide all the cool things I need with the exception of WiFi, apparently they dropped WiFi when they converted it from a GSM to CDMA model ;(

image

As this is a Windows Mobile Device I should be able to upgrade to the newest version (6.1) which was announced officially today. The main update that I am interested in seeing is the full Silverlight support which I saw a brief demo of during this years Mix.

According to the press release Microsoft has updated IE Mobile to support Adobe's Flash and H.264 streaming, which will make it possible for Windows Mobile devices to act more like regular browsers (iPhone nailed this concept out the gates). WM 6.1 will also make it easier to view full screen Web pages.

Technorati tags:
Wednesday, April 02, 2008 4:05:24 AM (Eastern Standard Time, UTC-05:00)  #    Comments [0] - Trackback
Phones | Windows
# Friday, February 16, 2007

I noticed when I was back in England last year that everyone, I mean even the least technology savvy in my family, were touting phones with not only camera's but were also MP3 players. My phone did not even have 1 Mega pixel camera, theirs had 3. When I left for England the adverts for things like Chocolate were in full swing.

It shocked me that new mobile phones were adopted so quickly in England and apparently in Europe. This has a lot to do with the GSM (Global System for Mobile Communications) technical standard, which apparently the rest of the world adopted fairly readily. The US market has many standards (or more accurately does not have one) which is one reason why the iPhone (which uses GSM) will not be very pervasive in North America, but in the European continent is set to be a dominant player.

SMS is a part of everyone's life in England, while in the US this appears to be restricted to the young and the technically aware. In England literally everyone and their mother was texting everyone else. This is due to the low cost associated with one common standard, even across borders of countries. As a result paying bills, bidding on auctions and even gambling can be enjoyed via SMS.

Of course other market factors come into play, for example, the PC has significant penetration in the US and so this along with the pervasive Internet connections served to reduced the need for some of the advanced phone features available throughout Europe and Asia. Some are predicting that the cell phone is set to challenge Visa and MasterCard for payment dominance across the world, but as long as the US continues to support multiple standards this will remain difficult.

"Temptation is the fire that brings up the scum of the heart." - William Shakespeare

Technorati tags: , , ,
Friday, February 16, 2007 5:26:57 PM (Eastern Standard Time, UTC-05:00)  #    Comments [0] - Trackback
Phones
Blogroll
Statistics
Total Posts: 334
This Year: 22
This Month: 0
This Week: 0
Comments: 32
About the author/Disclaimer

Disclaimer
The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.

© Copyright 2010
Mark Downie
Sign In
All Content © 2010, Mark Downie
DasBlog theme 'Business' created by Christoph De Baene (delarou)