Windows Mobile is my lucky goat

23 11 2009

The story of the lucky goat goes something like this:

A man is unhappy because he lives with a large family in a very small house. The man complains to his wise friend. The friend loans him his “lucky goat” for a month. During this time the goat bites the man’s children, scares his mother-in-law half to death and takes a dump in the man’s shoes. It keeps the whole family up at night and eats almost as much as they do every meal. The man later returns the goat to his friend complaining how awful his life has been lately.

Two weeks pass and the two friends meet again. The man now looks very happy and his friend asks him why. The man explains that ever since he doesn’t have to worry about the goat biting his kids, scaring his mother-in-law half to death or taking a dump in his shoes he has been much more relaxed. He also tells his friend that his family sleeps much better and has more to eat now that they don’t have to tend to the goat.

The moral of this story is of course that sometimes you’re unable to appreciate what you have unless you find yourself in a worse situation.

I’m the man, Windows Mobile is the goat.

Damned Mobile Goat!

–Read the rest after the break–

Last week, I struggled to get a hang of WinMob to no avail. I was ready to throw in the virtual towel this Friday but got a pep-talk from a colleague. I rarely quit things and I’m glad I didn’t this time. Instead, I spent a good bit of my weekend developing a demo-application for a potential client. I can’t say who or what yet but I can show a totally, 100% spoiler-free screenshot

Superofficial Screenshot

The biggest issue I had during development was the Images for the app. Windows Mobile doesn’t handle images in the way I’m used to and Internet offered little help. What I tried to do was similar to this:

Image myImage = new Image();
myImage.Source = new Bitmap(”Images/avokado.jpg”);

OR

Image myImage = new Image();
myImage.Source = Bitmap.FromFile(@”C:\Images\avokado.jpg”);

None of which worked. It turns out the only way to insert pictures from code is to first add it to the global Resources object.

image

And add images (sorry bout the censoring. Copyright and whatever):

SpoilerScreen

With this done I could finally point to the pictures like this:


Image myImage = Properties.Resources.avokado;

When I finally managed to do this, everything else fell in place and the app flowed from my brain into digital form. I’ll gladly show some real screenshots from it as soon as I can.

Working with Windows Mobile was a hassle. The framework is very limited both in function and graphics. At least that is my impression as a developer spoiled by WPF and Silverlight. I can’t wait until Silverlight is available for WinMob and I can start making mobile SL apps. I’m very glad to get back to playing around with some more powerful frameworks.

Advertisements

Actions

Information

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s




%d bloggers like this: