Creating CF Applications and Integrating a Smart Device Emulator with Delphi
If you are a Delphi developer interested in developing applications for Smart Devices, here is some good news. It's gotten easier thanks to Delphi 2006 and the .NET Compact Framework. Keep reading to find out more.
Creating CF Applications and Integrating a Smart Device Emulator with Delphi (Page 1 of 4 )
Delphi 2006 (Borland Developer Studio 2006) can now be used to develop applications that run on mobile devices with .NET Compact Framework support. In the previous version of Delphi, Borland had introduced a separate .Net Compact Framework compiler to compile CF applications from the command line, but with Delphi 2006 you can compile them from within the IDE itself. However, you have to make sure that the correct search path is included in the environment options. Click on Project|Options from the main menu and in the Directories/Conditionals page verify that the path points to the location that contains CF assemblies.
If you made a standard installation then it is likely that the CF assemblies have been installed in "C:\Program Files\Borland\BDS\4.0\lib\cf" so you need to add this path to the search path of the project. Once the environment has been set to point to the CF assemblies, our focus shifts to the type of applications that can be created with Compact Framework support. The .NET Compact Framework is nothing but a more compact implementation of the Microsoft .NET Framework for PCs. This makes it more suited for mobile devices and helps it to provide support for rich and powerful application development.
It should be noted that the .NET Compact Framework does not support all classes and methods that are supported by the PC version of the .NET Framework. I assume it is called Compact Framework precisely for that reason. It would be very inconvenient to deploy the application on the device itself after every minor modification. This is where an emulator comes in.
An emulator is a program (or a device) that pretends to be another program or device and makes the computer treat it as one. A mobile emulator would make the computer think it is interacting with a mobile device when in reality it is interacting with just another program. But how do we go about setting up a mobile emulator? Before we start building our first Compact Framework application let us first configure a Smart Device Emulator to test our application after every build. I am told that Windows Mobile Emulator is integrated with some editions of Microsoft Visual Studio IDE; can we integrate it with the Delphi IDE too? These were some of the questions I found myself asking while searching the web for information.
Of course there is a plethora of information about it available on the Internet but there seems to be some differences of opinion on how a CF application should be developed with Delphi. BDN has some articles and at least one video that demonstrates how to develop CF application. It basically demonstrates the command line compilation approach, about which I will talk later in this article. But Marco Cantu in his blog says that a CF application can be compiled in Delphi 2006 without going through all the complicated processes outlined in the BDN video; all one needs to do is change the search path from the Environment options to point to "BDS\4.0\lib\cf. " So I thought of writing an article that outlines the processes in both Delphi 2005 and Delphi 2006, the former because even after installing BDS 2006 I did install the third party tools to integrate the Emulator with the Delphi IDE.
I have divided the article into three parts: setting up the mobile emulator (as a stand-alone), integrating it with Delphi IDE and compiling a CF application from within the Delphi IDE.