Category: Windows Mobile

  • More POOM Anomalies

    Every version of POOM (Pocket Outlook Object Model) brings great improvements, however there are always a few things which just have you screaming “Why!”. One of those examples is the implementation of IItem::Edit. This method is used to open an item in edit mode, and is implemented on Windows Mobile 5.0 and above, with the exception of Appointments on Smartphone (Standard) devices. This makes no sense because otherwise the Appointment item follows the same pattern as the other item types. A dialog is implemented on the Smartphone/Standard platform and this has a perfectly usable edit screen – why this wasn’t implemented in the API beggars belief. Below is a table of supported configurations for the various display methods:-

































































    Method WM 5.0 Pocket PC WM 5.0 Smartphone WM 6 Professional WM 6 Standard
    IAppointment::Display() Yes No Yes No
    IContact::Display() Yes No Yes No
    ITask::Display() Yes No Yes No
    IItem::Display() (Appointment) Yes Yes Yes Yes
    IItem::Display() (Contact) Yes Yes Yes Yes
    IItem::Display() (Task) Yes Yes Yes Yes
    IItem::Edit() (Appointment) Yes No Yes No
    IItem::Edit() (Contact) Yes Yes Yes Yes
    IItem::Edit() (Task) Yes No* Yes Yes

     


    *WM5.0 Smartphone Tasks application doesn’t support editing

  • Context Menu Extensions Windows Mobile 2003 versus Windows Mobile 5.0/6

    One of the features of Mobile In The Hand is the ability to add context menu extension handlers for the PIM applications from managed code. One of the problems with implementing this feature is that the behaviour of these applications varies subtly between versions and these differences are rarely documented from the developers perspective.


    One of these issues is the way that context menu extensions work with regard to multiple item selection. In Windows Mobile 2003 the Tasks and Contacts applications allow the user to select multiple items on Pocket PC using the stylus. When the context menu extension is called you can get the Oids of all the items selected. However in Windows Mobile 5.0 the Contacts user interface was changed and no longer supports multiple selection, but Tasks still behaves as before (Tasks has always been the neglected application of Pocket Outlook – just look at how limited Tasks was on Smartphones prior to Windows Mobile 6 Standard). However if you select multiple tasks on Windows Mobile 5.0 or 6 the context menu will only get the Oid of the first item. You therefore need to set your (and your users) expectations when using Context Menus within your solutions.

  • Windows Mobile Standard Landscape Shortcut Keys

    On a traditional Standard (nee Smartphone) device the start-menu items are arranged into a 3×3 grid, you can navigate these quickly using the numeric keypad. On a landscape device the items are arranged in a 4×2 grid so this is impractical. Instead the QWERTY keys are used, or to be exact:-













    Q W E R
    A S D F

    Another helpful feature which was introduced in one of the AKU updates to Windows Mobile 5.0 was a scrollbar so that scrolling off of the current page of menu items would advance to the next or previous screen of items (Equivalent to pressing soft-key “More” or Back button). The scrollbar give you a visual indication of where you are within the menu items which typically span 5 screens in landscape orientation.


    One part of the shell which has not received the same attention is the Settings screens. Unlike the Start Menu there is no scrollbar, you must advance to the next screen using the last list item (this is not offered as a soft-key item). This means that in landscape orientation only 6 settings items fit on a page. A few changes here would allow more items per screen and consistency with the start menu behaviour. On devices with a built in scroller such as the HTC S620, T-Mobile Dash etc you could quickly scroll through all the configuration items.


    Another place where this behaviour is not followed is the Pictures & Video application. Here the items are again arranged in a 4×2 grid on a landscape device however the key assignments are really wacky:-













    1 2 3  
    4 5 6  

    You can see that the application is hard-coded to use the numerical keys and so there isn’t a shortcut to select the righthand column.


    These help to illustrate another area where developing for multiple screen sizes and layouts can introduce complications. You should try to follow best practices to offer appropriate shortcut keys in your application, just be aware that even Microsoft have missed some of these issues in the platform itself.

  • 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.

  • 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

  • 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.

  • Emulator Images in the Windows Mobile 6 SDKs

    The Windows Mobile 5.0 SDKs shipped with a number of emulator images, and additional form factors were made available in separate packages at a later date when they were introduced with AKU2. Below is the list of emulator images which will ship with the Windows Mobile 6 SDK:-


    Windows Mobile 6 Standard



    • Windows Mobile 6 Standard (176×220)

    • Windows Mobile 6 Standard Landscape QVGA (320×240)

    • Windows Mobile 6 Standard QVGA (240×320)

    Windows Mobile 6 Professional



    • Windows Mobile 6 Classic (No Phone) (240×320)

    • Windows Mobile 6 Professional (240×320)

    • Windows Mobile 6 Professional Square (240×240)

    • Windows Mobile 6 Professional Square QVGA (320×320)

    • Windows Mobile 6 Professional Square VGA (480×480)

    • Windows Mobile 6 Professional VGA (480×640)


    Except for the square form-factors all of the Professional emulator images support screen rotation, the emulator rotates the device skin in place so that the screen is always shown in the correct orientation on the development computer.

  • Windows Mobile 6 SDKs Update

    Turns out the SDKs haven’t been abducted by aliens, James Pratt reveals the story here on the Windows Mobile blog. So if you missed them you’ll have to wait until 1st March for their official release.


    The good news is that there will be an update to the SDKs due out on May 1st with new emulator images, additional samples and documentation improvements. Lets hope that all my bug reports submitted on documentation errors in the current release are resolved in that release.

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

    When I previously posted the list of additional system properties I was using the Windows Mobile 6 SDK Documentation as a reference. Well it turns out that there are even more new properties, you can view them using Object Browser in your project but they aren’t included in the documentation. The other new properties are:-



    • CameraEnabled – This in addition to existing CameraPresent property
    • CellularSystemAvailable1xrtt
    • CellularSystemAvailableEdge
    • CellularSystemAvailableEvdo
    • CellularSystemAvailableEvdv
    • CellularSystemAvailableGprs
    • CellularSystemAvailableHsdpa
    • CellularSystemAvailableUmts
    • CellularSystemConnected1xrtt
    • CellularSystemConnectedEdge
    • CellularSystemConnectedEvdo
    • CellularSystemConnectedEvdv
    • CellularSystemConnectedGprs
    • CellularSystemConnectedHsdpa
    • CellularSystemConnectedUmts
    • ClamshellClosed
    • DeviceLocked
    • KeyLocked
    • LockStates – A combination of flags for Device, Key and Sim locks
    • SimLocked
    • PhoneTalkingCallStartTime