Archive for the ‘Windows Mobile’ Category.

Getting ready for the 'Race to Market Challenge'

I am really excited about The Race to Market Challenge, sponsored by the Windows Mobile team.  Nothing motivates me like a challenge that promises great prizes and glory – especially when the prize is a Microsoft Surface!

image

If that’s not enough to get you pumped up about developing a killer application, what will?

I’ve decided to build a mobile application myself (two, actually), and consequently needed to make sure that I had my development environment setup appropriately.  There are quite a few steps required in order to prepare your machine for Windows Mobile development, but it’s not too bad.

I am running Windows 7 RTM 64 bit with Visual Studio 2008 Team Suite.  Your mileage may vary if you’re running a different O/S or version of Visual Studio.  That said, I strongly recommend you upgrade to Windows 7 and insist on Team Suite – there are no substitutes for good tools.

Here are the steps I took in order to setup my machine:

  1. Download and install Microsoft Windows Mobile Device Center 6.1 Driver for Windows Vista (64-bit).  At the moment it doesn’t appear as if there’s a specific version for Windows 7.  This Windows Vista version seems to work just fine.
  2. Download the Windows Mobile 6 SDKs and 6.5 tool kit.  Be sure and note the different terminology for the different phones – evidently there are distinctions between Windows Mobile Standard (previously Windows Mobile for Smartphone) and Windows Mobile Professional (previously Windows Mobile for Pocket PC).�
  3. I also wanted to install the Mobile Applications Blocks from patterns & practices.
  4. I am also a big fan of reference applications, and using them to evaluate best practices when developing on a new platform.  Consequently, I wanted to get the following two solution accelerators for Windows Mobile.

A lengthy process, but not too difficult.

Once I completed the setup, I wanted to confirm that I could actually build and emulate an application.  I decided to do this very quickly by creating a “Hello Windows Mobile!” application and deploy to one of the Windows Mobile 6.5 emulators.

Here are the steps I took:

  1. You need to start a device emulator so that you have something to which you can deploy the application.  Run the Device Emulator Manager by selecting Start -> All Programs -> Windows Mobile 6 SDK -> Tools -> Device Emulator Manager.
    • I Create a new smart device project.  This will create a new project and give you a blank windows mobile form.
    • Open up Visual Studio, and click File -> New -> Project.
    • Select Visual C# -> Smart Device -> Smart Device Project.  Name it whatever you like.
    • From the New Smart Device Project screen select “Windows Mobile 6 Professional SDK” for your target platform and choose “Device Application”.
  2. From the Toolbox, drag a Label control onto the form and change the text to “Hello Windows Mobile!”
  3. Debug the project by clicking F5 (or Debug -> Start Debugging).
    • You will be prompted to choose an emulator.  I chose the USA Windows Mobile 6.5 Professional VGA Emulator under Datastore -> Windows Mobile 6 Professional SDK.
    • Here’s what it looks like – very cool:

      image

    • After a few moments, your applications will get deployed to the device.  It may take a few minutes the first time as all the necessary pieces are deployed.  Once it has finished, you should see your application deployed.  It will look like this:

      image

  4. When you close the emulator, go ahead and have it save the state.  This will speed things up when you go to deploy the next time.

In the end, it’s really exciting to have a fully functional development environment that can target all the Windows Mobile 6.X platforms.  Lots of potential for building applications that have a huge install base!

I really hope that you found this useful.  I strongly encourage you to sign up for the Race to Market Challenge and start building some great applications.

Configuring and Testing a Windows Mobile 5.0 Development Environment

So, I’ve finally joined the 21st century, and purchased a Samsung Blackjack.  After waiting a two agonizing days, it finally arrived.  Man, it’s a beauty!

Samsung Blackjack

I’ll spare you a review of all it’s features (this is covered in agonizing detail elsewhere), but there are a couple tidbits I’d like to share.

The Blackjack runs Windows Mobile 5.0 with the Messaging and Security Feature Pack.  One of the neatest features that this supports is Exchange ActiveSync w/ Direct Push Technology.  Fortunately, the company I work for has Exchange 2007 setup to push emails directly to smart phones, and this was the first thing I setup.  Worked like a charm!  Very easy.

Note: I know that Windows Mobile 6.0 is out.  If you have an application that runs Windows Mobile 6.0, then good for you!  Unfortunately, the Blackjack is still on 5.0, which is why this post is geared towards 5.0.

The second thing I looked into was how to setup a development environment that allows me to develop applications that I can deploy and run on my Blackjack.  Turns out, it’s pretty simple.

My searches lead me to the Windows Mobile 5.0 Developer Resource Kit.  This kit contains (almost) everything you need to develop Windows Mobile 5.0 applications for a SmartPhone and Pocket PC.  I suggest you review the details surrounding the resource kit, and then download it and try it yourself.

As I said, my goal here is to setup a development environment and deploy a simple application to my Blackjack.  In order to consider this a successful test, I don’t need the application to actually do anything except run.  Here are the steps I took.

Note: while this is written specifically for the Blackjack, the following steps will (largely) work for any kind of SmartPhone running Windows Mobile 5.0.

  1. Install all the prerequisites.  I already had all the required prerequisites installed (e.g. Visual Studio 2005 and ActiveSync).  I haven’t yet tried any of the optional installations.
  2. Download the Windows Mobile 5.0 Developer Resource Kit.  This kit has everything you need to get going.
  3. Run the MSI and install the kit.
  4. Once the kit is installed, run the Windows Mobile 5.0 Developer Resource Kit application.  You can run this by clicking Start –> All Programs –> Windows Mobile 5.0 Developer Resource Kit –> Windows Mobile 5.0 Developer Resource Kit.
  5. Click Install the Developer Tools –> Install the Tools, and then in the detail pane slide down and click Windows Mobile 5.0 SDK for Smartphone (or Pocket PC, if you prefer).

    Windows Mobile 5.0 Developer Resource Kit

  6. This opens up File Explorer in the folder C:\Program Files\Windows Mobile 5.0 Developer Resource Kit\content\Developer Tools\Windows Mobile 5.0 SDKs\.  From here, click Windows Mobile 5.0 SDK for Smartphone.msi or Windows Mobile 5.0 SDK for Pocket PC.msi.
  7. Once the installation completes, Visual Studio will have been updated to include a new project type called “Windows Mobile 5.0 Smartphone” under “Visual Basic” and “Visual C#”.  Open Visual Studio 2005, and click File –> New –> Project.

    Windows Mobile 5.0 Smartphone project

  8. Select “Device Application” and click OK.  Yes, I know the name and location are poor.  Change them if you want; remember, this is just a quick test/demo.
  9. The project template includes a Form1.cs file.  The designer shows a form embedded in a phone shell.  Drop a label on the form that says something (e.g. “Hello world!”).

    image

  10. Make sure your Blackjack is connected to your computer via your USB cable, and confirm that ActiveSync is able to communicate and synchronize with your Blackjack.
  11. Samsung and Microsoft lock the Blackjack phone so that applications from unsigned publishers (like us!) will not run or deploy to the Blackjack phone.  In order to resolve this, take a look at these two discussions: Application Unlock Your Blackjack and Samsung Blackjack tips and tricks (the latter has some great tips).  I chose the method in the first link, and ran AppUnlock.cab.  Worked great.
  12. Go to Build –> Deploy DeviceApplication1.  A dialog box asks you where to deploy your application.  Choose Windows Mobile 5.0 Smartphone Device.  Click Deploy.

    Deploy Smartphone device

  13. The initial deployment will push a lot of CAB files used to run your .NET application.  Make sure you approve all these cabs from your Blackjack.  You will only have to do this the first time.
  14. Since our application was very simple, we’ll have to browse to the executable through the file explorer.  Click Start –> Applications –> File Explorer.  Browse to \Program Files\DeviceApplication1, and click DeviceApplication1.
  15. As we have not signed the application, you will have to confirm that you want to run the application (I’ll write a post some other time explaining how to sign the application).  Click Yes to continue.
  16. Lo and behold, our application runs and displays “Hello World!”.

Yes, a completely useless and standard example, but it does serve to highlight how easy it is to setup a development environment that can publish applications to your SmartPhone (e.g. your Blackjack).

Now all I need to do is figure out a useful tool to build …

I hope this helps!