iPhone to Windows Phone 7

i2WLogo2

This is the zeroth (introduction) in a series of Tutorials aimed at iPhone developers who want to learn how to port existing applications or create new applications in Windows Phone 7.

About these Tutorials

The series will consist of brief tutorials, with a focus on the minimum you need to know to add Windows Phone 7 development to your skill set.

Hardware and Software Requirements


WindowsPhone Hardware

For all practical purposes, your choices come down to using a PC or a Mac with Bootcamp and…

  • 3 GB of disk space
  • 2GB of RAM
  • A DirectX 10 capable graphics card with the WDDM 1.1 driver.
Note: you cannot run the Windows Phone 7 (WP7) Emulator under a virtual machine such as Parallels or Fusion

Software


  • Windows 7 http://bit.ly/w7Home or Windows Vista.  In either case, any edition and both 32bit and 64 bit are fine, but you cannot use the Starter Edition of either for WP7 development.
  • Windows Phone Developer Tools http://bit.ly/wp7Tools This one free download includes everything you’ll need once your Operating System is in place:
    • Visual Studio 2010 Express for Windows Phone Beta
    • Windows Phone Emulator Beta
    • Silverlight for Windows Phone Beta
    • Microsoft Expression Blend for Windows Phone Beta
    • XNA Game Studio 4.0 Beta

 

Update: the Windows Phone Developer Tools January 2011 Update is now available.



Note that there are numerous programs in which you can get Visual Studio 2010 (the full edition) and much more for no cost. Among these are the BizSpark, Dream Spark and WebSiteSpark

The Marketplace

To sell your WP7 applications through the Marketplace, you have only to register, which you can do at http://developer.windowsmobile.com.

Key Concerns

iPhone developers often express one or more of the following concerns with regard to adding Windows Phone 7 to their target platforms,

  • What about performance?
  • I’m a game programmer – I thought Silverlight wasn’t for games
  • MVC & MVVM
  • Objective C & C#
  • Coding for two platforms

What About Performance?

An incredible amount of work has been put into ensuring not only excellent performance, but smooth animation.  I will cover the dual threading that has been implemented, as well as performance tuning,  in one of the early tutorials, but the short version is that it is not rocket-science, and by and large you can and should ignore performance tuning until you complete your program.

I’m a game programmer – I thought Silverlight wasn’t for games

You certainly can write some games in Silverlight, but if you have a high performance game and/or want 3d or you have many assets to manage, you may well prefer to write your game using XNA. That’s fine, because WP7 programs can be written in either. And in any case, whichever you choose for a given application, you can still use classes from the other.  Here are some general guidelines to help with understanding the strengths of each of the two platforms (from the Windows Phone 7 Developer Portal).

Use Silverlight if… Use XNA if…
You want a XAML based, event driven application framework. You want a high performance game framework.
You want rapid creation of a Rich Internet Application-style user interface. You want rapid creation of multi-screen 2D and 3D games.
You want to use Windows Phone controls. You want to manage art assets such as models, meshes, sprites, textures, effects, terrains, or animations in the XNA Content Pipeline.
You want to play digital media.
You want to use an HTML web browser control.

MVC and MVVM

Patterns are key to both iPhone and WP7 development, and fortunately, the Model-View-ViewModel (MVVM) pattern is very closely related to MVC (the evolution was from Model-View-Controller to Model-View-Presenter (Fowler) to Model-View-ViewModel).  Again, I’ll devote an entire tutorial to this early in the series, but here’s a 1 minute overview.

In fact, the three core concepts of MVVM are virtually identical to those in MVC:

MVVMSketch

1 Separation of Concerns

Do not let the User Interface (View) affect your Business objects and behaviors (View Model), which in turn is abstracted away from your data objects (Model) and of course your persistence mechanism.

2 Don’t Look Up.

We tend to conceptualize the View (User Interface objects) at the top, the ViewModel (objects that provide the UI with its data and behaviors) in the middle and the model (often the persistence layer) at the bottom.  The View can know about the ViewModel, the ViewModel about the Model, and the Model, like the cheese, stands alone.

3 Implement through Binding – No user code in the View

In MVVM the mechanism for the ViewModel to provide data to the View, is for the View to set the ViewModel as its DataContext.  The details will follow in the tutorial on MVVM, but for now, take my word: this is wicked cool.

Why’d Ya’ Call It ViewModel??

I actually think there is some elegance in this name.  The ViewModel is the bridge between the Model and the View; and the ViewModel thus owns responsibility for binding the relevant data to the view and for handling user actions appropriately, whether the response is in the control, elsewhere in the View or in other parts of the application.  You can learn more about MVVM (if you can’t wait!) in my posting MVVM – It’s Not Kool-Aid

