Mobile/PocketPC Development Jump Start
The objective of this short hands-on tutorial (lab) is to show you how simple it is to start developing for the PocketPC and other mobile devices using Visual Studio .NET 2003. No mobile development experience or mobile devices are needed!
Start up Visual Studio .NET 2003. Create a new project by selecting File | New | Project.... Select the Visual C# Projects node and then, on the right, select Smart Device Application as shown in Figure 1.
I've named my sample MyMobileApp and have saved it in the default location. You can name your mobile applications anything you like. For this lab, however, you should use MyMobileApp.
Selecting OK on the dialog will actually start a Wizard. You will be greeted with a dialog as shown in Figure 2.
This dialog allows you to select whether you are creating an application for the PocketPC or for Windows CE. You also can select the type of application. For this lab, you will target a Pocket PC and build a Windows Application.
You also will see that this dialog lists the devices that you have installed on you machine. As you can see, I have a Pocket PC device as well as the emulator. If you don't have a device, you will still be able to build an application with the emulator—which is what you will do for this lab.
Select Pocket PC and Windows Application. Click the OK button. Visual Studio .NET 2003 will chug and churn and create the standard project for you as shown in Figure 3.
As you can see in Figure 3, the basic PocketPC form looks like a normal Windows Form application. From a development perspective, it is pretty much the same. The only difference is that there are some controls and commands that you cannot use. Additionally, you'll see that a menu item is already provided on your workspace.
Building the Form Application
I have a standard, simple application I build as my "hello world" application when I use a new IDE, platform, or programming language. This is a simple application that includes a button, a text box, and a label. Clicking the button copies the text from the text box and appends it to the label. While this is not a practical application, it contains the basics of building a standard forms-based application.
Start by changing some of the properties for your application. Click on the form to display the form properties. Change the name to MyMobileAppForm. Change the text to "My Mobile App".
Just as you would in a normal Windows form application, add a Label, TextBox, and Button to your form. For this lab, you can leave the default names for the textbox and label. Rename the button by changing the Text property to "Do It". Your form should now look something like Figure 4 (note that the entire IDE is not shown).
Figure 4: Your application form