Dec 11

I thought I would pass along a “good news/bad news” experience I recently had with regards to Windows Mobile 6.5, the .NET Compact Framework 3.5 and ActiveSync. Hopefully, it might serve to help someone in avoiding some coding and testing frustration.

I have been working on a project that requires responding to new incoming messages on Windows Mobile 6.5 devices. Fortunately, the State and Notification Broker API (“SNAPI”) made this simple enough. Now, my C# code needed to play a sound if certain conditions were met. Simple enough – the System.Media.SoundPlayer class in the .NET CF 3.5 would do the trick. Once the code was written, it was time to test.

The first test went according to plan. Use an emulator, deploy in debugging mode, set a breakpoint to ensure that I was hitting the correct branches in application logic and run with it. Sure enough, everything performed as expected. The next test was essentially the same, with the exception being connecting an actual Windows Mobile 6.5 device for testing. Again, there were no problems.

For the next test, I decided to remove the breakpoint in Visual Studio. I run the code and… no sound. My intellectual response - “WTF?!?!?” ;-)

I’ll keep the story brief here, omitting all the second-guessing and testing that went on up until my finally figuring out the root cause of the problem. The issue, as it turns out, is that -

  • SNAPI and the .NET Compact Framework 3.5 work very well. By “well”, I mean “fast”, especially when running on the latest hardware with Windows Mobile 6.5.
  • ActiveSync runs… well… about as fast as it always has on Windows Mobile, despite OS and hardware improvements.

Keeping in mind that ActiveSync and my application run on different threads, here is what I was able to determine:

  • ActiveSync begins a synchronization operation. As part of this sync, a new email arrives. Based upon device settings, ActiveSync prepares to play a sound and grabs resources.
  • At around the same time, my application receives the notification from the broker about a change in the unread email count changing. My logic has to do quite a bit of processing, but still managed to get to the point of playing a sound while ActiveSync still had a hold on resources. Result – my sound wouldn’t play.

“Fine”, I thought, “This is strictly a timing issue.” When I was in debugging mode, the stepping through the code and the latency associated with running in debug mode gave enough time for ActiveSync to complete. As a result, I decided to add code to pause my code to give time for ActiveSync to release resources. Here is where the real surprise came into play.

I spent quite a bit of time tinkering with the amount of time my application had to sleep in order to be able to play my sound. It took upwards of ten seconds for ActiveSync to release the resource I needed. When you consider the fact that ActiveSync had a “head start” on my code (AS was the cause of the SNAPI event firing, mind you), the amount of time from start to finish for AS was, well, A LOT. Ten seconds?!? Needless to say, I was very surprised and disappointed. This wouldn’t have surprised me a few years back, when slower hardware and slower network speeds could be the culprits. But today? With faster hardware and networks?

I guess the moral of this story is… If you are coding for Windows Mobile with a dependency on ActiveSync, NEVER assume performance. Code for the worst case and hope to be pleasantly surprised.

Aug 18

In case you haven’t heard, the first of the WinMoDevCamps is occurring tomorrow (8/19/2009) in Seattle. Just what is WinMoDevCamp, you ask?. Well, here is the answer, direct from the WinMoDevCamp web site -

WMDC004-background

“WinMoDevCamp is a series of upcoming not-for-profit gatherings to develop applications for the upcoming release of the Microsoft Windows Mobile 6.5 O/S. The event is currently being planned in 7 cities around the world. Our first Windows Mobile Developer Camp event has been scheduled for August 19 in Redmond, Washington at the Microsoft Campus. You can register now on the form below. Dates will soon be announced for the following additional cities: Austin, London, New York, San Francisco, Singapore, and Toronto. We will also encourage other mobile developers to host their own events on the same dates. This website will have facilities for local events to organize as well.”

The last sentence in this paragraph is the reason for this post. While a New York City event is planned, there is nothing set for Boston. This begs to ask the question -

If a WinMoDevCamp event was planned for the Boston area, would you attend?

If there is the interest in this event, we here at BostonPocketPC.com are willing to try and make it happen. However, no one likes having a party where no one shows up ;-) The best way to express your interest – send an email to winmodevcamp at bostonpocketpc dot com. Please don’t delay – the sooner we can gauge interest, the faster we can get the ball rolling!

Mar 18

Line of Business (“LoB”) developers for mobile devices typically face challenges in understanding the trade-offs and best practices for developing robust applications for resource-constrained devices. In an attempt to address these issues, Resco has announced Resco Business Prototypes, a new product line focused around common Line of Business solutions.

Bratislava, Slovakia — March 17, 2009 — Resco, a supplier of advanced developer components and tools for mobile devices, announces today new product line, which is optimized for Microsoft Visual Studio 2008 and the Microsoft .NET Compact Framework 3.5.

The most important features of current situation in the mobile software market are basically the overall grow of mobility, its utilization in business solutions and lack of experience in development of mobile solutions.

