Blog

  • Fabien Decret is now blogging

    Fabien is a French mobile developer who regularly posts answers to the Compact Framework newsgroup. He has started blogging and already posted on a number of Windows Mobile and Visual Studio topics in both French and English. You can view Fabien’s blog here:-


    http://fabdecret.blogspot.com/

  • New Sounds sample in Windows Mobile 6 SDK Refresh

    The Windows Mobile 6 SDK Refresh is available today. It includes some documentation enhancements and new samples. One of these is called RingtoneManager and is a C# application which wraps all the Sound APIs for ringtone management and sound playback, the latter of which were introduced with Windows Mobile 6. This is great because it gives you all the P/Invokes etc you need to use this functionality yourself. However expect to see these Windows Mobile specific APIs in the next version of Mobile In The Hand.

  • Book done, MEDC next!

    We’ve finished all the writing for the book, and it’s now winging it’s way to the printers. This week I finished converting all my sample code to Visual Basic so that we’ll have two versions of all the sample code in the book. I have to thank all of the people behind the book, the team at MS Press and my fellow authors for making my first writing experience such a pleasant one. I’m eagerly looking forward to seeing the finished book later in May. Just when I thought it was safe to kick back and relax I’ll be off to Las Vegas for MEDC 2007 on Monday.


    This years event promises to be a great one – lots of content on Visual Studio Orcas, .NETCF 3.5 and a refreshed version of the Windows Mobile 6 SDKs. I’ll be taking part in one of the panel discussion session, along with my fellow authors, members of the .NET Compact Framework team and OpenNETCF. The session is on both Wednesday and Thursday so you should find one to fit your schedule.


    I look forward to seeing you in Las Vegas!

  • Deprecated APIs in Windows Mobile 6

    Over on the Windows Mobile Developer Wiki is a topic listing all the APIs and technologies which are deprecated in Windows Mobile 6. This is essential reading for any Windows Mobile developer:


    http://channel9.msdn.com/wiki/default.aspx/MobileDeveloper.DeprecatedFeaturesInWindowsMobile6

  • Determine Version of Connected Device

    When your device is synchronised with ActiveSync (or Windows Mobile Device Center in Windows Vista) a number of device properties are written to the registry. This allows you to gather information on the device during a custom installation or from a desktop application. One of these properties is the version number of the device, the exact key is:-


    HKEY_CURRENT_USERSoftwareMicrosoftWindows CE Services


    The version is stored in a DWORD value called “DeviceVersion”, its contents look like this:-


    0x1560105


    As raw bytes it would be {0x5, 0x1, 0x56, 0x1 }. The first byte represents the major version number, the second is the minor version and the last two bytes together are the build number e.g. 0x156 = 342. Putting that all together shows that my connected device is returning version:


    5.1.342


    Which is exactly what I can see on the Settings > System > About screen for the device (which is a Pocket PC running Windows Mobile 5.0 AKU 3.0).

  • TomTom In The Hand 6.1

    I’ve been a bit quiet over the past few weeks, on vacation and at the Microsoft MVP Summit. I’ve also been working on the TomTom In The Hand library and today have released a new version.


    It turns out that TomTom SDK 6 shipped with a known bug that prevents you from passing negative co-ordinates into any of the methods (returned values were okay). At the moment I believe that our library is the only one which has a fix for this bug which was a major headache for developers. You can now use TomTom through this library wherever you reside in the world (assuming you have map coverage of course) without making any changes to your existing code.


    This release also adds some new functionality – The RawGpsReceived event on the Navigator object allows you to receive NMEA data from TomTom which allows you to share this data if you are not already using a multiplexer such as the Windows Mobile 5.0 GPS service or Franson GPS Gate or similar.

  • Personal Area Networking in the Delphi Magazine

    John Penman has written an article in the March edition of Delphi Magazine entitled “Simple Wireless Networking with Delphi for .NET” which describes using the 32feet.NET library from Delphi code. It walks the user through each of the areas of functionality in the library: IrDA, Bluetooth and Object Exchange. Its written for the v1.6 version, but the object model in the latest v2.1 version is a superset so the code will work with the latest version.

  • What’s New For Managed Developers In Windows Mobile 6 (Part 3)

    Thankfully after the previous false-start the Windows Mobile 6 SDKs are now back online and here to stay.


    In the last post, I looked at new properties in the Microsoft.WindowsMobile.Status namespace. It turns out that there are some minor improvements in the Microsoft.WindowsMobile.Forms namespace too. The ChooseContactDialog gets a few new properties:-



    • FilterRequiredProperties – When true only contacts with the properties specified for RequiredProperties will be shown. This was default behaviour in Windows Mobile 5.0

    • EnableGlobalAddressListLookup – When true allows the user to also search the GAL (if available)

    • IncrementalFilter – Contains the text of the filter box at the top of the dialog.

    • NoUI – No UI is shown at all (Not sure exactly why you’d want to do this…).

    • NoUIOnSingleOrNoMatch – If only a single outcome is possible the ShowDialog method returns immediately without prompting the user.

  • Programmatically Activating Speakerphone

    Windows Mobile devices, both Smartphone and Pocket PC support Speakerphone functionality. When operating through the Phone application the end user can toggle the state, up until now there has been no documented way to achieve this through code. Last year I investigated the issue on behalf of one of my readers and failed on several attempts at simulating a press-and-hold of the green phone button. It turns out that the device issues a specific key constant to change the state, and this can be simulated through code. It also turns out that the constant is equivalent to VK_F16 (thats Keys.F16 for managed code). I’ve wrapped up the necessary P/Invoke into the following code:-


    public sealed class SpeakerPhone
    {
    private SpeakerPhone() { }

    /// <summary>
    /// Toggles the SpeakerPhone state.
    /// </summary>
    public static void Toggle()
    {
    //keydown
    NativeMethods.keybd_event((byte)Keys.F16, 0, 0, 0);
    //keyup
    NativeMethods.keybd_event((byte)Keys.F16, 0, NativeMethods.KEYEVENTF_KEYUP, 0);
    }

    internal static class NativeMethods
    {
    internal const int KEYEVENTF_KEYUP = 0x0002;


    [System.Runtime.InteropServices.DllImport(“coredll.dll”)]
    internal static extern void keybd_event(byte bVk, byte bScan, int dwFlags, int dwExtraInfo);
    }
    }


     


    Since this just toggles the state, you can’t determine the current state at any particular time. This code has been tested on Windows Mobile 5.0 and beyond (It possibly works on Windows Mobile 2003 but I haven’t tested), it doesn’t work on the Windows Mobile 5.0 Emulators as Speakerphone isn’t implemented. I was able to establish a call on speakerphone using the following code:


    Microsoft.WindowsMobile.Telephony.Phone p = new Microsoft.WindowsMobile.Telephony.Phone();
    p.Talk(“01234567890”);
    SpeakerPhone.Toggle();


    Once the call is ended the speakerphone state is restored on subsequent calls.

  • Richard Jones is Blogging

    Richard has just started blogging, starting with a sample for maximising screen space by creating a Vista style textbox with integral label, and a description of what he has been up to in the fight against “Monkey Code“. I’ve subscribed to his RSS feed and added him to the blogroll.