Porting Applications from the Pocket PC to Smartphone 2002
There are a lot of Windows CE 3.0 applications that can prove useful for the Smartphone 2002 platform. This platform is based on Windows CE 3.0; that is the good sign for software porting. However, this new mobile platform has a lot of specific points, such as small content area, touch screen missing, and other user interface concepts that are potential problems for a software developer. The key differences between the platforms are outlined in Introduction to Smartphone 2002 for Pocket PC developers.
To get a feel for porting aspects of the new platform, I have decided to port an existing Pocket PC application that does not use MFC. There is a simple Registry viewer sample that comes with the Pocket PC 2002 SDK, called "PSPCMonkey." This article describes the porting process of this application from the user interface design to the implementation details.
This article also demonstrates some techniques specific to the Smartphone 2002 platform, such as:
- Working with the new menu bar resource, including a workaround for the known problems related to it.
- Creating expandable edit and list boxes.
- Implementing "Back" key support.
- Creating labels with the standard Smartphone 2002 appearance.
A Pocket PC.
A Smartphone 2002.
The very first step is to compile the application without any changes for the Smartphone 2002 platform. It is written in pure API; therefore, we have good chances to get good results from the compiler...
The result does not look too good. A quick review of the application gives the following items yet to do:
- List boxes. According to the Smartphone 2002 guidelines, list boxes should contain only one row.
- Menu bar. The application should contain its own menu bar.
- Back key. The application should support a "Back" key.
- Buttons. Buttons are not supported under Smartphone 2002.
- Content area. Controls do not fit in the content area. A dialog can use vertical scrolling to place all controls.
- Labels. Labels should look like standard Smartphone 2002 labels.
- Title bar. The title bar should show the application name. Titles of message boxes should not be too long.
- Controls' behavior. There is no touch screen.
User Interface Design
The user interface design is the most important aspect of the porting. The small content area, a missing touch screen, and another set of controls should be considered. The user interface design will be divided into several steps.
The main rule of placing controls on the Smartphone 2002 screen is "one control should take one row." It is recommended that you use labels to indicate what type of information is displayed in the control. Labels should be placed directly above the control.
According to the Smartphone 2002 guidelines, list boxes should contain only one row. Navigation can be done in two ways: using a spin control with Left/Right buttons and using an expanded view of the list. An expanded view of the list is quite useful in our case because there can be a lot of items in the list.
Buttons are not supported under the Smartphone 2002 platform. A good solution is to replace them by items on the menu bar.
The action button of the menu bar (left soft key) will replace a mouse click. Users will use this key to step into the Registry key. The second soft key is usually used for the menu, but we don't have a menu in our simple application. Therefore, we will have only one more key in the menu bar: the "Back" item that will replace the "Back/Up" button from the original application.