Mobile development

Top  Previous  Next

This Quick Start section guides you through the steps of creating your first mobile application. At the beginning every of the following sections there is a checkbox list that you can get through if you don't want to read the entire section.

Requirements

Install Guineu
Install the Compact Framework

 

Mobile development requires one more step over desktop development with Guineu. You have to install the Microsoft.NET Compact Framework on your development machine. Since Guineu compiles against mobile libraries Guineu needs them during compilation.

 

If you have the Compact Framework on your machine, you should have the following directory:

 

C:\Program Files\Microsoft.NET\SDK\CompactFramework\v2.0\WindowsCE

 

The name of the program files directory might be different on your machine depending on the operating system language. If you don’t have the directory, download the Compact Framework from

 

http://www.microsoft.com/downloads/details.aspx?familyid=AEA55F2F-07B5-4A8C-8A44-B4E1B196D5C0

 

Install it following the instructions on the screen. While it is possible to write PRGs, compile them and copy them onto a mobile device, this is likely not how you want to develop your applications.

Installing and configuring the device emulator

Install the device emulator
Configure the emulator
Install the .NET Compact Framework

 

After you created an EXE you can copy it onto your mobile device to test it. However, Microsoft’s Device Emulator makes this task much easier. There are two ways to get the Microsoft Device Emulator on your computer.

 

The Device Emulator is already installed on your machine if you have Visual Studio 2005 Standard or higher, or if you have Visual Studio 2008 Professional and higher, then. You can use the Microsoft Download page to obtain updates and new operating system images.

 

If you don’t have Visual Studio, you can still install the Device Emulator. However, it’s not as straight forward and you have fewer choices of operating system images.

 

Step 1

If you don’t happen to have the Virtual Machine Network Driver for Microsoft Device Emulator installed on your machine, you need to install Microsoft Virtual PC 2007:

 

http://go.microsoft.com/fwlink/?linkid=46859

 

You can install Virtual PC 2007 inside a VMWare Workstation instance, but most likely you cannot install Virtual PC inside Virtual PC.

 

Step 2

Download the Microsoft Device Emulator 3.0 Standalone release

 

http://www.microsoft.com/downloads/details.aspx?familyid=A6F6ADAF-12E3-4B2F-A394-356E2C2FB114

 

Step 3

Install the Device Emulator by executing vs_emulator.exe and following the setup instructions. The setup doesn’t create a short cut to the emulator. When you want one on your desktop or in the program menu, open the folder

 

C:\Program Files\Microsoft Device Emulator\1.0

 

And create a shortcut to dvcemumanager.exe. Don’t worry about the version number in the directory name. Microsoft hasn’t changed the number in the past three versions, nor do they install multiple device managers.

 

Step 4

For Windows Mobile 5.0:

 

Download the Microsoft Windows Mobile 5.0 image for Device Emulator. You need to download EFP.MSI (57.0 MB) from the following web site

 

http://www.microsoft.com/downloads/details.aspx?FamilyId=C62D54A5-183A-4A1E-A7E2-CC500ED1F19A

 

For Windows Mobile 6.1:

 

Download the Windows Mobile 6.1 Emulator Images. You can choose either the Professional version (with touch screen) or the Standard edition (without touch screen):

 

http://www.microsoft.com/downloads/details.aspx?familyid=3D6F581E-C093-4B15-AB0CA2CE5BFFDB47

 

Step 5

For Windows Mobile 5.0:

 

Execute the EFP.MSI setup. When you are done, you can run the emulated devices from Start > All Programs > Microsoft Windows Mobile 5.0 MSFP Emulator Images. The first time you have to pick one of the Coldboot files.

 

For Windows Mobile 6.1:

 

Execute the Windows Mobile 6.1 Professional Images (USA).MSI setup. The 6.1 setup does not properly create links to the emulator images. If you don’t see Start > All Programs > Windows Mobile 6 SDK > Standalone Emulator Images > US English, then run the setup a second time. Choose the repair option and ignore any error message you might get. If this still doesn’t work, call DeviceEmulator.EXE passing the full path and name of the bin files located in

 

C:\Program Files\Windows Mobile 6 SDK\PocketPC\DeviceemulationV610\0409

 

The name of the program folder can be different on non-English versions of Windows.

 

Step 6

Run the emulator with one of the images. Use File > Configure… to change the configuration of your simulated PDA. Foremost you want to specify your development directory as a Shared Folder. This maps the folder as a Storage Card on your PDA.

 

Step 7

Windows Mobile 5.0 ships with the .NET Compact Framework 1.1 preinstalled. For Guineu, however, you need the .NET CF 2.0 version. Open the following folder

 

C:\Program Files\Microsoft.NET\SDK\CompactFramework\v2.0\WindowsCE\wce500\armv4i

 

The name for program files might depend on your operating system’s language. Copy the file

 

armv4i\NETCFv2.wm.armv4i.cab

 

into the directory that you specified in step 6 as your simulated storage card. On your simulated PDA open Start > Programs > File Explorer. Tap on the storage card symbol. You should see the file you just copied there on the desktop machine. Tap on the setup and follow the instructions.

 

On Windows Mobile 6.1Microsoft has preinstalled .NET CF 2.0. You can skip step 7.

 

Step 8

To verify that the setup worked, use File Explorer to locate \Windows and tap on cgacutil.exe. You should receive a message box stating the version that you have installed on your machine.

 

Step 9

Use GuineuIDE to compile your project into a Windows Mobile application. For testing purposes you can use the Vocabulary.pjx file that is located in the Vocabulary folder of your Guineu folder. Activate the project and select Guineu > Build > Windows Mobile Application. You should end up with an EXE file in the project folder that has the same name as the PJX file. In this case it would be Vocabulary.EXE.

 

Step 10

Open the Storage Card in File Explorer on the PDA. Locate your project directory and click on the application. You can tell the application from the little icon in front of it as file extensions are hidden on the PDA.

 

When you close the emulator you are given the choice of saving the state. This produces a DESS file in the Device Emulator directory. By default for Windows Mobile 5.0 the image is stored in “C:\Program Files\Microsoft Windows Mobile 5.0 MSFP Emulator Images”. On Windows Mobile 6.0 the DESS file is located in

 

You can copy the DESS file into your project folder and name it like the project. If the project is Sample.PJX, name the DESS file Sample.DESS. When GuineuIDE detects a DESS file with the same name as the PJX file, it automatically opens Device Emulator with this Stored State file.

 

Assuming that you configured the Shared Folder to be your project directory, this allows you to quickly debug your application on the PDA. DBF files can be opened in VFP and on the PDA at the same time. Only when you build a new Windows Mobile EXE, you need to terminate the EXE on the PDA. You don’t have to shut down the Device Emulator, though.

How to continue

This section only provided a brief walk-through of creating a simplistic application. If you are interested in developing for Windows Mobile, make sure you read the section on mobile development.