Objective C and C#

In addition to learning the frameworks, and becoming comfortable with Visual Studio (and perhaps Expression Blend), you will be making the jump from Objective C to C#.  Like Britain and the United States, these are two frameworks separated by a common language, as C# and Objective C are, arguably, nearly as alike (and nearly as different!) as British English and American English.

British American
Petrol Gas
Biscuit Cookie
Windscreen Windshield
And Bob’s Your Uncle And You’re Done
*myPointer = 5; myReference = 5;

I will point out the key differences between the languages as they come up, and will devote an early tutorial to exploring the differences in depth, especially where the same word is used in different ways.

Coding For Two Platforms

Here is the nub.  Is it worth it to put your application on both platforms?  A better way to ask is this: is the additional revenue and satisfaction higher than the  cost?  A good way to make the answer to this a resounding “yes” is to architect for multi-platform development, and we’ll devote at least two tutorials to that topic.  The short answer, of course is that by starting out with MVC/MVVM you are already much of the way there, as the “logic” and “data” of your two programs should be (nearly) identical.

Resources

The series outline will be available on my blog site, updated frequently as the series evolves.  In addition, the tutorials will point to material where you can find greater details, depth or source code.

i2w
The i2W triplet will be used in all areas when there might be confusion for iPhone developers in Windows Phone 7 syntax or idiom .

Next Tutorial

Share

About Jesse Liberty

Jesse Liberty is a Master Consultant for Falafel Software, and has three decades of experience writing and delivering software projects. He is the author of 2 dozen books and multiple Pluralsight courses, and has been a Technical Evangelist for Telerik and for Microsoft, a Distinguished Software Engineer for AT&T, a VP for Information Services for Citibank and a Software Architect for PBS.
This entry was posted in iPhoneToWP7, Mini-Tutorial, WindowsPhone and tagged , , . Bookmark the permalink.

21 Responses to iPhone to Windows Phone 7

  1. I have read so many posts concerning the blogger lovers however this post is genuinely a good post,
    keep it up.

  2. Pingback: Para desenvolvedores: Tutorial de como portar seu iPhone App para o Windows Phone 7

  3. Pingback: Para desenvolvedores: Tutorial de como portar seu iPhone App para o Windows Phone 7 – Windows Phone Brasil

  4. This is very attention-grabbing, You are a very professional blogger. I have joined your rss feed and stay up for in quest of more of your great post. Also, I’ve shared your website in my social networks

  5. Pingback: Para desenvolvedores: Tutorial de como portar seu iPhone App para o Windows Phone 7 | Windows Phone Blog Brasil

  6. Pingback: iPhone to WP7 | Silverlight, WPF & .NET

  7. Socal Sam says:

    @David
    Sorry, but as I understand the copyright rules in the US, phrases or words cannot be trademarked. The term “theminimumyouneedtoknow” is a commonly used phrase. For instance, I cannot trademark or copyright the phrase: “Pleasere-wordthispage”, it is a commonly used phrase.

  8. Pingback: iPhone Developers? How to move to Windows Phone 7 | I Love Windows Phone!

  9. Pingback: iPhone to Windows Phone 7 – Tutorials Series : wpseven

  10. Pingback: Bring your existing iOS apps to WP7 | Go Windows Go

  11. Pingback: Developers Port Your iPhone App to Windows Phone 7

  12. anonymous says:

    How lame, some tech guy trying to copyright/trademark a phrase that has been used for 20 years and there is plenty of “Prior Art” out ther to dispute his claimed trademark.. We’ll have to make sure the trademark office knows that this isn’t cool..

    Especially when you have a website like Jesse’s who doesn’t make money off of his site at all who is doing this as a free community resource. The link the person provided doesn’t even look professional (in my humble opinion), how uncredible..

  13. David says:

    seasoned_geek :Please re-word this page.

  14. Please re-word this page. “The Minimum You Need to Know” is a registered trademark of Logikal Solutions and you have not paid to use it. For more information visit http://www.theminimumyouneedtoknow.com.

  15. Boris says:

    Looking forward for more infos too, this sounds very interesting.

  16. Pingback: The Morning Brew - Chris Alcock » The Morning Brew #672

  17. Omar Farooque says:

    Looking forward for more in this series of blogs…

  18. Pingback: For Developers: Tutorial on porting iPhone apps to Windows Phone 7

  19. Sunny says:

    Thanks for this Jesse! This is a great series for beginner smart phone developer like your’s truly.

    Would it be possible to also show some tips & tricks across various performance & design considerations in these tutorials?

    Thanks for all the great work & article!

  20. Good idea for a blog series Jesse. You could also target both and reuse all your non-ui code via monotouch :)

Leave a Reply

Your email address will not be published.

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>