Jim Wilson
JW hedgehog, Inc.
Applicable:
Windows Mobile 5.0
Windows Mobile-based devices
Visual studio2005
Windows Media Player
Direct3d
DirectDraw
DirectShow
. NET Compact framework
ActiveSync
Pocket Outlook
Exchange
Abstract:Learn about the new features in Windows Mobile 5.0 from the developer's point of view.
Content on this page
|
Introduction |
|
Windows Mobile 5.0 API |
|
Tools and technologies |
|
Other windows mobile 5.0 changes that affect developers |
|
Summary |
Introduction
Windows Mobile-based devices (including Pocket PC and smartphone) are widely deployed around the world. What makes these highly mobile devices popular? This is mainly due to the rapidly improved hardware features. These devices now provide high-quality display, cameras, larger memory, and powerful communication capabilities that were hard to imagine before. Windows Mobile 5.0 allows developers to easily take advantage of these powerful device features and other features.
Windows Mobile 5.0 introduces new-generation platform applicationsProgramProgramming interfaces (APIS) that provide rich multimedia support, rich 2D and 3D plotting functions, and support for cameras or GPS) easy interaction between devices and other device hardware, simple interaction and integration with pocket outlook, and more complete communication functions. These new APIs not only provide better application functions, but also encapsulate the detailed information of these functions in the platform, this allows developers to focus on the specific needs of their application functions, thus improving the efficiency of their work.
Windows Mobile 5.0 is the first platform to publish both the local version and the Hosted version platform API, so that developers can select the most appropriate development model based on their skills and application adaptability. Windows Mobile 5.0 also incorporates many API enhancements to provide greater continuity between Windows Mobile devices, Windows desktops, and server computer platforms, this allows server developers to use public skill sets across all Windows platforms.
This article describes these new features in Windows Mobile 5.0 from the developer's perspective, and describes the tools that developers use to create a Windows Mobile 5.0 solution. The following sections describe some of the most noteworthy Windows Mobile 5.0 features.
Improved work efficiency
The following table provides an overview of how Windows Mobile 5.0 improves the efficiency of developers:
• |
The new API solves many of the most common mobile device development challenges (including image management, contact management, and GPS), allowing developers to concentrate on generating impressive applications. |
• |
The larger continuity between Windows Mobile Software for Pocket PC and Windows Mobile Software for smartphone is provided between devices.CodeAnd more portability of applications. |
• |
The new status and notification broker APIs allow applications to easily track system activities, such as changes to the network status, receipt of Short Message Service (SMS) information, or incoming call calls. |
• |
Visual Studio simplifies Device Development through multiple tools that can improve work efficiency, such as data designer, faster debugger, and improved user interface designer (they contain corresponding support, allows developers to view application representations across different screen directions, resolutions, and devices ). |
• |
Improved simulators (including new arm simulators) simplify application testing by more accurately representing the device environment, reducing the number and level of tests that developers need to run directly on the device. |
Multimedia support
The following table provides an overview of Windows Mobile 5.0's rich multimedia support:
• |
The integrated camera API enables developers to embed camera, image, and video functions directly into applications. |
• |
Windows Media Player mobile enables developers to integrate Media Player functions into their applications, including library management and playback. |
• |
Direct3d enables developers to provide a wide array of 3D game environments. |
• |
DirectDraw provides developers with greater control and flexibility in rendering high-speed 2D images. |
Managed code support
Windows Mobile 5.0 provides the best support for hosted code developers. The following table provides an overview of supported managed code for Windows Mobile 5.0:
• |
All windows mobile 5.0 devices install. NET Compact Framework 1.0 Service pack3 In the Rom. This provides a consistent target platform for hosting application deployment. |
• |
Many core device features (such as message processing, telephone, and outlook mobile) now make public managed APIs so that they can be accessed directly from managed code. |
• |
Many operating system functions that are directly open for API hosting provide hosting developers with access across all versions of the. NET Compact framework. |
Back to Top
Windows Mobile 5.0 API
Windows Mobile 5.0 provides many new APIs. Although these new APIs are distributed across many different services, they all serve the common goal of improving developers' productivity. By combining many frequently executed tasks into the operating system, application developers can concentrate on meeting the specific needs of each application.
For the first time, Windows Mobile 5.0 directly discloses the operating system features to hosted developers. In addition to new hosting classes for existing operating system features, these new hosting APIS also include new operating system features.
You can divide the new windows mobile 5.0 APIs into three groups: new APIs directly for local developers; existing local APIs that are now published to hosted developers; new APIs that can be used by both local and hosted developers.
NewAPI
This section describes the new APIs directly for local developers.
Direct3dMobile
• |
Because Windows Mobile devices are becoming more and more popular with 3D desktop games, the next logical step is to produce a wide range of 3D games for mobile devices. Direct3d mobile now makes it possible to become a reality. |
• |
Direct3d Mobile is the mobile device Implementation of direct3d API of desktop computers. With direct3d mobile, developers can use their existing desktop computer direct3d skills and code to generate rich 3D game environments for Windows Mobile devices. |
• |
Direct3d mobile fully utilizes graphic hardware support and can be used to develop high-performance 3D perspectives on mobile devices. In addition to the ability to combine creative 3D user interfaces, this support also enables developers to create a powerful 3D game environment. |
DirectDraw
• |
Windows Mobile 5.0 provides DirectDraw APIs for applications that require direct control of the display memory, provide high-speed 2D graphics, or merge digital videos. By providing a public abstraction on the display hardware of devices, DirectDraw provides application developers with the function of directly manipulating the display of devices independently of devices. |
• |
DirectDraw not only provides support for plotting surfaces that developers can easily query, but also provides mobile developers with powerful application programming interfaces that can replace game APIs (gapis, this allows applications to take full advantage of hardware functions and performance. |
• |
DirectDraw is the mobile device Implementation of the DirectDraw API of the desktop computer. Desktop Computer developers can use their existing skills and migrate existing DirectDraw code and libraries to Windows Mobile 5.0 devices. |
DirectShow
• |
Now, mobile devices with cameras are rapidly increasing. Developers who want to create applications that interoperate with those devices that support cameras can use the DirectShow API. DirectShow provides application developers with the ability to manage and access camera hardware so that they can capture and play high-quality images and stream videos. DirectShow abstracts the details of each camera hardware to provide common and consistent programming interfaces for application developers. |
• |
DirectShow supports a variety of file formats, and developers can customize and expand it to support new or dedicated formats. Similar to direct3d and DirectDraw, DirectShow is the mobile Implementation of desktop computer APIs, and enables desktop computer developers to quickly apply their existing skills to take advantage of their existing code investment. |
Global Positioning System
Currently, many mobile devices include GPS in them, or use it as an attachment. In the past, for applications that want to access the information returned by GPS devices, these applications were required to use serial APIs to directly open the GPS devices. This technology has two problems. First, a considerable amount of code is required to work through the serial API, and application developers are required to have at least a moderate degree of knowledge about serial device programming. Second, the architecture limits the receipt of GPS data to a single application currently connected. Windows Mobile 5.0 eliminates these problems through the GPS middle layer driver.
The GPS middle layer driver provides a very easy-to-use API to provide shared access to GPS data. Using the GPS middle layer driver, Windows Mobile greatly reduces the amount of code required to interact with the GPS device, and enables multiple applications to simultaneously ask the gps device for configuration and location information. Table 1 shows the four functions used to access the GPS middle layer driver.
Table 1. GPS middle layer driver functions |
Function |
Description |
Gpsopendevice |
Connect to the GPS middle layer driver |
Gpsclosedevice |
Disconnect from the GPS middle layer driver |
Gpsgetposition |
Retrieve GPS location information |
Gpsgetdevicestate |
Retrieve information about the current status of the GPS hardware |
Uniquely identifies a device
Windows Mobile 5.0 contains fourGetdeviceuniqueidMethod. UseGetdeviceuniqueidAn independent software vendor (isV) can now associate each software license with a particular device to easily protect intellectual property rights. Company developers can find it useful for tracking data and application distribution for specific devices.
Digital Rights Management
Digital Rights Management (DRM) remains an important part of protecting and Distributing Intellectual Property Rights. For some application developers, the difference in the support of various DRM engine APIs reduces the development speed and code portability of applications.
To eliminate these problems, Windows Mobile 5.0 provides a file-based digital rights management (fdrm) API. Fdrm provides public programming interfaces between different DRM engines. This public programming interface improves developers' efficiency and code portability. Developers now only need to consider fdrm, rather than the specific DRM engine used by devices.
ActiveSyncInteraction
Developers can now useActivesyncstartAndActivesyncstopMethod to start and stop the ActiveSync synchronization process from the device.
OthersFor Windows Mobile 5.0Function
Table 2 shows other Windows Mobile 5.0 functions not described in this section.
Table 2. Other windows mobile 5.0 functions |
function |
description |
Querypolicy |
ProvideDmprocessconfigxmlIs used by developers to retrieve the values set by a single policy. |
Exitwindowsex |
Enable the application to close the device. On the Pocket PC, the application only usesExitwindowsexTo restart the device. In smartphone, the application usesExitwindowsexTo disable or restart the device. |
Drawfocusrectcolor |
Use the color and style of the current topic to draw the specified rectangle, as if it had focus. |
Now publicly hostedAPIExisting operating system functions
The features listed here are not novel for the Windows Mobile platform. The real new feature is the managed API provided by Windows Mobile 5.0. By providing these managed APIs, Windows Mobile 5.0 allows hosted developers to directly access these features without the help of local code or the use of applications. the specific version of NET Compact framework.
Phone number
Windows Mobile 5.0 now usesMicrosoft. windowsmobile. telephony. PhoneClass. By using the newPhoneClassTalkMethods: developers can write application code to start a call by phone, and can choose to prompt the user to verify the number before the call.PhoneClass must be referenced by Microsoft. windowsmobile. telephony assembly.
The following code showsPhone. TalkMethod.
Using Microsoft. windows Mobile. telephony ;//... phone thephone = new phone (); // place a call to the specified numberthephone. talk ("4255551212"); // place a call to the specified number after // first prompting the user to verify the numberthephone. talk ("4255551212", true );
Outlook mobile
Personal Information Manager (PIM) data is the core of many mobile device applications, and Windows Mobile has provided excellent PIM systems in pocket outlook for many years. Windows Mobile 5.0 now uses the "Microsoft. windowsmobile. pocketoutlook" namespace and classes in the Assembly to publish the pocket outlook directly to hosted developers. With the new managed pocket outlook API, developers can easily merge PIM as part of their applications. Some common classes are displayed in table 3.
Table 3. Common pocket outlook hosting classes |
Class |
Description |
Outlooksession |
Represents the attributes of pocket outlook applications that expose email, SMS accounts, appointments, contacts, and tasks. |
Appointment |
Indicates the scheduled time of a piece. Includes attributes used to identify appointment details and display appointment reminders. Provides applications to handle events that receive notification of appointment changes. |
Contact |
Information records of individuals or organizations. More than 60 attributes are used to track different attributes of contact information through corresponding events, so that applications can easily track user or application changes to contact data. |
Task |
To-do list that can be sued. Contains the attributes that identify task details (including progress and how to display task reminders. Provides applications to handle events that receive Task change notifications. |
The new pocket outlook managed object model greatly simplifies interaction with pocket outlook applications. The following code shows how easy it is to add a new appointment.
Using Microsoft. windows Mobile. pocketoutlook ;//... // create the appointment and set the detailsappointment theappointment = new appointment (); // set the subjecttheappointment. subject = "MEDC precon"; // set the appointment to start on May 9, at 9:00. m. theappointment. start = new datetime (, 05, 09, 09, 00, 00); // The appointment lasts for eight hourstheappointment. duration = new timespan (08, 00, 00); // issue a reminder by having the device vibratetheappointment. remindervibrate = true; // repeat the reminder until the user dismisses ittheappointment. reminderrepeat = true; // create the outlook session and add the appointment // to the outlook appointment folderusing (outlooksessionsession = new outlooksession () {session. appointments. items. add (theappointment );}
Figure 1 shows the pocket Outlook calendar after the device runs the code above.
figure 1. pocket Outlook date created in