Smartphone.Enabled();

Tags: .NET, C#, Mobile, Windows Mobile 6

I have finally decided to upgrade from your average Joe cell phone to a Windows Mobile 6 enabled Smartphone (not a touch screen device).  I got myself a HTC Shadow via Ebay.  Its branded to T-Mobile but unlocked so I can use it up here in Canada.

I must admit Microsoft has done a real nice job on the software for these devices.  The Windows CE OS/Windows Mobile 6 feature set is rich and useful. 

Since I live, eat and breath Microsoft .NET the fact that I can write up a bit of code and deploy it to my device (or emulator) in seconds is just fantastic.  The last time I was involved with writing anything for mobile was for the JVM world, and it was a less than stellar experience.  Kudos goes out to the VS.NET IDE, and Mobility teams at Microsoft for making this extremely painless.

One thing that the HTC Shadow came with is the Neo Interface (look at some of the Videos on it on youtube or something).  This interface has very polished feel and is quite usable.  I did some hacking around and most if not all of the settings exist in the registry.  After a few quick hacks I found out how to easily manipulate the Neo UI items.  Most of the leaf nodes just call out to executables.

What I really wanted to add was a shortcut to dial my voice mail and automatically punch in my access code (yes, I know this is not very secure).  For the life of me I couldn’t find any executable on the device that you can add some command line arguments and it will place the call.  Google offered little or no help tracking down the right executable to use.  The fact that this doesn’t exist gave me my first useful WM6 code snippet.

Code Snippet – cDialer.exe

using Microsoft.WindowsMobile.Telephony; namespace cDialer {    
  class Program  {       
    static void Main(string[] args)
{
            if(args == null || args.Length <= 0) return;
            string number = args[0];
            string prompt = "true";
            if(args.Length>1) prompt = args[1];
            bool p = true;
            try { p = bool.Parse(prompt); } catch(System.Exception) { }
            Phone phone = new Phone();
            phone.Talk(number, p);
        }
    }
} 

This is compiled for Windows Mobile 6 Standard SDK as a Console Application and placed into the \Windows\  folder.

So, in the entry for the menu item all I need to do is specify something like:

\windows\cDialer.exe; 6045555555p123456789#p1

The “p” instruct the dialer to wait a second or two.

You can also create a file:  CallVoiceMail.lnk with the contents:

110#"\windows\cDialer.exe" "6045555555p123456789#p1" "true"

The 110 indicates the number of characters after the # mark and the rest should be obvious.

 

1 Comment

Comments have been disabled for this content.