Archive for the ‘code’ Category

Getting Command Shell working on Windows Mobile 5

Tuesday, February 27th, 2007

Microsoft provide a command shell for Windows Mobile as a part of their Developer Power Tools package.

I fancied giving it a try tonight (for no particular reason other than that I like using the command line, and my phone has a full QWERTY keyboard) so followed the instructions to install it.

No luck – it didn’t work. No errors, it just didn’t work – nothing happened.

It took a bit of playing around with, but I’ve managed to get it running…

(more…)

Accessing Pocket Outlook email programmatically

Tuesday, February 6th, 2007

screenshotI mentioned ages ago about a little extension I wrote for my phone that lets me dump the contents of an email that I receive into any other bit of Pocket Outlook – turning an email about an event into a Calendar item, or an email asking me to do something into a Task item – with a single click.

I recently noticed a problem with it, and finally got around to looking into it tonight. The problem was that sometimes the body of the email wouldn’t make it to the new Calendar or Task item. Everything else, like the subject and the sender’s name would be fine, but the body of the new item would be blank.

(more…)

Making the interface that works best for you

Thursday, January 18th, 2007

I’ve mentioned several times before how easy Visual Studio makes it to knock up mobile applications. This is one of my favourite aspects of Windows Mobile. Why put up with an interface that doesn’t work for you? If you’ve got a spare hour, make a customized interface that gets your phone to work in way that suits you better. You can create a new interface (a ‘form’) without knowing any code – just drag-and-drop to put buttons, pictures and text where you want them. Then fill in the empty methods to get the buttons to do stuff – most of the core applications expose an API that let you drive them from your own forms.

In this post, I’ll go through an example – what I didn’t like about the WM interface, why it didn’t work well for me, and how I hacked together a new interface this evening.

(more…)

Calling the Windows Mobile emulator

Wednesday, January 10th, 2007

This is apparently an old tip, but was new to me so thought it was worth posting:

…you can make phone calls or send SMS messaages to yourself in the [Windows Mobile SDK] emulator. The phone number for the emulator is “+14250010001”. This is really handy for testing SMS interception or how your apps responds to an incoming phone call, etc. Just send an SMS to +14250010001…

…It’s also a great way to freak your buddy out who’s working on the emulator and doesn’t know about this feature.

Write a little app that will place a call to the emulator with a time delay before it places the call, deploy it when he’s not looking and start it. Wait your prescribed timeout and watch as he tentatively answers the call from his emulator 🙂

from Windows Mobile Team Blog

Cool! 🙂

Strings in C can span multiple lines

Tuesday, December 19th, 2006

I came across a multi-line string while doing an inspection on a colleagues C code. I’ve never seen this sort of thing before, and didn’t know it was possible.

Something like this:


    char* welcomeMessage = "Hello "
                           "Dale. "
                           "How are you?";

    printf("%s", welcomeMessage);

will happily print out “Hello Dale. How are you?”.

It seems that you can define a string literal in C across multiple lines, without any need for a concatenation character (like ‘+’ in Java and C#).

I like that, even though I’ve been writing C for years now, I still occasionally come across little bits and pieces in the language that are new to me. And doing code inspections and reviews of other people’s code are a good way to share this sort of stuff and learn from each other.

Supporting different languages

Sunday, December 3rd, 2006

I got an email on Friday from a German guy called Bernard. He uses my wiki note-taking app that I wrote to play with the Windows Mobile SDK (that in itself was a surprise!).

He asked if I’d add support for accented characters to it, as he (unsurprisingly, being German!) wanted to use German characters in his notes. That was an easy enough fix – just add a lookup table to the wiki markup parser which replaces characters with their HTML code equivalent.

Hurrah – I could feel suitably smug for making it a little less English-centric.

A guy called Alex brought me back down to earth on Saturday morning with an email pointing out that when he uses my wiki note-taking app (wow – how many people are using this??), it displays the wrong Chinese characters in ‘View’ mode to the ones he enters in ‘Edit’ mode. Chinese? Eeek… this isn’t something I knew about.

(more…)

Google Maps mash-ups are easy

Wednesday, November 29th, 2006

A colleague from dare2, a youth development charity based in Woking, asked where the nearest IBM location to him was. I didn’t know.

The IBM UK website gives a list of UK locations. But there are two small problems. One – my geography is so bad that I don’t know where Woking actually is. Two – my geography is so bad that I don’t know where each of the IBM locations on the IBM list are. Okay, it’s really one reason, but it’s embarrassing enough that it’s worth mentioning twice 🙂

So, I thought this would be a good enough excuse to try creating my first Google Maps mash-up.

(more…)

Windows Command Line has got smarter

Friday, November 24th, 2006

Most die-hard command-line fans tend to agree that the Windows Command Prompt isn’t great. When you consider how old it is, it isn’t all that powerful. This isn’t the end of the world, as there is always cygwin.

But now Microsoft have released their new command prompt PowerShell. I tried downloading it this evening, and so far, I really like it.

(more…)