Professional Documents
Culture Documents
Develop For Windows Mobile 5
Develop For Windows Mobile 5
| Site Map
Go
The Beta Experience
On This Page Introduction Getting Started with Windows Mobile 5.0 Developmnet Windows Mobile 5.0 Productivity APIs
Introduction
Windows Mobile 5.0, the latest Microsoft operating system for mobile devices, was launched on the 11th of May 2005 at the Mobile and Embedded Developers Conference, Las Vegas, USA. It represents a significant step forwards with emphasis on increased user productivity, great multimedia support and increased options for OEMs and operators to differentiate their device offerings. The new operating system brings with it a whole slew of new APIs and interfaces that make application development simpler and more powerful. However, the best news of all is the arrival of an integrated development platform providing all the tools necessary to target this new release Visual Studio 2005. Although Visual Studio 2005 is currently in Beta you can use it to develop Windows Mobile 5.0 applications and even take them to market. This article will explore:
q
What Windows Mobile 5.0 brings in terms of new Productivity APIs What Windows Mobile 5.0 brings in terms of new Multimedia APIs
Windows Mobile 5.0 also introduces new managed libraries that work with .NET Compact Framework programs in addition to the expected Win32 API sets. Developers using C# or VB.NET can use these libraries from applications based on either version 1.0 or version 2.0 of the Compact Framework. This article will describe these new libraries but will not cover libraries that are part of the Compact Framework itself. By the end of the article, you should have a basic understanding of the new features available for your use in developing the next killer mobile application. As Visual Studio 2005 is still a Beta product at this time, information provided in this article is subject to change. However, Windows Mobile 5.0 is a released product and information is accurate at the time of writing.
Top of page
Note the entries labelled Pocket PC Magneto and Smartphone Magneto. Magneto was the codename for Windows Mobile 5.0 during development and these entries will be changed to reflect the release version of the name in due course. Now that we have the development environment ready, lets have a look at what Windows Mobile 5.0 brings to mobile developers. As mentioned in the introduction section of this article, Windows Mobile 5.0 is really about three things Increased Productivity, Great Multimedia and Differentiation. Differentiation is primarily the domain of device manufacturers and cellular operators. We will thus look at the APIs that application developers have access to in the areas of Productivity and Multimedia.
Top of page
not even have provided a means to get to the data. With Windows Mobile 5.0, the operating system has centralized its state information into a single store. What is more, an API set is now exposed so that you can access state information in a standard way. The new state store is based on the system registry and state is both recorded and monitored there. The states provided by the operating system are extensive and covers among other things:
q
Phone (e.g. Missed Call, Phone Status, Caller ID) Network Connections (e.g. WiFi, GPRS, modem) Calendar (e.g. Current and Next Appointments) Messaging (e.g. Unread Mail Count, SMS) Many others (e.g. Display Orientation, Cradled)
Additionally, you can extend the states tracked with custom states. The broker, through the API set, allows states to be changed or monitored for change. When a change is detected, a notification is sent to an application that can then react accordingly. You can have transient notifications, which work when the application requesting it is running. The notification takes the form of a window message, a callback or message in a message queue. The following example uses the RegistryNotifyWindow API to send a window message when phone signal strength changes.
#include #include // Set up the notification HREGNOTIFY hNotify = NULL; RegistryNotifyWindow( SN_PHONESIGNALSTRENGTH_ROOT, SN_PHONESIGNALSTRENGTH_PATH, SN_PHONESIGNALSTRENGTH_VALUE, hWnd, WM_MY_WINDOW_MESSAGE, dwUserDefinedValue, NULL, &hNotify);
However, the more powerful version is persistent notifications. This type of notification will cause your application to be started by the operating system if it isnt already running. Use the RegistryNotifyApp API to request this.
#include #include NOTIFICATIONCONDITION nc; nc.ctComparisonType = REG_CT_EQUAL; nc.TargetValue.dw = 1; nc.dwMask = 0xFFFFFFFF; RegistryNotifyApp( SN_CRADLEPRESENT_ROOT, SN_CRADLEPRESENT_PATH, SN_CRADLEPRESENT_VALUE, TEXT("OSServices.CradlePresent"), TEXT("\"\\Program Files\\OSServices\\OSServices.exe\""), NULL, NULL, 0, 0, &nc);
using Microsoft.WindowsMobile.PocketOutlook; . . . using(OutlookSession outlookSession = new OutlookSession()) { Contact contact = new Contact(); contact.FirstName = "Joe"; contact.LastName = "Bloggs"; contact.MobileTelephoneNumber = "+00 (0) 123 456 7890";
http://www.microsoft.com/emea/msdn/betaexperience/nlarchive/issue_3/develop_for_windows_mobile_5_with_visual_studio_2005.aspx (5 of 6)19-10-2005 0:58:43
outlookSession.Contacts.Items.Add( contact ); }
It is clear from the above code that the new model is extremely concise and readable.
Pocket PC Soft-keys
On Windows Mobile 5.0 Pocket PC devices, you will find the addition of two hardware keys in similar positions to those that exist on the Smartphone today. These keys, called soft-keys, are designed to relate to menu items immediately above the keys bringing a consistent look and feel across both Pocket PC and Smartphone platforms. Pocket PC applications can now lay out their menu structure to take advantage of these keys and provide quicker access to application functionality for the user.
Top of page
Manage Your Profile 2005 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement