Using Social Networks to Build Reusable Architecture for the Windows Phone 7 – Part I

7. February 2011

This is the first installment of a several part series/journey to use social network resources for Windows Phone 7 development and produce a reusable code base.

Social networking resources used here include Twitter, Reddit, Microsoft Windows Phone developer community resources, and developer blogs.  A lot of useful information is shared by the people developing for the Windows Phone 7 platform on their personal blogs.

There are a couple of reasons for writing this and doing this work.  First it is to produce a template based on many public sources that can be reused for Silverlight Windows Phone 7 applications.  This isn’t intended to be a “hello world” template but instead it will be a fairly robust model.  It will use some solid patterns and it will contain several maintainable libraries.  In fact there will be a solution with several reusable projects.  The other goal is to talk about another way to answer the question, “Where do I start learning about Windows Phone 7 development?”

The main starting point that you need to go to is the APP HUB for Windows Phone and Xbox 360.  Here you will find formal documentation, tools, samples, forums, community, and much more.  If you are a beginner, read through the content on getting started and follow the guidance on installing latest tools.  There will be updates to the development tools so check back there frequently.  You must also read the series by Andrea Boschin about Getting Started with Windows Phone 7.  His series goes deep into basic features that you should be aware of.  This series focuses more on structure and architecture and does assume an intermediate understanding of the Windows Phone 7 platform.

 

Twitter and Reddit.com

A great way to find up the the minute and current resources is to search for the hash tag #wp7dev on Twitter.  You don’t even need a Twitter account for this!  Here is a screen shot of results as of this writing:

image

Scan through the results and you start to see trends about current releases, tool updates, and interesting blog postings.  When Windows Phone 7 developer tools went public there were a few product announcements from the phone team on the hash tag.  Now everyone seems to be tweeting about their applications, news about the phone platform, re-tweeting, and having other conversations around the topic.  Starting at the top of this search and working backwards is a good way to find very useful and up to date resources.  It’s important to filter out the noise (no offense intended) and find a tweet that either is the source of a topic or is very close to the source. 

This sort of filter and scanning process will uncover tweets from people who are one re-tweet away from a direct source.  Such as @gcaughey.  This is the Twitter account of Ginny Caughey who is a Windows Phone Development MVP.  It turns out that she is one of the most enthusiastic people about Windows Phone 7.  Her tweets and re-tweets are an invaluable resource for finding great information about WP7.

Let’s look at another source.  Reddit.com has an incredibly rich source of information about WP7DEV.  The link is http://www.reddit.com/search?q=wp7dev.  Click over there now to see the latest entries.

image

 

New Phone Project and Solution

Ok, now with the latest free developer tools installed on your PC (from here), it’s time to open up a new project.  Visual Studio 2010 Express Edition for Windows Phone and Microsoft Expression Blend 4 for Windows Phone includes the majority of what you need to write applications for the Windows Phone Marketplace.  While this series won’t go into designing a phone application, it is worth noting that you may want to use some image tools.  Paint.Net in my experience is good enough to create all the image work you need for Silverlight applications (not XNA) and it is free.

Choose the default empty project template, or “Windows Phone Application” as seen below.

image

 

Solution Folder (or Project)

Solution folders are very useful in keeping everything you need for the source code to run, in one place.  There is a way using this free version of Visual Studio to include such a folder.  Solution folder are not supported in Visual Studio Express 2010 or Blend 4 for Windows Phone.  One way to do have something like them, however, is to include an empty project, remove all references, and change its build action such that it doesn’t build in any configuration.  Then you can create all the folders and subfolders that you wish with your dependencies and documentation in them.  This is not being recommended as a best practice.  It does work for the purposes of this solution.  If source control is added to your process having all the files needed for an application somewhere in the folder tree will make the development process better.  Source control solutions are out of scope for this series.  It is worth keeping things organized so it can be added, however.

image

To disable any builds for the empty project, right click on the Solution Explorer tree root and enter the Configuration Manager.

image

If you used the project template pictured above it will not appear in the list of projects that build.  Under any configuration.

image 

 

Helpers and Controls

Already, there is more than one project in the solution.  It’s time to add two more Windows Phone Class Library projects to the solution.  Right click on the solution root in Solution Explorer and choose the Windows Phone Class Library template as seen below.  Name one project “WindowsPhone.Helpers” and the other one “WindowsPhone.Controls”.

image

WindowsPhone.Helpers will contain things like Value Converters, Extension Methods, Actions, Behaviors,and other reusable code.  WindowsPhone.Controls will contain custom controls that are not part of a control toolkit and styles for those controls.  Right away this splits out a bunch of maintenance tasks into reusable parts.  These projects can be copied into a new solution easily.

 

Summary

This first post was a walkthrough to create a base solution with 4 projects in it.  While social network code resources were introduced, not much was done yet with the information.  In the next part we locate useful source code and add more projects, some patterns, and start writing code.

 

Source Code

Code, Silverlight, WP7

Comments

6/15/2011 10:54:27 PM #
Building Blocks for Designer Friendly Windows Phone Code

Building Blocks for Designer Friendly Windows Phone Code
Comments are closed