General Considerations for Client Development

General Considerations for Client Development

A number of trends have pushed the adoption of mobile and Tablet PC technologies mainstream, including:

  • Increasing popularity of mobile PCs when compared against desktops, especially among business users

  • Blurring of the line between Tablet PC and notebooks, as the latter adopts many of the technologies of the former, such as pen input

  • Integration of these technologies within all versions of Windows Vista®

Because of this adoption trend, software developers of client applications must face the fact that their products will increasingly be run on mobile PCs.

Separate from the decision to support specific mobile and tablet PC technologies, such as pen input, all developers should consider how the various characteristics of mobile computers affect the user experience of their applications. These characteristics usually fall into four areas of consideration: power management, hardware awareness, network awareness, and data access and synchronization. Proper consideration of and programming to maximize the effectiveness of mobile computer resources can vastly improve the user experience. For more information, see "Mobile PC Development Guides" in the Windows SDK.

The System Event Notification Service (SENS) in Windows provides a uniform service for many of the general system characteristics and events related to these areas of consideration. Using the associated COM-based API, an application can query the characteristics of a computer, such as whether it is connected to a network and if so, what type of network, whether a specific network location is reachable and the quality of connection (QOC) information associated with that destination. This API also enables an application to subscribe to events concerning network changes, user logon and screensaver events, and power events. For more information, see "System Event Notification Service" in the Windows SDK.

Power Management

One of the main limitations of many portable devices, especially mobile PCs, is battery life. Although hardware manufactories and Microsoft continually attempt to improve the effective life of mobile PCs, the application developer should take proactive steps to improve the power usage of their applications. The application should:

  • Be aware whether the current power source is battery or AC power and use computer resources appropriately. For example, non-essential features, such as animations polling loops and complex supplemental calculations, should be minimized when using the battery.

  • Receive power state change notifications and act appropriately. For example, a low battery notification provides a good chance to save current work in case there is a subsequent catastrophic loss of power.

  • Handle shutdown notifications gracefully by saving its current state and shutting down as quickly as possible. Windows Vista has greatly changed the shutdown experience for both programmers and users.

  • Not use a device that has been powered down, unless necessary or until other activity has woken up the device for general use.

  • Minimize the needs for reboots, which are a very time- and power-consuming operation. For this purpose, Windows Vista introduces Restart Manager technology, which is explained in the "Developing with Restart Management" section of this paper.

For more information, see "Power Management" in the Windows SDK.

Hardware Awareness

More than other classes of computers, mobile PCs are exposed to rapidly changing hardware conditions. Hardware devices can be plugged or unplugged in a variety of ways: peripherals using one of the many connecting technologies, such as CardBus, USB, Bluetooth or Firewire; mobile PCs are often docked or undocked from one or mode docking stations that often have attached peripherals; external monitors through a dedicated external connector; and shared or network attached peripherals that can change as network connectivity does. And as mentioned above, a device can also be powered down, which delays access to its functionality. A robust application will intelligently handle device transitions.

Before accessing any output device, an application should first query its current availability and state. If it is currently powered down, the application should consider whether the operation is non-essential (and therefore can be skipped), whether it can be delayed, or whether an alternate resource can be substituted instead. If none of these alternatives can be used, only then should the device be directly accessed (resulting in it automatically powering up). Likewise, if a device is not available, these same alternatives can be considered before running error logic. An application can also take a more proactive stance by monitoring for hardware changes. For more information, see "Hardware Awareness" in the Windows SDK.

Monitor Awareness

Monitor displays are a particularly complicated area for applications to handle gracefully. The trend in desktop monitors is either larger, higher-DPI (perhaps widescreen) monitors or using multiple monitors on a single PC. In contrast, monitor use is more varied for mobile PCs. While desktop replacement notebooks often have fairly large, widescreen displays, the new ultra-mobile PCs (UMPCs) typically have tiny built-in displays. External monitors or projectors are a further complication. Developers should consider the following monitor variables when designing application UI:

  • The wide possible diversity of screen sizes and resolutions, for example, ranging from large 1,920x1,200 pixel widescreen LCD monitors to small built-in 800x480 UMPC displays.

  • Varying pixel density, commonly measured in dots per inch (DPI). While 96 DPI is the de facto standard today, Windows Vista is designed to better handle higher density displays, like 120 DPI.

  • Transitions between landscape and portrait orientation.

  • The connection and disconnection of external monitors (or projectors).

  • The efficient use of multiple monitors or multiple virtual desktops.

As with hardware awareness, an application can determine and adapt to the current monitor environment. In addition, it should monitor and respond to monitor and display changes. For more information, see "Adapting to a Flexible Display Environment" in the Windows SDK.

Network Awareness

Similar to hardware, the network environment can change rapidly for mobile PC user, especially when that user is roaming. And as for hardware changes, a robust approach to network resource utilization includes:

  • Establishing the current connections and their characteristics.

  • Monitoring for connectivity changes.

  • Responding to connectivity changes, including interruptions.

  • Providing support and alternatives for scarce network resources. For example, lengthy network operations can be accomplished in a background thread, should provide a progress UI, and should be cancelable by the user.

For more information, see "Awareness of Changing Network Conditions" in the Windows SDK.

Data Access and Synchronization

The dynamic nature of network connectivity also has a large effect on how non-local data is accessed. Because a reliable connection cannot be assumed, remote data should be stored locally for use and updated periodically whenever critical junctures are reached and when network bandwidth allows. Windows Vista provides two technologies to assist in this area.

  • The new Client-Side Caching (CSC) enables easy caching of network files using automatic, manual or disabled modes. CSC manages the synchronization and update of the file between the client computer and the server. As an example, offline folders are implemented using CSC. A CSC API is supplied for developers to programmatically control caching.

  • An updated Sync Manager and associated API for synchronizing files and data between computers, servers, and devices. The Sync Manager has improved in a number of ways, including a new UI, integration into the shell, and an integrated conflict resolution capability. Its API has been likewise updated.

For more information about CSC and Sync Manager, see the corresponding topics in the Data Organization section of this document.