10 Jul
Posted by kdutta in C#, Development, Home Screen, Interop, Windows Mobile
One of my recent projects at Enterprise Mobile was creating a custom home screen (see above) for the new MotoQ9h and Blackjack II devices. The top row is the standard Windows Mobile “Icon Bar”. The second row has the clock, messaging center (SMS, Mail, Voicemail), and current profile. Below that is the status text and the application bar. (Everything below the icon bar is a single full screen plug-in.)
![]()
At first glance, I assumed this would be a breeze. I have a powerful layout, key handling, and paint framework that I use in every project I work on, and thought that creating a home screen leveraging that would make it trivial. Sadly I was sorely mistaken. Read the rest of this entry »
08 Jul
Posted by kdutta in Development, Windows Mobile
It’s pretty annoying to have to create a CE Setup DLL cpp and def file every time I make a new CAB. So I finally got around to creating a VC Template to handle that for me. You can download it here.
Sadly, I did not create an installer for this template.
Installation instructions (adjust your installation directory accordingly):
And that should do it! You will now find the new project template in Visual Studio under the Smart Device folder in Visual C++.
Koushik Dutta
Software Engineer
www.koushikdutta.com
06 Jul
Posted by kdutta in Development, HTC, Windows Mobile
When I first got my HTC Touch Diamond a while ago, one of the first things I tried to do was reverse engineer the Sensor API found in HTCSensorSDK.dll. However, anyone who has tried to reverse engineer DLL arguments knows how tedious and painful it can be to create a dummy DLL to intercept valid arguments, parse through assembly, and inspect random memory pointers. Luckily, I did discover a registry key: HKEY_LOCAL_MACHINE\Software\HTC\HTCSensor\GSensor\EventChanged which let me figure out what the general orientation of the device was; and that was good enough for what I was trying to do.
However Scott, from scottandmichelle.net, successfully reverse engineered the HTCSensorSDK.dll. This allows developers to use the g-sensor that is available on the device. Very impressive work on the part of Scott!
Anyhow, I spent a portion of today writing a managed wrapper for HTC’s Sensor API. You can download it here. The code also includes a sample Teeter-esque type application which allows you to roll a ball around the screen. Read the rest of this entry »
06 Jul
Posted by kdutta in Development, Team Foundation System Build, Windows Mobile
A few months ago I sent out an email describing the process of setting up the Team Foundation Build System to play nicely with Smart Device Projects. This mail included: setting up the build machine to work with Smart Device Projects, account permissions, publish location, versioning, and also a workaround to making Smart Device CAB projects buildable by TFS. I’m sure other developers have had to or will have to go through the same pains of figuring this out, so I decided to publish it a la blog. Read the rest of this entry »
23 Jun
Posted by dfield in Development, Windows Mobile, security
It is a well know fact that a lot of enteprise IT pros require data encryption for mobile devices. The Windows Mobile operating system has included support for the Data Protection API (DPAPI) since Windows Mobile 2003. And DPAPI forms the basis for Windows Mobile file encryption used with removable storage cards (Windows Mobile 6.0) and main memory (Windows Mobile 6.1).
DPAPI provides easy-to-use functions for encryption and decryption. A number of applications use DPAPI. The thing that makes DPAPI easy to use for developers is that they don’t have to wite all the key generation and key management code that typically goes with any encryption solution. DPAPI uses a master key that is stored in the memory of the device. When an application calls DPAPI, the same master key is used to generate symmetric keys for all encryption and decryption operations. In this way, the application does not have to generate or manage the encryption key used. For a thorough description of DPAPI see the MSDN article covering Windows Data Protection
Of course, this begs the question, “How is the master key protected?” Read the rest of this entry »
A few months ago I wrote some code that really made me appreciate the new language feature in C#: Anonymous Methods. I decided to turn it into a sample application that creates a web request to www.google.com and downloads it when you push a button… asynchronously (that means the UI does not hang while the application is downloading). Prior to C# 2.0, doing a web request and download the content asynchronously was several hundred lines of sloppy spaghetti code: you need to implement callbacks, cleanup, error handling, state maintenance, etc. A lot of developers, myself included, would “cheat” and wrap synchronous calls in a thread to fake asynchronous requests (this is not ideal for performance).
The beauty of anonymous methods is that the compiler’s syntactic sugar handles a lot of the aforementioned for the developer very elegantly in the background. Read the rest of this entry »