| By Andy Wigley | Article Rating: |
|
| January 1, 2000 12:00 AM EST | Reads: |
9,629 |
The .NET Compact Framework is a managed execution environment (a runtime engine) that runs on devices that use the Windows CE operating system - Pocket PC and Windows CE .NET devices. The runtime components also include a large collection of base class libraries that you use in your .NET applications to do everything from displaying UI on the screen to working with files to accessing network resources such as XML Web services. It's a slimmed-down version of the full .NET Framework that you might use to develop applications for servers and desktop PCs.
It does a similar job to Java 2, Micro Edition (J2ME), but the .NET Compact Framework is firmly targeted at higher-end PDAs and PDA- phone hybrids. It's too big to go on the kind of small phones that J2ME CLDC MIDP works on. It's definitely in the same space as J2ME in its CDC (Personal Java) configurations, though.
What Does It Run On?
The .NET Compact Framework currently runs on Windows CE devices only. You can use it with Pocket PC 2000 and Pocket PC 2002 devices, or custom handheld devices using the Windows CE .NET operating system. A version from Microsoft for their Smartphone is expected, although no announcements have been made.
However, it's not necessarily for Microsoft devices only. The specification of the CLR (Common Language Runtime - the runtime engine) is a published standard, so anyone can build one. Recent speculation has suggested that Palm will be supporting it in Palm OS 6.
How Do I Build Applications?
You write applications using Visual Basic .NET or C# using Microsoft Visual Studio .NET 2003. You'll need a PC running Windows 2000 or Windows XP, plus around 4GB of free disk space to run Visual Studio .NET. You can order a DVD containing a 60-day trial version of Visual Studio .NET at http://msdn.microsoft.com/vstudio/productinfo/trial/default.asp. You just have to pay the postage. This IDE provides you with everything you need, including Pocket PC 2002 and Windows CE .NET emulators, so you don't even need a real device.
Visual Studio .NET 2003 will be released in February or March 2003. Don't get the 2002 version - it doesn't support the .NET Compact Framework.
Building an Application
To get started, open Visual Studio .NET 2003 and click on File ->New Project. In the New Project window (see Figure 1), select either Visual Basic or Visual C# projects in the left pane according to your preference, then click the Smart Device Application icon in the right pane. Enter the name you want to give this project (for example, "MyFirstSmartDeviceApplication") and click OK.
Another window appears, this time asking you what kind of project you want, and which platform it should run on. Choose the Pocket PC platform, and the Windows Application project type. Click OK and Visual Studio .NET creates the project for you.
Using the GUI Designer
Now you're working in a familiar Visual Studio .NET drag-and-drop visual designer. You build your user interface by dragging controls from the Toolbox onto the Form. For this simple application, click on the Toolbox tab on the left edge of the screen so that it slides into view, then drag a label onto the Form (see Figure 2).
You can set properties of the control you just dragged on in the Properties window in the lower right corner of the screen. Set the Text property to a suitable value, such as "Hello, World" or perhaps something more original. Play with some of the other properties - click on the Form to select it, then change the Backcolor property, or set the Text of the Form to display a suitable heading on the Form.
One tip for Pocket PC applications: if you want to get the little "OK" icon on the taskbar at the head of your Form, set the MinimizeBox property of the Form to False. The OK icon is actually the "Quit" option for a Pocket PC application. If you don't do this, you just get an "X" icon, which actually means "minimize." (I know - "X" means minimize, whereas on a PC it means quit? Just don't ask - the Pocket PC user interface has been honed through several Microsoft failures in earlier versions, and users seem comfortable with it. This whole subject deserves its own article.)
Testing Your Application
When you're finished, click the Build menu, option Build Solution. If it builds successfully, click the Debug menu, option Start. You'll be asked where to deploy your application. If you have a real Pocket PC device connected to your desktop by a synchronization cradle, or by InfraRed or 802.11b, then you can select Pocket PC Device. Otherwise, choose the built-in Pocket PC 2002 emulator.
If the target device does not have the .NET Compact Framework runtime installed, Visual Studio .NET downloads it and installs it, along with your application. The emulator runs a true Pocket PC operating system in a virtual machine hosted by your desktop PC. The first time you use it, the .NET Compact Framework runtime must be installed into it, as shown in Figure 3.
New Pocket PC devices that come out in 2003 will have the .NET Compact Framework preinstalled, but on older devices you have to install it manually.
If everything has gone well, you'll see your application displayed on the screen of the emulator (see Figure 4).
Summary
You've created your first application. The .NET Compact Framework class libraries are extensive and allow you to create all kinds of sophisticated applications to run on handheld devices. There is an implementation of Windows Forms, which supports the majority of the controls that you can use in desktop applications with the full .NET Framework. There are also classes to allow you to write XML Web services client apps, and to work with SQL Server CE databases on the device, or fetch data from back-end SQL servers over HTTP or via wireless or wireline LAN.
It's an impressive product that allows the .NET developer to easily transfer skills learned with desktop applications to applications on smart devices. Have a go and see what you can do - I think you'll be impressed!
Published January 1, 2000 Reads 9,629
Copyright © 2000 SYS-CON Media, Inc. — All Rights Reserved.
Syndicated stories and blog feeds, all rights reserved by the author.
More Stories By Andy Wigley
Andy Wigley is a principal technologist at Content Master Ltd, focusing on mobility. He is the coauthor of Building ASP.NET Applications for Mobile Devices and .NET Compact Framework Developer's Core Reference, both published by Microsoft Press.
- Kindle 2 vs Nook
- Confessions of a Ulitzer Addict
- The Cloud Computing Kettle Heats Right Up
- Are You Comfortable with Where Your Data Sleeps at Night?
- Ulitzer Provides a Powerful Social Journalism Platform
- Ulitzer Live! New Media Power Panel at Santa Clara Convention Center
- Instant Professionalism Online Despite Yourself...with Ulitzer
- Rapid Application Delivery - Going Hybrid
- Rhomobile CEO to Speak at iPhone Developer Summit 2009 West
- Rhomobile to Announce Production Release of RhoHub at 4th Cloud Expo
- Sybase Named “Silver Sponsor” of iPhone Developer Summit
- Top 10 Telecom Predictions for 2010
- Kindle 2 vs Nook
- Confessions of a Ulitzer Addict
- RIM Launches BlackBerry Desktop Manager for Mac Users
- Ulitzer Live! New Media Conference & Expo
- The Cloud Computing Kettle Heats Right Up
- Are You Comfortable with Where Your Data Sleeps at Night?
- Ulitzer Provides a Powerful Social Journalism Platform
- Analyst Firm Launches "ZapThink on Ulitzer"
- Open Source Mobile Cloud Sync and Push Email
- Unisys Provides Mobile Support
- Apple Introduces New iPod nano With Built-in Video Camera
- Ulitzer Live! New Media Power Panel at Santa Clara Convention Center
- Where Are RIA Technologies Headed in 2008?
- Sun Blew its "iPhone" Java Opportunity to AJAX
- The Top 250 Players in the Cloud Computing Ecosystem
- AJAXWorld Conference Adds "iPhone Developer Track"
- iPhone Will Make Mobile AJAX and Web 2.0 Happen
- Why Build Applications for the iPhone and iPod Touch?
- Designing For the "iPhone" Is a Refreshing Experience
- New Column: A Geek's Bookshelf
- Building an iPhone Application with Adobe AIR
- Apple U-Turns on iPhone: Third-Party Developers To Get SDK in 2008
- Vodaphone To Present iPhone Developer Session at AJAXWorld
- Why Is iPhone Better? Here's My Story...







































