RSS Feed
Download our iPhone app
Browse DevX
Sign up for e-mail newsletters from DevX


Spice Up Your SMS Chat on the Pocket PC

Did you know you can change the way your device represents your SMS messages? Learn how to program your messages to appear visually, complete with photos of the participants.

MS messaging is one of the most popular means of communication means in this new digital age. While SMS is best suited for asynchronous communications, it's recently being increasingly used by many as a chat tool. Rather than viewing the series of related chat messages linearly (see left of Figure 1), using the built-in Outlook Mobile, a better way to chat is to represent them visually, complete with the photos of the recipient (if available).

Figure 1. Linear vs. Visual: Representing SMS messages.

This article demonstrates how to build a SMS chat application (see right of Figure 1) that allows your SMS messages to be represented visually. You will learn:

  • How to create a user control
  • Intercept incoming SMS messages using the .NET Compact Framework
  • Send SMS messages using .NET Compact Framework
  • Add controls dynamically to a Panel control
  • Retrieve information about users from Contacts
Creating the Application
Using Visual Studio 2005, create a new Windows Mobile 5.0 Pocket PC application and name it as SMSChat.

In the default Form1, add the following controls (see also Figure 2):

  • TextBox
  • Panel
  • MenuItem

Figure 2. The Default Form1: Populating the form with the various controls.

The Panel control will act as a container to display the chat messages sent by yourself and the sender.

If the sender's mobile number is:

  • Already in your Contacts and has a photo attached to it, the photo of the sender will be displayed.
  • Already in your Contacts but has no photo attached to it, the name of the sender will be displayed.
  • Not in your Contacts, the phone number of the sender is displayed (assuming you have subscribed to the Caller ID service; check with your Telco).

Close Icon
Thanks for your registration, follow us on our social networks to keep up-to-date