Windows 7 Phone development

First, just a quick update. I am half-way through the last week of school for this semester. I have one paper to finish and need to take a final and I’m DONE. So, during the winter break, I hope/plan to get back to a regular blog schedule.

Windows Phone – where do I start? First, I have used Windows Mobile for a long time. I did for a couple of reasons, one because Microsoft has earned enough credit with me that I want to give them the benefit of the doubt. Secondly, because it’s traditionally been pretty easy to create phone applications for Windows Mobile. So, I would dabble and write little goofy apps for my phone.

After having one after another crappy phone, I finally snapped earlier in the year. Microsoft was just not getting it – like, on every facet of the mobile phone. They were heavy, super-expensive, tiny screens, you had to use a stylus and not your finger, short battery life, etc. Once I saw the Motorola DROIDX, I was blown away. In fact, I still cannot say enough good things about the DROIDX – it’s such a great phone, for so many reasons!

OK meanwhile, like 2 months later Microsoft unveiled their entirely new mobile platform. Ugh. Well, I just checked it out and dangit, it is a pretty good platform.

If you are a .NET developer, this is a no-brainer. You can use 100% of what you know now, and build an app in seconds, it’s so easy! Here’s what you do:

  • Go to: http://msdn.microsoft.com/
  • Click on “Phone” in the top navigation
  • Optionally watch those two movies – then click “Install”

This will install the XNA Studio and the Windows Phone components for Visual Studio 2010 (which you should already have installed). Once installed, open Visual Studio 2010, click File –> New Project and choose “Silverlight for Windows Phone” category, and “Windows Phone Application.

Ok, so where do you start? Well, here’s what I did. I added some buttons on the screen, and then tied them to various “Tasks”. There are several built-in tasks that all have a familiar style. You can do things like bring up a phone dialer, a browser, the camera, do a search, etc. For example, here’s what the app looks like in the emulator:

image

Each one does about what you might think. For example, Dial:

image

create a text message:

image

search:

image

browser:

image

To do this, all I did was create some buttons, then double-click the button to wire up the Click event:

    private void dialButton_Click(object sender, RoutedEventArgs e)

    {

        PhoneCallTask phoneCall = new PhoneCallTask();

        phoneCall.DisplayName = "Jenny";

        phoneCall.PhoneNumber = "867-5309";

        phoneCall.Show();

    }

 

    private void searchButton_Click(object sender, RoutedEventArgs e)

    {

        SearchTask search = new SearchTask();

        search.SearchQuery = "Cool stuff";

        search.Show();

    }

 

    private void textButton_Click(object sender, RoutedEventArgs e)

    {

        SmsComposeTask textMessage = new SmsComposeTask();

        textMessage.To = "867-5309";

        textMessage.Body = "Hey there, this is a text message.";

        textMessage.Show();

    }

 

So as you can see, all of these are based on various “Tasks” in the Microsoft.Phone.Tasks namespace. There are some clever implementations too. For example, let’s say you wanted to get a picture of the users face. You can open the camera, and when they “Accept” the picture they like, you can bring that picture into your app. For example:

    private void cameraButton_Click(object sender, RoutedEventArgs e)

    {

        CameraCaptureTask camera = new CameraCaptureTask();

        camera.Completed += new EventHandler<PhotoResult>(camera_Completed);

        camera.Show();

    }

 

    void camera_Completed(object sender, PhotoResult e)

    {

        if (e.TaskResult == TaskResult.OK)

        {

            //TODO: So something with e.ChosenPhoto

        }

    }

 

So what’s the bottom line? Well, if you were on the fence up until now, and still have an old-school phone – you have some fantastic alternatives:

  • iPhone – the first one to starting gate, but expensive and they didn’t have the benefit of learning from others mistakes yet. Apps are written in Objective-C – but then again, if you know the language, it’s not a big leap to go between development for: Mac OS, iPhone, and iPad.
  • Android – learned from iPhone mistakes and made a tremendous platform. Development is limited to Java and C. Bleh.
  • Blackberry – I don’t know what will become of them. They filled a niche at the perfect time. But in this new age of multi-touch, big screens, Blackberry feels very proprietary and limited in comparison.
  • Windows Phone – for .NET developers, it’s a no-brainer. Development is just “more of the same” of what you already know. It’s not a big deal to offer your apps/games/etc on XBox Marketplace (register for that, here).

If I didn’t get the DROIDX and I was in the market for a new phone, I’d strongly consider the Windows Phone. It’s a very nice interface, it’s easy to do app development, but I don’t like how it was THIS late to the game. It makes me question what other really poor decisions are being made behind the scenes!?

Posted in Mobile, Uncategorized
One comment on “Windows 7 Phone development
  1. […] fact, I did a blog post about how easy WP7 development is, with screenshots of the emulator. Painless! And although the WP7 gets high marks from everyone, it […]

    Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Archives
Categories

Enter your email address to follow this blog and receive notifications of new posts by email.

Join 2 other followers

%d bloggers like this: