# Wednesday, August 05, 2009

Samsung Release Windows Mobile SDK 1.2

This latest release adds new APIs for FM Radio and devices with front and back cameras. The radio control allows you to turn on/off the radio, go to a specific frequency, seek up or down and read RDS data. You'll need to uninstall the previous version if you have it before installing this package. So if you develop for Samsung devices what are you waiting for - grab the download here:-

http://innovator.samsungmobile.com/down/cnts/toolSDK.detail.view.do?platformId=2&cntsId=4604

#    |
# Wednesday, July 29, 2009

Roamin' Umpire

When a mobile system requires a data connection in the field you accept incurring a certain cost to establish a GPRS connection. You may be lucky enough to have an unlimited plan or you may be billed based on the volume of data you use. Either way reducing the amount of data you send and receive is valuable as it will reduce the time taken to synchronise data improving the user experience and reducing load on your servers.

However have you considered what happens when you take the device out of your home network? Roaming data charges can vary from high to extortionate and you probably won't have the luxury of a flat usage plan. In fact in a lot of cases you might want to restrict the application when used outside of the normal operating network - either to stop all data communications or to limit them to a minimum and perhaps only synchronise when the user manually initiates it rather than on a regular schedule. If you look at a couple of synchronisation applications - ActiveSync or Live Mesh for example these have a checkbox option to disable a synchronisation schedule when the device is roaming on a foreign network - the user has to actively change this before the device will automatically connect and synchronise data. This can be quite a good model to follow in your own applications. You may alternatively decide to set this behaviour based on a central policy rather than letting the user choose.

In order to react to changes in the network you can use the State and Notifications Broker which exposes a property with the current roaming status - SystemState.PhoneRoaming which is a boolean property. Because you can trap this event you can react as soon as the device registers on a foreign network or when it returns home and customise your code accordingly. Unfortunately not all applications are this considerate - Microsoft's MyPhone client will continue to sync automatically unless you disable scheduled synchronisation while roaming - the opposite behaviour to their other applications. Let's hope this is tweaked in a software update to help avoid nasty surprises!

#    |
# Thursday, April 09, 2009

Emulating Bluetooth

Alex Yakhnin pointed out this interesting article over on CodeProject showing how to use Bluetooth from within the Windows Mobile emulator:-

http://blogs.msdn.com/priozersk/archive/2009/04/09/bluetooth-on-the-emulator.aspx

Unfortunately it does require you to replace the stack on your host machine with FreeBT which is currently in Alpha so have a look through the Troubleshooting section for known issues first. I know lots of people have requested this for when they don't have access to a real device so it may be useful for demonstrating applications or debugging even...

#    |
# Friday, March 13, 2009

.NETCF 3.5 Breaking Changes

I came across this useful list of breaking changes in the .NETCF 3.5 runtime and thought I'd blog it here before I lose the URL:-

http://msdn.microsoft.com/en-us/netframework/bb986636.aspx

#    |
# Tuesday, March 03, 2009

Samsung Release Windows Mobile SDK

Samsung's Mobile Innovator program has released an SDK for Samsung specific APIs on their Windows Mobile devices. Although this is a native code SDK all the functions I looked at were very P/Invoke friendly. For example once you've installed the device-side cab you can query the luminance sensor using:-

 

[

DllImport("SamsungMobileSDK_1.dll")]

 

 

private static extern int SmiLightSensorGetIlluminance(out uint illuminance);

The exact features available vary depending on the device model but the SDK contains functionality for LEDs, Camera Flash, Light Sensor, Scroll Wheel, Accelerometer etc

You can download the SDK, and some Emulator skins for Samsung devices from here:-

http://innovator.samsungmobile.com/down/cnts/category.main.list.do?platformId=2&cateId=147&cateAll=all

#    |
# Thursday, January 08, 2009

Microsoft Tag

Microsoft have released a new beta product for Windows Mobile (and also iPhone) called Microsoft Tag
This allows scanning of 2d barcodes with the device camera which can open specific URLs etc. The client software varies slightly depending on the capabilities of your device, on my Samsung Blackjack it offers realtime scanning - you just have to position the code roughly in a rectangular frame on the screen. On a HTC Touch device it invokes the camera capture dialog which is a lot more clunky.
Go to http://gettag.mobi on your device to download the client. You can sign in to the tag.microsoft.com website using a Passport and create new tags yourself. Apparently this will support other 2d barcode types in the future for now it uses HCCB an arrangement of coloured triangles.
The attached PDF contains a generated tag to get you started.
 
Have fun!
#    |
# Friday, November 21, 2008

Interesting email from HTC support

I was quite surprised at an email I got from HTC Support today in regards to a specific device update:-

"Hello,

There will be no Windows Mobile 6.1 upgrade for any HTC Touch device.

Please do not reply to this email as this email address is not monitored for replies.

Best regards,

Carolin

HTC Europe"

#    |
# Friday, October 31, 2008

Live Mesh for Windows Mobile

The Windows Mobile client for Live Mesh is now available. You can download it from your device from http://m.mesh.com

I've just installed it onto my phone and have been taking a look. On the desktop the Mesh client is quite tightly integrated into the explorer shell - it adds an extra pane alongside your folder windows showing the status of your synchronised folders. On devices the same level of integration is not possible (nor is there the screen real-estate). Therefore the mobile Mesh client runs as a separate application allowing you to manage which folders are synchronised. If you select a folder it opens separately in File Explorer to show the contents, you don't get any fancy icons to show the synchronisation status. The main menu in the Mesh client provides access to the members and news of that folder - the content you would normally see in the Mesh pane. This opens in an Internet Explorer window and is actually a mobile formatted version of the mesh web application. Also from the menu you can force a manual synchronisation and change the settings for automatic synchronisation.

In summary it is quite a simple client and does a good job of extending your Mesh files onto your mobile device. One of the key features is synchronisation of photos and it will automatically setup the \My Documents\My Pictures folder to synchronise with a "Mobile Pictures" folder in your Mesh. Unfortunately this wasn't immediately useful to me as I save photos to the storage card, but it's simple enough to setup Synchronisation of any other folder from the device.

#    |
# Monday, August 25, 2008

Get the name of your executing .exe

The Compact Framework doesn't support Assembly.GetEntryAssembly to determine the launching .exe. You can instead P/Invoke the native GetModuleFileName function like so:-

byte[] buffer = new byte[MAX_PATH * 2];

int chars = GetModuleFileName(IntPtr.Zero, buffer, MAX_PATH);

if (chars > 0)

{

string assemblyPath = System.Text.Encoding.Unicode.GetString(buffer, 0, chars * 2);

}

Where MAX_PATH is defined in the Windows CE headers as 260. The P/Invoke declaration for GetModuleFileName looks like this:-

[DllImport("coredll.dll", SetLastError = true)]

private static extern int GetModuleFileName(IntPtr hModule, byte[] lpFilename, int nSize);

The function expects a HMODULE - a handle to a native module. However passing IntPtr.Zero here indicates we want the module which created the process which is our .exe. This code will always return the path of the calling .exe regardless of if it is in a utility dll, or even a GAC assembly located in the \Windows folder.

#    |
# Wednesday, August 13, 2008

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_MACHINE\Software\Microsoft\Clock 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.

#    |
# Thursday, August 07, 2008

SQL Compact 3.5 SP1 RTM

To coincide with the RTM release of SQL Server 2008 the SQL Compact Team have delivered Service Pack 1 for v3.5. This includes Entity Framework support and a native 64bit version. Steve Lasker has the details:-

http://blogs.msdn.com/stevelasker/archive/2008/08/07/sql-server-compact-3-5-sp1-released.aspx

Meanwhile SQL Server 2008 RTM is available already online for both MSDN and TechNet subscribers.

#    |
# Friday, August 01, 2008

APPA Mundi Awarded Microsoft Certified Partner Status

APPA Mundi has received Certified Partner status within the Microsoft Partner Program along with the Mobility Solutions competency. This achievement showcases APPA Mundi’s expertise in creating mobile solutions based on Microsoft technologies.

Read Full Press Release

Microsoft Certified Partner - Mobility Solutions

One of the reasons I have been busy lately and not blogging as feverishly as in previous months is that I have been, with my three MVP colleagues, busy building up our company - APPA Mundi Ltd. We all have a long history of working with Windows Mobile and we have combined forces to offer consulting, development and training services. You can read more about us and what we do on our website.

#    |
# Friday, June 20, 2008

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

#    |
# Tuesday, June 10, 2008

Session Materials from Tech-Ed

I've posted a number of links relevant to the session I gave last week on our Tech-Ed page here. This includes the sample code which is an additional selection of samples than those which appear in the 32feet.NET package itself. The session covered the latest v2.3 release of the library and development continues on the next version based on your feedback.

One of the items of feedback I got for the session was the confusion between Personal Area Networking as a concept and the Bluetooth PAN Profile (Which supports Network Access Point, Group Networking and PAN User). Windows Mobile supports a limited subset of this profile to support the Internet Sharing application which was added in Windows Mobile 5.0 AKU3 but is often documented as a new feature in Windows Mobile 6. There is no exposed API to programmatically interact with the BT PAN profile, however there is an API for Internet Sharing which can be used to start/stop a sharing connection. I'm investigating the best way to add this to a future version of the library.

#    |