The introduction of the .NET Framework made the last year or so an extremely exciting time for software developers. Not only does .NET provide an entirely new platform for creating software, it also introduces an extremely rich (and quite large) set of class libraries for building managed applications, as well as a new type-safe object-oriented programming language known as C#.
The .NET Compact Framework is a version of .NET specifically designed for small form factor devices, such as Pocket PC. The class library provided with the Compact Framework is extremely similar to its desktop counterpart, except that certain functionality has been "slimmed down" (or entirely eliminated) to better support the limited memory, storage space, and performance of a mobile device.
Because covering the entire Compact Framework would be a book in itself, this chapter provides you with information about using some of the .NET classes that are of particular interest to Pocket PC application developers. We first take a look at performing Winsock communications (see Chapter 1) between devices using the Sockets class library that is provided by the Compact Framework. This is followed by an explanation of how to write applications that request data using standard Internet protocols, such as HTTP (see Chapter 2).
This chapter also describes how you can consume Web Services, probably one of the most intriguing concepts for a mobile developer. A Web Service is a standardized way to access distributed program logic by using "off-the-shelf" Internet protocols. For example, suppose you had an application running on a Pocket PC device that kept an itinerary of your travel plans. You could use one Web Service to get information about flight delays, another to get the weather report at your destination, and another to pull gate information, tying all of the information together within your application. What makes Web Services unique is that any communications with the server hosting the Web Service are done through a standardized XML format. By using Web Services, you can easily create robust mobile applications that pull data from a variety of sources on the Internet.
Finally, we'll take a look at using some of the APIs that are native to the Pocket PC, such as the Connection Manager (see Chapter 7) and SMS Messaging (see Chapter 8), from applications written in C#.
Unlike writing standard C++ applications for a Pocket PC device using Embedded Visual C++ 3.0, you use Visual Studio 2003.NET for developing C# and VB.NET applications. At this time, you cannot use C++ to develop .NET applications for the Compact Framework.
Use the following table of contents to navigate to chapter excerpts, or click here to view Chapter 12 in its entirety.
|ABOUT THE BOOK:|
|Pocket PC Network Programming is a comprehensive tutorial and reference for writing network applications on Pocket PC 2002 and Pocket PC 2002 Phone Edition devices. It explains how the Pocket PC communicates with the Internet, with other mobile devices, and with networks. Click here to purchase the book from Addison-Wesley.|
|ABOUT THE AUTHOR:|
|Steve Makofsky is a software design engineer on Microsoft's .NET XML Messaging team. In addition to having been a Microsoft Embedded MVP, he has worked on several commercial Windows CE products, including the award-winning bUSEFUL Utilities 1.0 and 2.0 (Best of Comdex Utility 1998/1999). Steve coauthored Teach Yourself Windows CE Programming in 24 Hours (Sams, 1999) and has published several magazine articles on .NET and mobile device development. When not working on cool embedded projects, Steve likes to drink lattes and hike on Mt. Everest.|