Skip to main content

Articles

Featured Products

Windows Mobile Developer Controls
Windows Mobile Developer Controls
Stay in touch using the DEVBUSS RSS feeds.
 

News

Windows Mobile Developer Controls
Windows Mobile Developer Controls

SmartPhone 2003 and .NETcf Primer

Written by casey chesnut  [author's bio]  [read 46126 times]
Edited by Derek

Download the code

Page 1  Page 2  Page 3 

SmartPhone 2003 and .NETcf Primer

This article will detail my early observations of managed coding for the SmartPhone (SP) with the .NET Compact Framework (.NETcf). The differences to managed coding for the PocketPC (PPC) will be pointed out, as well as some things that are new.

Emulator

I am an early-adopter that lives in the phone-challenged country of the USA. Because of this I seem to always be waiting for something: people to adopt wireless web usage, networks to be upgraded, SMS messaging to take off, SIM card adoption, e911, decent pocket pc phone edition hardware, and now smartphone hardware (still waiting for a lot of these). Honestly, I dont keep up with the hardware rumor mills at all. I did ask (mid-August 03) explicitly in the microsoft smartphone newsgroup if there were any 2003 smartphones announced for the US ... and the answer was no. NOTE SmartPhone 2003 is important because it has the .NETcf and SP1 in ROM (also CE 4.2), while SP 2002 does not and there is currently not an install (do not know if there will be one either). So the MS SmartPhone-in-a-box is basically a brick for managed developers. Until then, the SmartPhone SDK comes with an emulator that can be used through eVC as well as VS .NET. I recommend installing eVC before installing the SDK for a couple reasons:

1) Running the emulator outside of VS.NET with eVC installed adds an option to share a file system folder between your desktop and the emulator as a Storage Card. So if you open up the emulator, you can see the files as if they were on the device. Currently we do not get this feature in VS .NET.

2) eVC gives you tools to view the file system, registry, processes, etc on the emulator. This ends up being helpful because there is no File Explorer on the SmartPhone OS which makes it a little more black-box'ish than developing for the Pocket PC. It is also worth noting that the emulator can emulate GAPI commands as well.

Finally, the emulator can run with an external 'radio'. From the docs, this means you could somehow hook up a GSM radio to your desktop machine, and the emulator would use that connection to make web service calls and such. This would be very useful for testing your apps ability to work with a slower connection, lost signals, etc...

 

the actual phones should not be as big as the emulator!

PocketPCs are 240x320 while SmartPhones are 176x220

 

the default font allows 10 lines of text with 22 characters

The following is a dump of the directory structure on the emulator. It is different from the PPC in that the SmartPhone RAM is erased whenever the device is turned off. Also, in that the devices have on-board flash which files can be persisted to. PInvoking SHGetSpecialFolderPath with CSIDL_APPDATA (26) will return \Storage\Application Data; you should sub-dir off of this to store your own data. \Storage\Application Data\Volatile sounds like it is a RAM drive (seems like \Temp might be too)? Finally, it is worth noting that you cannot specify how much memory is used for Programs vs RAM as you could on the PPC.

\profiles
\profiles\default 
\Storage
\Storage\Application Data
\Storage\Application Data\Home
\Storage\Application Data\Sounds
\Storage\Application Data\Volatile
\Storage\ConnMgr
\Storage\MAPI 
\Storage\MAPI\ATTACHMENTS
\Storage\My Documents
\Storage\Program Files
\Storage\Program Files\Communication 
\Storage\Program Files\Communication\Mail Attachments
\Storage\Program Files\Connections
\Storage\windows
\Storage\windows\Accessories
\Storage\windows\Activesync
\Storage\windows\AppMgr
\Storage\windows\ConfigMgr
\Storage\windows\Debug Apps
\Storage\windows\Favorites
\Storage\windows\Fonts
\Storage\windows\Help
\Storage\windows\Messaging
\Storage\windows\Messaging\Attachments
\Storage\windows\Profiles
\Storage\windows\Profiles\guest
\Storage\windows\Profiles\guest\Cookies
\Storage\windows\Profiles\guest\History
\Storage\windows\Profiles\guest\History\History.IE5
\Storage\windows\Profiles\guest\Temporary Internet Files
\Storage\windows\Profiles\guest\Temporary Internet Files\Content.IE5
\Storage\windows\registry
\Storage\windows\Start Menu
\Storage\windows\Start Menu\Accessories
\Storage\windows\Start Menu\Games
\Storage\windows\Startup
\Storage\windows\Temporary Internet Files
\Storage Card
\Temp
\Windows

The \Storage Card directory is from a Folder Share between the desktop and the emulator by opening the emulator outside of VS .NET (and with eVC installed). NOTE when switching between running the emulator through VS .NET and eVC, I sometimes have to go and manually kill the Emulator.exe process. 

 

Next Page