Creating a simple mobile application – Article by John


Introduction:

Developing mobile applications has never been easier than before. With the advent of Microsoft’s .NET technology, we are given a choice of language to use that we are familiar with. One of the most fascinating and powerful language is C#. Unlike C++ which is designed to be a low-level platform-neutral object oriented language, C# was designed to be a somewhat higher-level component-oriented language.

So are we ready? Let’s get started.

My First Mobile Application:

To begin, we will be using Visual Studio .NET for this project. On the “New Project” window, choose Smart Device Application. See Figure 1.0

Once chosen, the Smart Device Application Wizard will appear. For this project we will be selecting Pocket PC as our target platform while our type of project will be a windows application.

Figure 1.1

Once we have chosen our options on the “Smart Device Application Wizard”, we’ll notice that the form displayed is somewhat smaller (246 x 302 pixels) than that of the usual windows form. For obvious reasons, mobile devices has a smaller screen than those of the desktop and notebook PC’s. See Figure 1.2

Figure 1.2

Now let’s put in some controls in our form.

First, let’s drag a label control and set its size to 216 x152 pixels (See Figure 1.3). For a final touch let us put in a button control on our form (See Figure 1.4).

Figure 1.3 Figure 1.4

Putting on the finishing touches:

Let’s put in the finishing touches to our form.

Figure 1.6

Select our form, Click on “View Code” in the Solution Explorer (see figure 1.6).

On our codes, let’s set the text properties of our two controls (see figure 1.7).

Figure 1.7

public Form1()
{
//
// Required for Windows Form Designer support
//

InitializeComponent();

//
// TODO: Add any constructor code after InitializeComponent call
//

this.label1.Text = “This is my first .NET mobile application”;
this.button1.Text = “OK”;
}

That’s it! We are ready to go and test our application. Press F5 to compile and see it run on Visual Studio’s emulator.

By John Vincent Mombay