April 2006 - Posts

"Programming Outlook Mobile" Presentation and Sample Code Now Available

Thanks to all who attended last night's (Wednesday, April 19th) meeting of Club Pocket PC - Boston. The PowerPoint slides for my presentation, entitled "Programming Outlook Mobile with the .NET Compact Framework and Windows Mobile 5.0" , are now available for download from the BostonPocketPC.com web site.

For this presentation, I used the same sample application I used for the previous week's Boston .NET User Group presentation (which includes Outlook Mobile sample code and a whole lot more). That Visual Studio 2005 C# project can also be found at the BostonPocketPC.com web site.

Posted by Dons with no comments

The Mobile Devcasters Show - Episode 5 Now Available

After a far-too-long hiatus, Thom Robbins and I have finally gotten back on track with the Mobile Devcasters Show. Episode 5 is now available for download at the Mobile Devcasters web site -

"In this episode, Thom and Don play a little "catch-up", discussing upcoming major Windows Mobile developer events and some changes to the Mobile Devcasters Show. The main topic of the episode is Mobile Connected Application development, with Thom and Don talking ASP.NET 2.0, mobile web considerations, best practices and tips."

The "changes" we discuss are something that should have you subscribing to our RSS feed (if you have not already done so). Be sure to check it out!

Boston .NET User Group Presentation and Sample Application Now Available

Thanks to everyone that attended my presentation (Leveraging the New Windows Mobile APIs) to the Boston .NET User Group earlier this evening. As promised, the PowerPoint slides and C# sample application demonstrating the new Windows Mobile 5.0-specific managed APIs are both available at the BostonPocketPC.com web site.

Enjoy!

Posted by Dons with no comments

The Lowdown on SQL Server Everywhere Edition

On April 6th, 2006, Microsoft (via a SQL Server 2005 Update from Paul Flesner) announced a "new" product in the Microsoft SQL Server family - SQL Server Everywhere Edition (or "SQL Everywhere" for short, or "SQL/e" for shorter). At the time, I chose not to post about it until more official word came out. I did this for two reasons -

  1. My unofficial word would be just that - unofficial. Better to hear more information direct from the source;
  2. I would have to type a lot less if I simply pointed people in the right direction ;-)

Microsoft's own Steve Lasker has put together a good FAQ regarding SQL/e on his MSDN blog. In short, SQL/e is essentially SQL Mobile without the desktop limitations. As you may or may not be aware, SQL Mobile was authorized for use in developing Tablet PC applications as well as Windows Mobile applications. That was the extent of "desktop" deployment, however. This new structure allows for SQL Mobil... er, SQL/e to be used as an embedded database in any Microsoft OS environment.

Personally, I applaud this decision. I know that when the decision to allow Tablet PC deployments but not others first came out, a lot of folks in the .NET CF and Embedded MVP communities thought an broader expansion would be a good thing. Obviously, Microsoft listened (to MVPs and others) and responded. This change opens a number of possibilities for occasionally-connected application developers.

BTW - Steve Lasker has also posted about leveraging SQL/e in Visual Studio 2005 development. Really great article with useful information.

.NET Speech Server Day Tips and Tricks Presentation Now Available

Thanks to everyone for attending today's .NET Speech Server Day at the Microsoft offices in Waltham. As promised, my PowerPoint slides from the presentation can now be downloaded from the BostonPocketPC.com web site.

Enjoy!

Talk About Your Windows Mobile "Wins": Census Bureau Signs $600 Million Contract for Data Collection

Talk about a nice deal! AP is reporting that the U.S. Census Bureau has signed a 5-year, $600 million contract with Harris Corporation for data collection for the 2010 census that includes the deployment of Windows Mobile devices in the field by census takers -

The portable devices are being designed to allow census workers to immediately record information they gather when going door-to-door to American households, said Monty Wood, a spokesman for the Census Bureau.

While the devices (which will be manufactured by Taiwan's HTC) are critical for the collection of census data, they will not be used for other functionality (PIM, e-mail, etc). This will remain with the Census Bureau's RIM Blackberry devices -

Wood said the devices will not be used as cell phones or for other functions such as sending e-mail, and will not replace bureau employees' BlackBerry communicators.

"It's not like a BlackBerry," he said. "It's specified designed for the census 2010 application."

And here I was, getting worried that there weren't enough large-scale enterprise deployments of Windows Mobile devices for custom application usage... ;-)

Source: Yahoo! News

UPDATE: According to a Bloomberg article (spotted at Smartphone Thoughts - thanks, Mike!) , the deal equates to 500,000 devices (and an equal amount of Windows Mobile 5.0 licenses for Microsoft).

New Emulator Image for 320x240 Smartphone (with Landscape)

Some of you may or may not already know that the upcoming Motorola Q and Samsung i320 Windows Mobile 5.0 Smartphones have a couple of unique properties. First, they provide 320x240 screens. Second, they can function in landscape mode. Both of these capabilities pose new challenges to .NET Compact Framework developers.

Microsoft is now providing a new emulator image for developers. This new download adds a Smartphone emulator with both 320x240 dimensions and landscape support. In order to use this image, you must have Visual Studio 2005 and the Windows Mobile 5.0 SDK for Smartphone already installed. It is recommended that all Smartphone application developers download and install this image in order to test your existing applications.  

MessageInterception API Sample

What better way to follow up to my post on the Compact Framework / Windows Mobile 5.0 MessageInterception API than with a simple working sample? You can download this zip file from BostonPocketPC.com that contains a working Visual Studio 2005 project. The sample is targeted at a Windows Mobile 5.0 Smartphone, so you will also want to have the Windows Mobile 5.0 Smartphone SDK installed.

Simply compile the code and run! The application uses the right softkey to send an SMS to the "magic phone number" (+14250010001). Once sent, if the SMS is not modified (you have a chance to edit it before sending), the SMS will "boomerang back" to the emulator and (because it meets MessageCondition criteria) display an alert. The source code is also heavily commented for your reading pleasure ;-)

