Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletter Hub
Free Learning
Arrow right icon
timer SALE ENDS IN
0 Days
:
00 Hours
:
00 Minutes
:
00 Seconds

Development of Windows Mobile Applications (Part 1)

Save for later
  • 4 min read
  • 26 Oct 2009

article-image

Windows OS for Windows Mobile is available in various versions, but for this article we will be using Windows Mobile 6. Windows Mobile 6 uses .NET Compact Framework v2 SP2, and has 3 different versions:

  • Windows Mobile 6 Standard (phones without Touch Screen)
  • Windows Mobile 6 Professional (with Phone functionality)
  • Windows Mobile 6 Classic (without Phone functionality)

Windows Mobile 6.1 and Windows Mobile 6.5 are other 2 higher versions available with some additional features as compared to Windows Mobile 6. Windows Mobile 7 expected to be released in 2010 and is said to have major updates.

This article concentrates on development on Windows Mobile 6 Professional.

Software Prerequisite

This article will introduce you to the development for Windows Mobile 6 Professional, using Visual C#. Windows Mobile 6 has .NET Compact Framework v2 SP2 preinstalled. .NET Compact Framework is a Compact Edition of .NET Framework, and does not have all the features of the complete .NET Framework.

Following are the software required for development:

  1. Microsoft Visual Studio 2008
  2. Windows Mobile 6 Professional SDK Refresh (SDK contains emulator, used for testing, debugging. To download click here)
  3. ActiveSync (Used for Data Synchronizing between development machine and Windows Mobile, To download click here)

Without making any exception, we will follow the golden rule of learning by writing “Hello World” application.

Hello World

We will assume that you have installed all the prerequisite software mentioned above.

Launch Visual Studio 2008 and select Visual C# (if prompted). Create a new Project (File -> New) as shown below:

development-windows-mobile-applications-part-1-img-0

While creating a new Project, Visual Studio 2008 IDE provides an option to select an installed template, which will create Project with all the basic requirements/structure for development. For Windows Mobile, we will select option Smart Device and template Smart Device Project as shown below.  You can also provide:

  • Name: Name for Project. We will call it as MyFirstApp.
  • Location: Location where this project will be created. Browse and set the desired location. We will use default location for now.
  • Solution Name: Name for referring the Solution. Usually we keep it same as Project Name.

Since Windows Mobile 6 has .NET Compact Framework v2, it will select the .NET Framework 2.0 from the dropdown on the top right. Click OK.

development-windows-mobile-applications-part-1-img-1

Next step is to select the Target platform, .NET Compact Framework Version and Template. For our application we will select:

  • Target platform: Windows Mobile 6 Professional SDK
  • .NET Compact Framework Version: .NET Compact Framework Version 2.0.
  • Template: Device Application

development-windows-mobile-applications-part-1-img-2

Unlock access to the largest independent learning library in Tech for FREE!
Get unlimited access to 7500+ expert-authored eBooks and video courses covering every tech area you can think of.
Renews at $19.99/month. Cancel anytime

Project MyFirstApp is successfully created and IDE will open a Form as shown.

development-windows-mobile-applications-part-1-img-3

Let me introduce you to the various sections on screen.

  1. This is the main section called development section. All the coding and designing of the Form is done here.
  2. This section is called Toolbox and lists all the available components. If this section is not visible click View->Toolbox.
  3. This section is called Solution Explorer and shows all the forms, resources and properties. If this section is not visible click View->Solution Explorer.
  4. This section is Properties and displays all the properties for the component selected. If this section is not visible click View->Properties Window.

development-windows-mobile-applications-part-1-img-4

By default Form is named as Form1. Let us first change the Name of the form. To do so select the form and the properties related to form will be listed in properties window.

development-windows-mobile-applications-part-1-img-5

The entire properties list is in the form of Key Value pair. For changing Name of form, change value of property Name. For this example we will change it to HelloWorldForm. Now this form will be referred as HelloWorldForm throughout the application.

Changing form name doesn’t change form caption (title) it is still showing Form1. To change caption change the value of property name Text. For this example we will change the Text to Hello World.

development-windows-mobile-applications-part-1-img-6

Also the file representing this form in Solution Explorer will still be referred as Form1.cs, again you can either keep the name of the file as it is or can rename it. We will rename it to HelloWorld.cs.

development-windows-mobile-applications-part-1-img-7