n last month's DevX special report
, I showed you how you can develop for the Windows Mobile platform using the .NET Compact Framework. Now, you'll expand on those concepts and learn how you to explore the various communication options available on this platform so that your applications can connect to the outside world. In particular, this article will discuss:
- Short-range communications technologies such as:
- Bluetooth/serial port
- Long-range communications technologies such as:
You'll also learn how you can use the managed APIs in the .NET Compact Framework to program:
- Infrared communications
- Serial communication over Bluetooth
- Sockets communications
- Web services
The last section of this article shows how to develop a Windows Mobile application to take pictures using the built-in camera and then upload the picture to a web service.
Infrared communication is one of the most common forms of communication for devices today. If you've ever used a TV remote control, you've experienced the convenience of using infrared communications. While infrared communications require line-of-sight between the sending and receiving devices, they are a quick and cheap way of communicating between devices.
The beauty of infrared is that it requires no pairing of devices, and certainly does not require the hassles of exchanging secret pin numbers (unlike Bluetooth). For this reason, it is suitable for applications that require fast exchanges of information. For example, you might want to use infrared to exchange electronic business cards with a business associate.
In the .NET Compact Framework, the core classes for infrared functionalities are located in the System.Net.Irda.dll DLL. Hence, you'd need to add a reference to this file in your project.
For the code described below, you need to import the following namespaces: