Click here to Skip to main content
6,594,932 members and growing! (16,040 online)
Email Password   helpLost your password?
Platforms, Frameworks & Libraries » Mobile Development » General     Beginner

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

By Logu Krishnan

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.
C#, Windows, .NET CF, .NETVS.NET2003, Dev
Posted:3 Oct 2004
Views:170,207
Bookmarked:83 times
Announcements
Loading...
 
Search    
Advanced Search
Add to IE Search
printPrint   add Share
      Discuss Discuss   Broken Article?Report  
22 votes for this article.
Popularity: 3.76 Rating: 2.80 out of 5
7 votes, 31.8%
1
3 votes, 13.6%
2
4 votes, 18.2%
3
2 votes, 9.1%
4
6 votes, 27.3%
5

Introduction

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.

Features

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 Explorer No 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 Outlook With tools for contacts, calendar, email, tasks and voice notes. Along with support for IMAP4, POP3 and SMS.
MSN Messenger A full blown messenger
Microsoft ActiveSync Supports Server and Desktop synchronization.
Windows Media Player Plays MP3, WMA, AVI
Voice Notes To quickly record voices
Games Variety of Mobile games.
File Management Utilities File Manager [like Windows Explorer], Task Manager
Wireless Modem Options to connect through USB, IR, COM
MMS Client Send and receive MMS messages
Camera Camera 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)
{
    this.Close();
}

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.

APIs

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.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here

About the Author

Logu Krishnan


Member

Occupation: Web Developer
Location: India India

Other popular Mobile Development articles:

  • Writing Your Own GPS Applications: Part 2
    In part two of the series, the author of "GPS.NET" teaches developers how to write GPS applications suitable for the real world by mastering GPS precision concepts. Source code includes a working NMEA interpreter and sample high-precision application in C# and VB.NET.
  • Writing Your Own GPS Applications: Part I
    What is it that GPS applications need to be good enough to use for in-car navigation? Also, how does the process of interpreting GPS data actually work? In this three-part series, I will cover both topics and give you the skills you need to write a commercial-grade GPS application.
  • Learn How to Find GPS Location on Any SmartPhone, and Then Make it Relevant
    A step by step tutorial for getting GPS from any SmartPhone, even without GPS built in, and then making location useful.
  • iPhone UI in Windows Mobile
    It's an interface that works with transparency effects. As a sample I used an interface just like the iPhone one. In this tutorial I am explaining how simple is working with transparency on Windows Mobile.
  • Pocket 1945 - A C# .NET CF Shooter
    An article on Pocket PC game development
Article Top
You must Sign In to use this message board.
FAQ FAQ 
 
Noise Tolerance  Layout  Per page   
 Msgs 1 to 25 of 46 (Total in Forum: 46) (Refresh)FirstPrevNext
Generalsmartphone bluetooth Pinmembersumeet.sum102:49 16 Sep '09  
GeneralMy vote of 1 PinmemberDeep Ash13:45 25 Jun '09  
General[Message Deleted] Pinmemberit.ragester6:39 28 Mar '09  
GeneralPushing the video stream to the Server PinmemberHarshil_Gunchala20:57 30 Jan '09  
GeneralWindows Mobile Video Capture Frames Pinmembersherinsabry0:38 26 Jun '08  
Generalsmartphone software radio PinmemberEngineer Masood21:39 23 Apr '07  
QuestionHow to store data in a Smartphone application Pinmembergonzamol17:15 30 Jul '06  
GeneralModem AT Commands Pinmemberrtleo3:46 30 Jul '06  
GeneralBeginner Pinmemberletter_only17:41 3 Jun '06  
GeneralRe: Beginner Pinmemberletter_only2:23 6 Jun '06  
Generalhelp! Pinmembertienvanphan2:36 22 May '06  
GeneralHow to access smartphone file system programatically with C# Pinmemberdaniel.zolnjan1:02 14 May '06  
GeneralUsing C# for Building Smartphone 2003 mobile applications Pinmemberpmvinay19:08 24 Apr '06  
QuestionRe: Using C# for Building Smartphone 2003 mobile applications Pinmemberhamid_m0:14 24 May '06  
GeneralWinCE 5.0 PinmemberDevil Hill21:43 26 Feb '06  
QuestionWSE Component Pinmembervenugopal.10@indiatimes.com22:12 19 Jan '06  
GeneralPackiging Pinmemberbasheer_massarani23:52 29 Dec '05  
GeneralI couldn't run my program PinmemberTuyen Tran20:14 13 Oct '05  
GeneralError after put menu ctrl PinmemberRuwan S22:30 12 Oct '05  
Generalreading Sim card information Pinmemberkapil_montu9:13 7 Sep '05  
GeneralHow to Attach a Jpeg Img Pinmembervivekthangaswamy3:03 19 Aug '05  
GeneralRe: How to Attach a Jpeg Img PinmemberSantos Das18:47 17 Jul '07  
GeneralMaintaining Session in SmartPhones Pinmemberharidask@info-spectrum.com20:00 14 Jun '05  
GeneralMMS Pinmemberwaelahmed16:48 12 May '05  
Generalhow install smartphone sdk or embedded vc++ PinsussAnonymous0:52 28 Apr '05  

General General    News News    Question Question    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

PermaLink | Privacy | Terms of Use
Last Updated: 3 Oct 2004
Editor: Smitha Vijayan
Copyright 2004 by Logu Krishnan
Everything else Copyright © CodeProject, 1999-2009
Web21 | Advertise on the Code Project