« Voice Command Cheat Sheet | Main | Palm Treo 700w, What Could be Fixed or Improved »

First Effort at Smart Device Development

Just finished my first mobile .NET application.

Things that were easy:

·        Creating a skin for the Treo 700w. I happened to download SOTI Pocket-Controller Professional which had a skin for remote access. I grabbed its bmp file and found the folder that defined the existing skins (C:\Program Files\Windows CE Tools\wce500\Windows Mobile 5.0 Pocket PC SDK\Deviceemulation\). A quick edit of an existing skin XML file and some Photoshopping of the borrowed skin image followed by using the ToolsàDevice ToolsàForm Factors and Devices UIs in Visual Studio 2005 to copy an existing emulator configuration (Windows Mobile 5.0 Pocket PC Phone Square Emulator) and assign it a new Form Factor.

·        Put an application CAB file on a web server. Using IE on the phone to browse the CAB file triggers a download dialog. Check the open after download box and the installer starts automatically.

·        Getting .NET 2.0 framework installed on the phone.

o       Deploying an application directly to the device triggers installation of the .NET 2.0 runtime.

Things that were hard:

·        Getting internet connectivity within the emulators. Remember to have the emulator cradled (use the ToolsàDevice Emulator Manager) and within the emulator enable a network adapter (FileàConfigureàNetworkàEnable NE2000 PCMCIA network adapter…

·        Understanding the difference between all the available emulators. A Smartphone has a limited UI but includes a phone. Pocket PC has an enhanced UI (it assumes the ability to enter keys on a keyboard, graphical or otherwise). And a Pocket PC Phone has both the enhanced UI and a phone.

·        Getting an ASP.NET 2.0 project deployed from a development server to a deployment server with mixed 1.1 and 2.0 based web apps.

o       Copying doesn’t seem to do anything about configuring the virtual directory or file security settings.

o       Publishing is hidden on one of the menus. It doesn’t do the whole thing either.

o       It would be great to have something generate the xml file from which either the virtual directory or web site was configured.

·        Avoiding ObjectDisposed exceptions when shutting down the windows mobile application. There’s a web request pending at the time of shutdown. The request uses a thread pool work item to implement the request. It looks like the request is completing only to find its world disposed. Resolved by calling Abort on the request, not on the thread. And arranging for the thread to exit cleanly.

·        A related issue is what event’s fire when a windows mobile application is minimized (x in corner is clicked) and when the red button is pressed to turn off the screen. An application continues to run if the OK or minimize button are used to hide the application window while leaving it active. Execution is suspended by the red power button. Execution resumes when the red button is pressed again.

·        Icon colors.

o       Use photoshop to convert the image to indexed colors with the Windows System palette.

o       For some reason, icons installed in the emulator seem to be sticky. They don’t update when the application that owns them is updated.

·        The screen on the Treo 700w is 240 x 240 pixels but after the top and bottom bars are lost to the environment, there’s only a 240 x 188 left. Is there any way to get that space back? When the window form is running in maximized mode, it seems to have the top bar in its client rectangle but there’s still a bar visible.

·        Figuring out how to do resources for localization correctly. The breakthrough was finding the localizable property on a Windows.Forms.Form. Turning this on causes magic to happen in the generated code. Selecting a non-default Language property automatically adds a new resource file. Haven’t chased down the whole satellite assembly building and deployment concept yet. Since a smart device app must stay small, you never want to drag around resources that aren’t used.

·        Getting the application shortcut in the right folder.

o       When you create a Smart Device CAB project to setup a smart device application, the default file system view doesn’t contain the Programs Folder. You can add it manually. This is where the application shortcut has to go.

·        Getting a \r\n sequence into a string resource J. I was moving the string from C# code to the resource editor. “\r\n” was interpreted as a literal, so I tried \u000D\u000A and finally 
. Looking at the resource file in the xml editor showed the last attempt being escaped so I un-escaped them and voila! All I had to do was hit the enter key when replacing the original “\r\n”. Doh.

Things I don’t know how to do yet:

·        Signing the application and CAB file in such a way that the phone doesn’t display the unknown publisher dialog. Many commercial packages behave the same way.

·        Building a smart device installer that triggers an ActiveSyn install. Right now the Smart Device CAB setup project requires that you copy the CAB to the device and run it there. It seems you build an ordinary Windows Setup project but there’s some magic involved in communicating an .ini file to ActiveSync that I just haven’t come across yet.

 

Post a comment

(If you haven't left a comment here before, you may need to be approved by the site owner before your comment will appear. Until then, it won't appear on the entry. Thanks for waiting.)