Introducing Windows Mobile 5.0

Earlier this year, the successor to Windows Mobile 2003 development platform was released, which was codenamed Magneto. Magneto overcame a lot of limitations of its predecessor such as SMS capability, Managed POOM (Pocket Outlook Object Model), system state notification and many more. Magneto was released as WM5.0 (Windows Mobile 5.0), building over the Windows CE 5.0 OS.

You can program for WM 5.0 using Visual Studio 2005 Beta 2 and can download the SmartPhone and PocketPC SDK for Windows Mobile 5.0 from http://msdn.microsoft.com/mobility/. Once you install it, you will see the relevant project types showing up in the 'Smart Device' project folder as shown in the screenshot.

By default, the applications built using the templates will target .NET Compact Framework 2.0. However, you will notice that there are a few templates that have '1.0' specified in their titles. 

This indicates that selecting such a template will let you develop a Windows Mobile 5.0 application aimed at .NET Compact Framework 1.0. Thus, it supports both versions of the .NET Compact Framework-a feature of Microsoft Visual Studio 2005.

In this article, we will discuss such and other enhancements, specifically in Windows Mobile 5.0. 

New namespaces
Windows Mobile 5.0 encompasses its enhancements in the following five namespaces.

Microsoft.WindowsMobile.PocketOutlook
This namespace is the managed interface to the Pocket Outlook Object Model, better known as POOM. It allows you to work with the contacts, tasks, appointments that are synchronized with your desktop.

The SDK provides project templates aimed at the 1.0 and 2.0 releases of the .NET Compact Framework 

You can create, edit and delete them-get notifications as to when a delete or modify operation has taken place upon a POOM object (using native APIs) and even create custom properties and assign them to a POOM object.

Apart from this, it contains functionality for you to send SMS via managed code-and also intercept them!

Microsoft.WindowsMobile.Telephony
This namespace contains a single class-Phone-that allows you to make phone calls. The class has a single method-Talk-that will do the needful as shown below.

Phone objPhone = new Phone();
objPhone.Talk(txtNumber.Text);

Microsoft.WindowsMobile.Status
Have you ever thought about writing mobile applications that could respond when the system state changes? For instance, how about an application that would be automatically launched if you got a missed call and automatically send the caller an SMS indicating that you are not available and also send you an e-mail giving details about the call.

Well, now this is possible. The 'System State and Notification Broker' has both managed and unmanaged APIs that will notify your application for the registered state change. There are over 100 potential states that you can be notified about-ranging from battery status to new e-mail to SMS messages received to change in the network operator.

Microsoft.WindowsMobile.Forms
Working with the camera of your mobile device, or selecting contacts from the POOM contact list was a thing you could not do earlier. 

This namespace contains functionality for you to pop up a dialog to the user to select a Contact, or a Picture, or even click on pictures or shoot video using a simple managed API! As expected, even the unmanaged API now supports it.

Working with SMS
Capability to send SMS is one of the key features of Windows Mobile 5.0, available in both PocketPC and SmartPhone SDK (yes, there are certain features that are not common across the platforms!). Getting to send SMS from your application is as simple as doing the following.

  • Create a Windows Mobile 5.0 PocketPC or SmartPhone project and add reference to 'Microsoft.WindowsMobile.PocketOutlook' assembly.
  • Import the 'Microsoft.WindowsMobile.PocketOutlook' namespace. Work with the 'SmsMessage' class as shown below.

SmsMessage sms = new SmsMessage();
sms.To.Add(new Recipient("+14250010001"));
sms.Body = "Testing the SMS API of WM 5.0";
sms.Send();

The above snippet sends an SMS to the number enclosed as a 'Recipient' object. Infact, the number used above can be used by the SMS API or the Phone API (discussed earlier) to try the APIs within the emulators of Windows Mobile 5.0. 

Thus, when a call is made to this number, the emulator intercepts it and dials a fake call. Likewise, when an SMS is sent to this number, the emulator intercepts it and sends the SMS to itself. 

Thus, the developer experience is quite realistic in terms of how the application will behave.

What's next?
This is just a basic introduction to some of the new features of Windows Mobile 5.0. 

Next month, we shall take this ahead and see how we can write applications that can intercept SMS and also understand the System State Notification Broker. 

Meanwhile, you can use the code, we have put in the PCQEssential CD, that comes with the article, to try out Windows Mobile 5.0.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值