The most significant grow of demand in particular is in the field of business solutions with mobile upgrade. Mobility is very flexible tool that expands in a wide spectrum of business industries. Despite the fact that current mobile devices dispose of high performance hardware thus are able to run hardware demanding applications, the environment of mobile devices is much different from desktops. Desktop developers switching to mobile environment encounter many problems mostly due to the mobile limitations. Moreover, business solutions providers usually have neither the experience, nor the know-how of mobile environment.

Based on these reasons Resco decides to present new product line of business prototype solutions. The goal of these solutions is to help developers cope with the difficulties of mobile environment.

In the upcoming 6 months time perspective Resco will launch three business prototypes with source codes.

“Resco is very excited to have such opportunity to present brand new product line assigned for business solutions,” said Ivan Stano, Marketing and Sales, Resco Developer Tools. "I believe that the prototypes will serve as valuable help for all developers who care about perfect functionality and attractive graphics.”

The first prototype is focused on SFA solutions. It is especially assigned for sales people working in the field. Second prototype is targeted to retail — shopping sector and the third one to assets inventory management. The release of the first prototype is scheduled for April 2009.

More details are sure to come, but I do like the idea of providing solutions with source code, allowing for organizations to “jump-start” application development with guidance from a proven developer of Windows Mobile applications and tools. Resco has a long history of developing highly successful applications for Windows Mobile devices, and their developer tools are equally successful.

Tags:
Sep 13

Wow - where has the past month gone? It's time for our next monthly meeting. I was not sure if I would be able to be there myself, but now the answer is "yes", so...

The next meeting of the New England Windows Mobile User and Developer Groups will take place on Wednesday, September 17th starting at 6:30 PM at the Microsoft offices in Waltham, MA.

Map image

This month, we're having an "Open Mic" night. In other words - bring your questions, discussions and topics around Windows Mobile (and mobility in general). While Steve and I both have plenty of new news to fuel the conversation, I enjoy those occasional opportunities to have those really engaging conversations based upon what you are interested in. Don't forget - you're questions can be technical in nature as well, so any of you developers out there are more than welcome to join in.

As always, we will have lots of great items for our giveaway raffle.

See you there!

Tags:
Aug 14

Yes, Virginia - there will be a meeting of the Boston/New England Windows Mobile User/Developer group this month :-)

Our next meeting will be held on Wednesday, August 20th 2008 starting at 6:30 PM at the Microsoft offices in Waltham, MA (201 Jones Road, 6th Floor).

Map image

This month's meeting will have a developer "flavor", with two topics for discussion:

  • "Windows Mobile Device Configuration: A Developer's Perspective"
    While many people are aware of device management and configuration solutions available for Windows Mobile, developers are often surprised to discover that they have the ability to configure devices using the .NET Compact Framework from their own applications. In this presentation, we will look at some of the options available to allow your application to configure such features as WiFi, Bluetooth and more.
  • "Sync Me Up! Sync Services for ADO.NET and Sync Framework for Devices"
    As most developers will tell you, the process of developing a data synchronization framework for an application can be an extremely complex process. Microsoft is address this issue through the Microsoft Sync Framework. Two components within this framework include functionality for ADO.NET synchronization and a more generalized synchronization core functionality. If you are responsible for developing Windows Mobile application that moves data from device to server and back, than this presentation should be considered a "must-see".

As always, we will have lots of great items up for grabs in our end-of-meeting raffle.

Hope to see you there!

Tags:
Jul 16

I just finished posting up a review I did for Electric Pocket's FlipSide product at BostonPocketPC.com.

screen07

This is a great little application that provides a "finger-friendly" interface to music on your Windows Mobile device. When working with this product, I started thinking about some of the tracks that 3rd party vendors are taking when it comes to enhancing the Windows Mobile UI experience.

Any longtime user of the Windows Mobile platform can tell you that the interface is a little "long in the tooth". The first efforts made by Microsoft at correcting this have come at the home screen level with Windows Mobile 6.1 Standard (non-touchscreen devices and  the new "sliding panel" interface). I think this is a good first step for Microsoft, mainly because the sliding panel is not just about "eye candy"; it provides a more efficient navigation interface to the home screen. Microsoft is definitely not the only one working at the "top level" of customizing the UI, as work by HTC (with the HTC Home plug-in), Spb Softwarehouse (with Spb Mobile Shell) and VITO Technology (with their new Winterize application) are all trying to enhance both the style and substance of basic user interface navigation. However, the phrase "beauty is only skin deep" applies for the most part to this level of effort.

The next level of UI enhancement happens at the application level. While Microsoft has gotten a bit more involved in UI usability with newer applications (Live Search is a great and successful example of this), many of the standard applications (e-mail, contacts, tasks as examples) have changed very little in either their presentation or methods of interactivity for quite a while. Once again, there is some work around this from a third-party perspective. Several vendors have provided enhancements to contact viewing, and FlipSide picks up where Windows Media Player stops. However, even these applications stop at the "viewing level", often dropping to the standard application interface to create or update an existing item.

