Click here to Skip to main content
13,551,695 members
Click here to Skip to main content
Add your own
alternative version


92 bookmarked
Posted 3 Oct 2004
Licenced CPOL

An Introduction to Microsoft SmartPhone, and Programming SmartPhone using C#

, 3 Oct 2004
Rate this:
Please Sign up or sign in to vote.
The objective of this article is to provide the prelude to beginners of SmartPhone programming. This article provides introduction to SmartPhone, its features, and APIs. Also, the article discusses on creating a simple program using C# for the SmartPhone.


The objective of this article is to provide the prelude to the beginners of SmartPhone programming. This article provides introduction to SmartPhone, its features and APIs. Also, the article discusses on creating a simple program using C# for the SmartPhone.

In recent days, mobility is getting its momentum and attention both from the public consumers of mobile services and major corporations of the world. Mobility today equips knowledge workers with the power to access information and data from any part of the world.

As any other rapid technology evolution, mobility has certainly evolved and its recent form is on Mobile Phones, but be sure that, this mobility would create a whole new world and accessories useful for mankind, starting from a lay man to the richest. And it is also true that soon mobility would take another form and shape, and would become part of our lives.

Fine… But what do I get as a developer on all these happening around me… Actually, there is a whole new exciting world opened up for developers which is definitely a paradigm shift from today’s Desktop and Web Application development. New technology, new challenges, new opportunities, and… new way to earn… $ Money $ ;-)

Mobility Evolution

As part of the evolution, we had various handheld devices, Pocket PCs, PDAs et al. Today’s mobility world is trying to gain advantage by leveraging advantages of successful cellular phones which are truly mobile and is owned by people of all sectors of the world.

There have been various models of phones available in today’s market. As of today, the market is ruled by Symbion OS embedded on the Nokia Phones and other proprietary phones like Sony, Samsung et al.

Much like the Web Browser market, Microsoft is a bit late to enter the mobile world. Today Microsoft has its own proprietary operation system, called as Microsoft Windows Mobile 2003, powered by the strong WinCE 4.2 OS. These phones with the Microsoft OS is slowly capturing up the market, and the developers' world.

As always, Microsoft provides adequate developer support to program these phones using existing languages and technologies. Microsoft .NET Compact Framework, a subset of the rich .NET Framework, does this magic. One great news is that the .NET CF runtime is now preloaded on the ROM of the Microsoft, which definitely eases the burden during the application deployment.


Microsoft SmartPhone is loaded with a very rich suite of software, which communicates to the user through Voice, Text and Internet capable applications, by leveraging the connectivity options like GSM, GPRS, SMS, PPTP, Bluetooth, USB, and Infrared IrDA.

Following is the comprehensive list of software usually loaded along with the Microsoft SmartPhone.

Pocket Internet ExplorerNo more plain vanilla WAP Browser on phones, instead a full blown IE 5 is loaded on the phones supporting HTML 3.2, XML, XSL, cHTML, WAP 1.2.1, WML Script, Active Script, ActiveX, SSL, JPEG, GIF etc.
Pocket OutlookWith tools for contacts, calendar, email, tasks and voice notes. Along with support for IMAP4, POP3 and SMS.
MSN MessengerA full blown messenger
Microsoft ActiveSyncSupports Server and Desktop synchronization.
Windows Media PlayerPlays MP3, WMA, AVI
Voice NotesTo quickly record voices
GamesVariety of Mobile games.
File Management UtilitiesFile Manager [like Windows Explorer], Task Manager
Wireless ModemOptions to connect through USB, IR, COM
MMS ClientSend and receive MMS messages
CameraCamera support for image capture and video capture

SmartPhone Layout

Microsoft has suggested a standard layout and control structure for the devices. [Ref: SmartPhone SDK]

The placement of soft keys, the Home key, the Back key, and the five-way navigation pad illustrated in the preceding figure is strongly recommended. All the hardware controls (soft keys, and so on) must be present; however, a device manufacturer is free to deviate from the design.

Recently, Microsoft launched the Microsoft Windows Mobile 2003 Second Edition, and the following developer tools are available, based on its open Win32 development environment and an SDK for SmartPhone [can be downloaded].

  • Embedded VC++ 4.0
  • Visual Studio .NET – C#, VB.NET

A Simple Hello World Program

Now, let’s get into business. Let us write a simple Hello World program. The first and foremost activity we need to do for programming the SmartPhone using Visual Studio 2003 is to download the SmartPhone 2003 SDK. Upon installing the SDK, the smart device extensions are extended with support for SmartPhone development along with the SmartPhone emulator.

After the SDK is installed, launch Visual Studio, choose Smart Device Application under project templates, and give a name for your application, and click OK. Now, you should see a screen as below:

Choose SmartPhone and Windows Application as depicted above, and hit the OK button. Now, you should see your favorite Visual Studio geared up for SmartPhone development.

On the Toolbox, you can see a list of controls, and some familiar controls are disabled, these disabled controls are not supported on the SmartPhone.

Now, we have to employ a goody good practice for SmartPhone development. We need to consider that the phones are usually operated using a single hand, therefore the navigability of the applications you create should be easy. The “Softkey” depicted on the layout plays a role here. If you closely observe VS, you might notice a default Menu control is created for you. It suggests you to use MainMenu, which would become the default navigation keys to navigate your application using the soft keys of the mobile phone.

So, let us create a menu structure as below:

Double click on the “Say Hello” MenuItem and write the following code:

private void menuItem2_Click(object sender,System.EventArgs e)
     MessageBox.Show("Hello Logu!");

And write the following code for the Exit menu:

private void menuItem3_Click(object sender, System.EventArgs e)

Now, hit F5 to run the application, a new popup would request you choose the device to target, choose “Smartphone 2003 Emulator (Virtual Radio) (Default)”, and hit “Deploy”.

Now the emulator should load up, and the application would be deployed to the emulator, and a prompt would appear as below:

Click OK to continue to launch the application.

Now, your .NET application is loaded on the SmartPhone. After the application is launched, click “My Menu” and click “Say Hello”, you should see the alert message now… That’s it. Now, you can choose the target as SmartPhone device and deploy directly to your SmartPhone device also. Packaging and deployment is not discussed in this article as that would itself be another full article.


Following is the list of API's available for SmartPhone development:

  • ActiveSync API
  • Bluetooth API
  • CE Messaging API
  • Device Management API
  • Home Screen API
  • Object Exchange (OBEX)
  • Pocket Outlook Object Model (POOM)
  • Speech Recognizer
    • Telephony - TAPI
    • Accessing the SIM card
    • P/Invoke to native SIM Toolkit APIs
  • RAPI – Remote API to connect to the desktops programmatically
  • GAPI – To develop Mobile games
  • Vibrate API
  • Voice Recorder Controls

Don't you think the SmartPhone is already powered up for today's Enterprise?

I strongly suggest you to read SmartPhone SDK documentation before diving into SmartPhone application development.

The world is not limited with this… but grows indefinitely.


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

Logu Krishnan
Web Developer
India India
No Biography provided

You may also be interested in...


Comments and Discussions

Generalsmartphone bluetooth Pin
sumeet.sum1016-Sep-09 1:49
membersumeet.sum1016-Sep-09 1:49 
GeneralMy vote of 1 Pin
Deep Ash25-Jun-09 12:45
memberDeep Ash25-Jun-09 12:45 
General[Message Deleted] Pin
it.ragester28-Mar-09 5:39
memberit.ragester28-Mar-09 5:39 
GeneralPushing the video stream to the Server Pin
Harshil_Gunchala30-Jan-09 19:57
memberHarshil_Gunchala30-Jan-09 19:57 
GeneralWindows Mobile Video Capture Frames Pin
sherinsabry25-Jun-08 23:38
membersherinsabry25-Jun-08 23:38 
Generalsmartphone software radio Pin
Engineer Masood23-Apr-07 20:39
memberEngineer Masood23-Apr-07 20:39 
QuestionHow to store data in a Smartphone application Pin
gonzamol30-Jul-06 16:15
membergonzamol30-Jul-06 16:15 
GeneralModem AT Commands Pin
rtleo30-Jul-06 2:46
memberrtleo30-Jul-06 2:46 
GeneralBeginner Pin
letter_only3-Jun-06 16:41
memberletter_only3-Jun-06 16:41 
GeneralRe: Beginner Pin
letter_only6-Jun-06 1:23
memberletter_only6-Jun-06 1:23 
Generalhelp! Pin
tienvanphan22-May-06 1:36
membertienvanphan22-May-06 1:36 
QuestionHow to access smartphone file system programatically with C# Pin
daniel.zolnjan14-May-06 0:02
memberdaniel.zolnjan14-May-06 0:02 
GeneralUsing C# for Building Smartphone 2003 mobile applications Pin
pmvinay24-Apr-06 18:08
memberpmvinay24-Apr-06 18:08 
QuestionRe: Using C# for Building Smartphone 2003 mobile applications Pin
hamid_m23-May-06 23:14
memberhamid_m23-May-06 23:14 
GeneralWinCE 5.0 Pin
Devil Hill26-Feb-06 20:43
memberDevil Hill26-Feb-06 20:43 
QuestionWSE Component Pin
venugopal.10@indiatimes.com19-Jan-06 21:12
membervenugopal.10@indiatimes.com19-Jan-06 21:12 
GeneralPackiging Pin
basheer_massarani29-Dec-05 22:52
memberbasheer_massarani29-Dec-05 22:52 
GeneralI couldn't run my program Pin
Tuyen Tran13-Oct-05 19:14
memberTuyen Tran13-Oct-05 19:14 
GeneralError after put menu ctrl Pin
Ruwan S12-Oct-05 21:30
memberRuwan S12-Oct-05 21:30 
Generalreading Sim card information Pin
kapil_montu7-Sep-05 8:13
memberkapil_montu7-Sep-05 8:13 
QuestionHow to Attach a Jpeg Img Pin
vivekthangaswamy19-Aug-05 2:03
membervivekthangaswamy19-Aug-05 2:03 
AnswerRe: How to Attach a Jpeg Img Pin
Santos Das17-Jul-07 17:47
memberSantos Das17-Jul-07 17:47 
GeneralMaintaining Session in SmartPhones Pin
haridask@info-spectrum.com14-Jun-05 19:00
memberharidask@info-spectrum.com14-Jun-05 19:00 
GeneralMMS Pin
waelahmed12-May-05 15:48
memberwaelahmed12-May-05 15:48 
Questionhow install smartphone sdk or embedded vc++ Pin
Anonymous27-Apr-05 23:52
sussAnonymous27-Apr-05 23:52 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.180515.1 | Last Updated 3 Oct 2004
Article Copyright 2004 by Logu Krishnan
Everything else Copyright © CodeProject, 1999-2018
Layout: fixed | fluid