Posted by Dons with no comments

WOW - New T-Mobile SDA Smartphone For Only $29.99

I don't normally post on this kind of stuff, but this is just too good to let slide by...

Amazon.com has the new T-Mobile USA SDA Smartphone (for those who follow this, the SDA is code-named by HTC as "Tornado") with Windows Mobile 5.0, EDGE, WiFi and a nice QVGA screen for only $29.99 with service activation and a $200 rebate. I know, I know - You have to wait for the rebate and you have to sign a contract with T-Mobile USA. At $29.99 (did I mention free shipping, too?), this might just be worth the "pain points" :-)

It's times like this that I regret reading the RSS feed from Techbargains.com (thanks to them for pointing this deal out).

Posted by Dons with no comments

Using the SMS MessageInterception Managed Classes

Following up on my "why" post to using the new managed SMS Interception namespace with Windows Mobile 5.0 devices, I thought it might be a good idea to demonstrate the ease of implementing this type of functionality. In other words, show "how" in addition to "why" ;-)

To use the SMS message interception, perform the following steps -

  • In your Smart Device project, add references to to Microsoft.WindowsMobile, Microsoft.WindowsMobile.PocketOutlook and Microsoft.WindowsMobile.PocketOutlook.MessageInterception. It would also be a good idea to add these to your code with using statements.

    using Microsoft.WindowsMobile;
    using Microsoft.WindowsMobile.PocketOutlook;
    using Microsoft.WindowsMobile.PocketOutlook.MessageInterception;

  • There are two major objects you will be working with here. The MessageInterceptor (responsible for actual interception) and the MessageCondition (and object that sets up the criteria for messages to intercept). You will need to create instances of these two objects in the containing class.

    // For SMS Message Interception...
    private MessageInterceptor _SMSCatcher = new MessageInterceptor(InterceptionAction.NotifyAndDelete, true);
    // For setting up the message filter...
    private MessageCondition _SMSFilter = new MessageCondition();

    The constructor for MessageInterceptor has two significant arguments. The first allows you to define an interception action (what to do when a message is intercepted). Typically, these messages do not need to been directly seen or stored, so the NotifiyAndDelete enumeration of the InterceptionAction enumerator works well. The second argument sets whether or not to use the current form's thread. Usually, this is set to true, but if your application does not have a form, it would be set to false.

  • You will want to set up an event handler and event method for taking action when the event occurs. To do this, you will set up an event handler for the MessageReceived event of the MessageInterceptor. The standard Visual Studio functionality (using TABs to create the event handler and associated method) work here.

    //SMS Message Interception event handler...
    _SMSCatcher.MessageReceived += new MessageInterceptorEventHandler(_SMSCatcher_MessageReceived);

  • You will need to set up the MessageCondition object with the necessary filters/criteria and assign it to the MessageInterceptor.

    //SMS Message Filter setup...
    _SMSFilter.Property = MessageProperty.Body;
    _SMSFilter.ComparisonType =
    MessagePropertyComparisonType.StartsWith;
    _SMSFilter.CaseSensitive =
    true;
    _SMSFilter.ComparisonValue =
    "OutlookMobileDemo";

    //Assign the filter to the Interceptor...
    _SMSCatcher.MessageCondition = _SMSFilter;

    The Property property (redudant redundacy intended) is set to one of several values that represent what part of the message will be queried for the filter; the body of the message, the message class (technically, you can use transports other than SMS), the sender or the subject. For SMS, the Body or Sender enumerations are most commonly used. The ComparisonType property is used to describe what kind of comparison should be made (StartsWith, EndsWidth, Contains, Equal or NotEqual) to the Property selected. This is really up to you and your application needs. The CaseSensitive property can be used to further refine the selection criteria, and the ComparisonValue property is the actual text to use for comparison.

  •  Now, all you have left to do is to write your event code! I think it's important to note that the MessageInterceptorEventArgs object passed to the event handler contains the entire SMS message in it's Message property. By casting this property to an SmsMessage object, you can query all of the SMS message's information. As an example, I commonly demo the process in action by displaying a notification message (using the Notification control) to the user -

    void _SMSCatcher_MessageReceived(object sender, MessageInterceptorEventArgs e)
    {
       
    //Event args pass the SMS message...
       
    SmsMessage mySMS = (SmsMessage)e.Message;
       
    //Show a notification popup...
       
    this.notifyCustomIncoming.Caption = "New SMS";
       
    this.notifyCustomIncoming.InitialDuration = 60;
       
    this.notifyCustomIncoming.Text = "Got the special SMS! - " + mySMS.Body.ToString();
       
    this.notifyCustomIncoming.Visible = true;
    }

Posted by Dons with 1 comment(s)

Why Use Message Interception?

I was recently e-mailed by someone who was investigating some of the new managed APIs for Windows Mobile 5.0. While there were some technical questions, one of the "non-technical" questions immediately caught my attention -

"I noticed that it is possible to intercept SMS messages now. Why would anyone writing a business application want to do this?"

These are some of my favorite questions. For all of the "hows" that are out there, we sometimes forget about the "whys" - Why would this be useful, why would we consider implmenting this, etc. As developers, sometimes we can't see the proverbial forest through the trees. A seasoned developer should always ask the "whys" first; if there is no applicability to there task at hand, maybe they should save the "how" until it is really needed (focusing more on what they need to know versus what they'd like to know). As someone who has made a career of having to keep up with multiple platforms, technologies and languages over the years, this simple rule has managed to keep me sane (and get at least a couple of hours of sleep per night). But let's get back to the question at hand - why even use SMS interception?

There are any of a number of possible uses for SMS interception. Perhaps the Number One possibility I pass along to line of business application developers in Windows Mobile scenarios is adding push functionality. Because of the very nature of Windows Mobile devices and applications as "occasionally-connected", a common developer task is to synchronize data between the device/application and a remote data source. The mechanisms for this (merge replication, synchronization, Web Services, etc) are irrelevant to this discussion, because the greater question to be asked is not how should data be synchronized, but when. As a developer, you have two distinct choices -

  • Polling. Your application can poll for changes on the server, initiating a synchronization when a change is determined. Depending on the infrstructure of the server, this can be either easy or difficult and potentially costly in terms of resources.
  • Push notification. If the trigger mechanism for synchronization is a change on the server and the server knows that a change has occurred, wouldn't it be more effective for the server to simply let affected clients know of the change?

In many cases, push notification would be a desired alternative. Until recently, however, push notification was not easy to perform with Windows Mobile devices. Remember, these are not persistently-connected clients. The new managed MessageInterception namespace and objects provide an easy and effective way for an application to listen for "that special SMS message" that says "now would be a good time to connect".

As always, there are the considerations you should take into account with using SMS messaging as a push notification method -

  • You would need an SMS gateway server-side to enable the sending of the notifications. The good news here is that there are any number of free or low-cost SMS gateway solutions that are also easily programmable;
  • Potential cost of SMS messages. Many cellular plans (especially in North America) do not include SMS messaging, thus resulting in an addition per-message cost per user.
Posted by Dons with no comments

Upcomg Speaking Engagements

April looks to be a busy month for me as far as presentations are concerned. The list so far -

APRIL 6TH: .NET SPEECH SERVER DAY

Using the power of .NET, Microsoft Speech Server and Visual Studio 2003 can give your application its voice. Used in conjunction with the Microsoft Speech Application Software Development Kit (SASDK), this platform enables developers to write and deploy web-enabled speech applications to new and existing .NET applications.

Join Microsoft and Brooktrout for a one day special developer session designed to teach you how to architect, develop and implement speech enabled applications using Visual Studio 2003 and the Speech Server platform. We will show how this combination provides all the components necessary for building and deploying telephony (voice-only) and multimodal (voice/visual) applications. Additionally, we will show how the Speech Server platform builds upon the work of the open industry standard Speech Application Language Tags (SALT) specification to extend existing Web markup languages by adding speech recognition and prompt functionality to your Web applications. Using a practical code oriented approach we will cover how to architect, build and deploy applications that performs speech recognition and speech synthesis that can be accessed by telephone, cell phone, Pocket PC, Tablet PC and other devices.

Click here to register

APRIL 12TH: BOSTON .NET USER GROUP - "LEVERAGING THE NEW WINDOWS MOBILE APIS"
The .NET Compact Framework 2.0 provides a wealth of new APIs for Windows Mobile 5.0 devices. With managed access to Outlook Mobile, device and application state, phone, GPS and camera, there is something for almost all Windows Mobile Pocket PC and Smartphone developers to leverage in order to enhance their application.

Join us for this discussion and demonstration of how you can enhance your Windows Mobile 5.0 applications with a minimum amount of coding, using Visual Studio 2005 and the .NET Compact Framework 2.0.

Click here for more information

APRIL 19TH: CLUB POCKET PC - BOSTON - "INTEGRATING WINDOWS MOBILE APPLICATIONS WITH OUTLOOK MOBILE"
The .NET Compact Framework 2.0 now provides managed access to Outlook Mobile contacts, tasks, and appointments for Windows Mobile 5.0 devices. In this presentation, you will learn the "hows" for extending with and integrating with this commonly used set of functionality.

Click here for more information

Posted by Dons with no comments