Enhancing the application level of Windows Mobile for both aesthetic and functional usability is the next great frontier for developers, be they Microsoft or third party. The real challenge here is to go to that next level in its entirety. The contact interface is a great example of an area that can be greatly improved upon by applying the lessons learned over the past few years from both a Windows Mobile and competitor perspective. Finger-friendly interaction, improved layout and greater readability can all find a place in the Contacts application. The same can be said for the other "standard" applications as well. The true challenge here is to not just look at adding graphics to "spice things up", but to look at those various input methods we've seen garner acceptance and apply them to make for a better user experience.

As a developer, I now find myself spending more time than ever asking myself the question "how can I make the user both use and like my application?" Far too often, I (and others) begrudgingly work with what we have simply because there is no alternative. The opportunity exists for all Windows Mobile developers to change that feeling. To those that have begun that change and are mentioned above - I applaud you for taking the first steps and encourage you to go further. For all the rest out there - here is your chance to push the user experience to the next level and gain greater user acceptance of your applications and the Windows Mobile platform in general.   

Tags:
May 09

I do a lot of demonstrations of prototype .NET Compact Framework applications. While you could capture screenshots and/or video of just the Device Emulator itself, there are times where you might want to add a bit more "sizzle". While you could spend time playing with custom skins for the emulator, you can save a lot of time and effort by simply allowing SOTI's Pocket Controller to come to the rescue.

Emu_PocketController

I have been asked on several occasions how I made a demo from the emulator look so good. Well, I finally decided to document the whole process for everyone's edification. Of course, to accomplish this you will need the following:

The following steps are shown using Microsoft Windows Vista Business and Windows Mobile Device Manager ("WMDC"). You can, however, do the same thing with Windows XP and ActiveSync (remember - Windows Mobile 6.0 requires ActiveSync 4.5 or higher).

  1. Before beginning the process, be sure that WMDC or ActiveSync is configured to allow for an emulator image to be "cradled". To do this, open WMDC and select "Connection Settings".

    emu_pc01
  2. Under the "Allow Connections to one of the following:", select DMA from the drop down list.

    emu_pc02

    Select OK when done.
  3. Start the Device Emulator Manager. If you are using Visual Studio, this can be found under the Tools menu option.

    emu_pc03
  4. Once the Device Emulator Manager is open, select the emulator image you wish to work with and right-click on it. Select Connect from the menu items shown.

    emu_pc04
  5. Your emulator image should appear after a brief period. Once it is up and running, return to the Device Emulator Manager. Again, right-click on your selected emulator image to bring up the menu. This time, select the Cradle option from the menu.

    emu_pc05
  6. Just like with a regular device, it might take a minute for things to "fire up". Just be patient. If you have never established a partnership between this emulator image and the desktop, you should get the prompt from WMDC to either establish a partnership or connect without setting up the device. Personally, I never establish a partnership between an emulator image and WMDC, but to each their own ;-)

    emu_pc06 
  7. Once successfully connected and cradled, you should be able to easily identify the state of things by looking at the Device Emulator Manager for a special "Connected icon".

    emu_pc07
  8. Now we are ready to configure SOTI Pocket Controller. Open the application, then go to the Start icon, then Settings then Settings again.

    emu_pc14 
  9. Under the Settings dialog, you will want to focus on Connection Profiles area. You can either select to use an existing profile or create a new profile.

    emu_pc15 

    Either choice will bring you to the Connection Profile dialog.
  10. In the Connection Profile, simply make certain that the Connection Type is set to ActiveSync.

    emu_pc08

    It is also in this connection profile that you can choose the device type that you (for lack of a better term) wish to pretend to be. For the maximum effect, you will want to check the View In Skin option and (if necessary) select the Skin Catalog... option to download the appropriate skin. Once completed, press the OK button.
  11. You are now ready to try to connect to the emulator with Pocket Controller. To do so, simply click on the Connect icon in the main screen of Pocket Controller.

    emu_pc16
  12. If you have never previously used this emulator image with Pocket Controller or you never saved the emulator image state after a previous install, Pocket Controller will inform you that it cannot find the Pocket Controller client on the device and that it must first be installed.

    emu_pc09

    Select Yes to start the installation. The install should be like any regular application installation for a Windows Mobile device. Once complete, you will receive the standard installation confirmation in the emulator.

    emu_pc10 
  13. You will now need to once again attempt to connect to the emulator image using Pocket Controller as shown in Step 11. This time, you may have to wait for a brief period and then receive a message regarding not being able to connect using "Auto-Sensing mode".

    emu_pc12

    Not to worry - simply select Yes to try connecting in Standard mode. Within a few seconds, a connection should be established. If you are prompted to change the connection profile to always use Standard mode, you can say Yes. If you are using this profile for regular devices as well as the emulator, you may choose not to reset the mode.
  14. You should now be connected and displaying the emulator in Pocket Controller!

    emu_pc13

There are a lot of great things you can now do. You can leverage Pocket Controller for screen captures (complete with skin), record video (again with skin included) and even do some troubleshooting using Pocket Controller's tools. When doing live demos this way, I usually minimize the emulator window, leaving only the Pocket Controller session active. It's fun to have someone ask afterwards "Where's the device you were displaying on screen for the demo?" ;-)

Hopefully this little tutorial will help some of you out, whether it is for demos, documentation or training.

Tags: