Category: Windows Mobile

  • Mobile In The Hand 4.0 Released

    Today we put the final touches to Mobile In The Hand 4.0 and have released this latest version of the suite. This is a major reworking of the code and the library is now broken into 10 separate dlls so you only need to deploy the specific functionality you require in a project. We have also added some additional functionality alongside the code libraries themselves to add “My” keyword functionality for Visual Basic users and make it easier to incorporate and edit provisioning XML documents. Over the next few weeks I’ll be posting a number of blog articles to highlight new features and elaborate on some of the less visible features.

    Full details of the library are available on the product page.

  • Home and Visiting Clocks in Professional Edition

    In Professional Edition (Pocket PC) devices the Clock control panel allows you to set a home timezone and a visiting zone and lets you toggle between them. If you need to retrieve the current settings they are stored in the registry in a key called HKEY_LOCAL_MACHINESoftwareMicrosoftClock in a binary value called “AppInfo”. Here is breakdown of that data:-

    00,00,00,00,31,00,00,00,55,00,00,00,00,00,00,00,01,00,00,00,80,01,00,00,be,00,00,00,00,00,00,00,00,00,00,00

    The first 4 bytes contains an integer which is 1 if in the home zone, and 0 if visiting.

    The next 4 bytes always seems to be 0x31

    The next 4 bytes are the index into the timezone collection of the home zone (In this example 85 GMT)

    The next 4 bytes are unused

    The next 4 bytes indicate whether to use DST (In this example 1 true)

    The next 4 bytes are always 0x180

    The next 4 bytes are the index into the timezone collection of the visiting zone (in this example 190 – New Delhi)

    The next 4 bytes are unused

    The next 4 bytes indicate whether to use DST in visiting zone (In this example 0 false)

    I suspect that the unused values may be connected to the old Cities feature which was originally in the control panel but removed with PPC2003. You may be wondering how to get the timezone information at the specified indexes – in Windows Mobile they are not all stored in the registry as on other Windows CE flavours. They are accessible through POOM – IPOutlookApp.GetTimeZoneFromIndex, or in managed code in Mobile In The Hand.

  • Using RemoteWipe

    With Windows Mobile 5.0 AKU2.0 (Messaging & Security Feature Pack) a new feature was implemented called RemoteWipe. This allowed an administrator to remotely wipe a device if it may have got lost and was designed to remove all sensitive data from the device and return it to a fresh state. It was only with Windows Mobile 6 that the details of the implementation were added to the SDK documentation. Like most other administration and device management features RemoteWipe is implemented as a Configuration Service Provider, this allows it to be activated either via remote or local means. For example you could build a mechanism into your software where you wish to wipe the device, perhaps after an extended number of failed password entries etc. Whether you can call the CSP will depend on the particular security policy on the device, however if possible you can initiate a wipe locally with either DMProcessConfigXML or the managed ConfigurationManager e.g.

    System.Xml.XmlDocument cd = new System.Xml.XmlDocument();
    cd.LoadXml(
    “<wap-provisioningdoc><characteristic type=”RemoteWipe”><parm name=”doWipe” value=”1″/></characteristic></wap-provisioningdoc>”);

    System.Xml.XmlDocument xd = ConfigurationManager.ProcessConfiguration(cd, true);


    Of course you use this code snippet at your own risk, if it works successfully it will wipe data from your device and return to factory fresh condition!


    More details about the service provider here:-


    http://msdn.microsoft.com/en-us/library/bb737595.aspx

  • Disable Windows Mobile 6.1 Threaded SMS View

    There may be an occasion where you want to restore the original chronological view for the SMS Inbox rather than the new threaded view. One example is where a system programmatically moves or inserts SMS messages into the system because these are not visible in the threaded view (even though the count of unread messages increases). There is a simple registry fix to turn off threading and restore the “classic” view. From the registry editor of your choice browse the device registry for the key:


    [HKEY_CURRENT_USERSoftwareMicrosoftInboxSettings]


    Under this add a new DWORD value called “SMSInboxThreadingDisabled” and set it to 1. Close the tmail.exe application or soft-reset the device and the regular message view will be used. Set this registry value back to 0 or delete it to restore the default threaded view.

  • New Windows Mobile 6.1 Screen Resolutions

    The release of Windows Mobile 6.1 brings a number of improvements for users but retains the same SDK and libraries as 6. The devices ship with .NETCF 2.0 SP2 in ROM. 


    This release adds additional screen resolutions to both the Professional (touchscreen) and Standard (non-touchscreen) editions. For Standard edition these are all 131 dpi and consist of 320×320 square and 400×240 and 440×240 landscape. For Professional there are 240×400 and 480×800 portrait screens. Once again these additional screen sizes emphasize the importance of making sure your app dynamically adjusts to make best use of screen space, for example using the Windows Mobile Line of Business Accelerator 2008.


     



    The images (currently US English only although localised versions should follow) are available to download here:-


    http://www.microsoft.com/downloads/details.aspx?FamilyID=3D6F581E-C093-4B15-AB0C-A2CE5BFFDB47&displaylang=en

  • Determine Platform – .NETCF 3.5 and earlier

    One of the new features in v3.5 of the Compact Framework is the ability to easily detect the platform you are running on from Smartphone (Standard Edition), PocketPC (Classic or Professional Editions) or WinCEGeneric (Everything else). The code is very straight-forward:-


    using Microsoft.WindowsCE.Forms;

    if(SystemSettings.Platform == WinCEPlatform.Smartphone)
    {
       //do something smartphone specific…
    }

     


    In the latest (v3.0) version of Mobile In The Hand I’ve implemented a matching property, so for the above code sample you’d just change the using statement to use InTheHand.WindowsCE.Forms and the code would work the same way. This is available in both the .NETCF v1.0 and v2.0 builds of the library.

  • Fix: SMS Interception on T-Mobile Dash

    A number of customers have been reporting issues with SMS interception on the T-Mobile Dash handset. On these devices the SMS interception does not work through either the Microsoft or In The Hand class libraries. This is specific to the T-Mobile ROM as other branded versions of the same device, such as the HTC S620, do not have the problem. The culprit is a badly behaved IMessageFilter implementation which stops the standard interceptor from working. You can fix this issue by removing the entry from the registry. Take a look at this registry key:-


    HKEY_LOCAL_MACHINESoftwareMicrosoft/Software/Inbox/Svc/Sms/Rules


    In here you’ll find 2 entries by default on Windows Mobile 5.0:-


    {1000BC1C-F4A3-4210-B197-4AEBF2CEE6F5}


    {77990A0E-60B8-4103-B9AF-17157E4274FD}


    If you find additional entries here try deleting them (make a backup first so that you can restore if necessary) then reset the phone. This should allow the normal SMS interception mechanism to work again.


    On Windows Mobile 6 the above registry key is not present by default, therefore the standard SMS interception will work without any additional rules registered.

  • HTC S620 Windows Mobile 6 Upgrade Experience

    Late last week HTC quietly released the Windows Mobile 6 upgrade for the S620. A few eagle eyed bloggers posted about it. The first thing I found was that the upgrade process doesn’t work with Windows Vista, when it reboots the device into bootloader mode the computer fails to connect. I had to run the upgrade from a Windows XP machine (where it worked flawlessy). Upon rebooting I had a fresh clean Windows Mobile 6 device. I noticed that HTC had left the default “Mobile Operator” screen during boot up, only after running its initial setup was this removed. Everything was working great, I was able to setup my exchange server in ActiveSync and get all my PIM data back onto the device. The lock dialog is slightly altered in this release, rather than tapping the right softkey to cancel you have to tap the right soft-key to open the menu and select the second option (option 1 is “Reset Password” but is disabled). The reason I often cancel this screen is because I just want to check the home screen for the time / next appointment. The time can optionally be displayed on the unlock screen but only for the key lock, I no longer use that because my exchange provider enforces a password.


    There are a few fancy UI features, the improvements to the calendar day screen are welcome along with the ability to edit task items. Essentially there are few differences to Windows Mobile 5.0 in the look and feel and layout of start menu and applications. One interesting change is that the alarm can now be set to operate only on weekdays, or every day. It’s still not as flexible as other approaches, and the default sound applied to the alarm is rather alarming to say the least!


    With my initial success I then tried docking the device with my main Vista machine. On this machine I’m running the latest Windows Mobile Device Center 6.1. When I connected the S620 popped up a message telling me to upgrade to ActiveSync 4.5 or later on my PC. Fellow MVP Jaap van Ekris was able to point out a simple workaround. Just go to Start > Settings > Connections > USB to PC and uncheck “Enable advanced network functionality”. It now partners correctly with my Vista machine.

  • Using the UnInstall Configuration Service Provider

    Among the Configuration providers in Windows Mobile is one which allows you to programmatically uninstall package from the device. The UnInstall provider is documented here:-


    http://msdn2.microsoft.com/en-us/library/aa455977.aspx


    To see if your package can be uninstalled you send the following XML – e.g. using DMProcessConfig.XML or ProcessConfiguration in managed code.


    <wap-provisioningdoc>
       <characteristic type=”UnInstall”>
          <characteristic-query type=”YourAppName”/>
       </characteristic>
    </wap-provisioningdoc>


    Replacing YourAppName with the name of your installation package usually “CompanyName Product” as defined in your device CAB project. The response will look something like this if the package name is found:-

    <wap-provisioningdoc>
    <characteristic type=”UnInstall”>
    <characteristic type=”YourAppName”>
    <parm name=”uninstall” value=”0″/>
    </characteristic>
    </characteristic>
    </wap-provisioningdoc>

    Then you can uninstall the package using:-


    <wap-provisioningdoc>
       <characteristic type=”UnInstall”>
          <characteristic type=”YourAppName”>
             <parm name=”uninstall” value=”1″/>   
          </characteristic>
       </characteristic>
    </wap-provisioningdoc>

  • Desktop ActiveSync Registry Settings

    In March I showed how to get the version of a connected device from the desktop. This post documents the rest of the registry settings used to store device information. There are two registry locations, the first at HKEY_CURRENT_USERSoftwareMicrosoftWindows CE Services contains information about the currently connected device. The second, HKEY_CURRENT_USERSoftwareMicrosoftWindows CE ServicesPartners contains information for each of the partnerships established on the desktop PC.


    When the device is docked, regardless of whether a partnership is established, the following keys are populated in HKEY_CURRENT_USERSoftwareMicrosoftWindows CE Services:-



    • DeviceHardwareId -String containing a unique Guid for the device

    • DeviceOemInfo – OEM specific string (as returned by SystemParametersInfo using SPI_GETOEMINFO) e.g. WIZA200 (HTC Wizard)

    • DeviceProcessorType – DWORD value – 2577 (ARM) for all Windows Mobile devices

    • DeviceType – string containing platform type (as returned by SystemParamtersInfo using SPI_GETPLATFORMTYPE) e.g. PocketPC or SmartPhone

    • DeviceVersion – DWORD value – see my previous post.

    The partnerships are stored with a unique DWORD partnership id e.g.


    HKEY_CURRENT_USERSoftwareMicrosoftWindows CE ServicesPartners12345678


    There are additional values to describe sync behaviour and some Windows Mobile Device Center specific values e.g. to specify the display icon for a device. Otherwise all of the above values are duplicated here for the partner device, except with some naming differences:-



    • DeviceHardwareId

    • OemInfo

    • ProcessorType

    • DeviceType

    • Version

    Each partnership has a directory containing any resources used, this includes the icon etc. The path is retrieved from the DataFolder value. This is a path beneath the users roaming application data folder which you would get using System.Environment.GetFolder(System.Environment.SpecialFolder.ApplicationData)


    The icon is specified in DeviceIconFile and if you append this to the path you’ll have the full filename of the icon.