A Windows Phone for Christmas

image

If you are lucky enough to be a student you should head off pronto to the UK Student Blog and see about getting yourself a free Windows Phone. All you have to do is show the bods at Microsoft a screenshot of your application running in the emulator and then promise on your honour to put it onto the Windows Phone Marketplace in time for the Christmas rush. If they like the cut of your jib they’ll send you a phone, no strings attached (after all, that is how wireless phones work you know).

Any of our First Year students who have Evil Squash running on Windows Phone (and there are a few) should get into gear pronto and get themselves into the mix. I want Evil Squash in the marketplace before Christmas and I promise to buy a copy of every version. After all, I’ll need something to do at all the parties I get invited to….

VideoBash on December 12th

VideoBash

Christophe dropped into my first year lecture today to promote the upcoming Videobash at the university. It’s a co-production between ComSoc and the university film society. Movies, video games, fancy dress. Looks like fun. I think they still have some tickets left. You can buy them next week on the 7th, 8th and 9th in the union.

On a related note, you can get the Final Fantasy movie – The Spirits Within on Blu-ray for 6.49 on Amazon, which has got to be a bargain.

Nokia Lumia Colours

image

I’m a Windows Phone kind of guy, and so I was expecting to like my new Nokia Lumia 800. But I wasn’t expecting to like it quite as much as I do. There have been some mutterings about battery life on the device, and I must admit that the first few charges didn’t last as long as I would have liked. However, I followed the instructions on one blog post and turned off the “Notify me when new networks are found” option for WiFi.

I’m not sure whether this has reduced power consumption or whether the Nokia has just got used to the battery and learnt more about how much charge/discharge it can take. Either way I’m getting better battery life than I used to get with the Samsung Omnia 7 and a lovely user experience. And Kinectimals is a really cute game.

I’ve ordered up some of the multi-coloured cases (Red and Blue look good to me) as I’ve always fancied having a bright coloured phone. Not sure about the green though.

Evil Squash Week

SquashBoard

If you show this picture to one of our First Year students they’ll probably start muttering under their breath. That’s because we’re entering the final week of “Evil Squash” coursework. This is my little board game which we are all trying to make workable versions of. You can find out more at www.evilsquash.com We we are going to put the best ones out there on Windows Phone. And there are some really good ones too.

Too Many Accounts

Yellow Lines

Today I bought something on the internet and paid extra so just to avoid having to register on yet another shopping site. I found a site selling the item for a tiny bit less but they wanted me to register and set up a username and password (and would presumably bombard me with emails and “offers” ever afterwards). I wish sites wouldn’t do this. Some places have an “order without setting up an account” button and I much prefer this. When I’m shopping on the internet I’m after the goods, not a relationship.

A Grate Day for Wit

DSCF5295

Today I had three great ideas for Tweets in quick succession. I’m so pleased with them that I’m going to put them in the blog so that they don’t get lost. And no, I’m not sorry.

“Argos are having an "up to half price sale". Working out what this means is really hurting my head.”

“I was going to buy an e-reader but I think I'll wait until you can get ones that do the whole alphabet.”

“I'm going to make a stage out of empty, lid-less, ketchup bottles. It will be an Open Sauce Platform...”

..and here’s a bonus new one

“I’ve written a program that plots the location of every seat I’ve ever used. I call it my Sat Nav”

Nokia Lumia 800 For Free-ish

Lumia 800

Very nice too

I only went into the Orange Shop to see what the phone looked like. I wasn’t really far enough into my contract to make it possible to do a upgrade right now. Except that the phone did look very nice. And I can probably find someone who will give me a few quid for my good condition Samsung Omnia 7 (which was until 30 seconds or so into the demonstration my favourite Windows Phone). But the deal clincher was a good one. Turns out that if you are an employee of the university you can get a 25% discount on your Orange phone bill if you take out a new contract. Which means that over a year I’ll save a goodly chunk of the upgrade price. So that was that. Where do I sign?

I’m now the very proud owner of a Nokia Lumina 800. The wheel has turned all the way round. I started out with Nokia phones all those years ago, with a lovely 7110 (the “Matrix” phone) and went through a number of Nokia devices before I jumped ship because the lure of writing programs for my phone just got too great.

And now I’m back with blue boxes. The packaging and presentation were excellent. The phone is a really, really well crafted object. It has quite a turn of speed compared with the Samsung (not that my old phone was ever much of a slouch). The camera is a step up too, and even takes reasonable flash pictures. I’ve got twice as much space for content and the screen is astonishing. It has the clarity of OLED but isn’t quite as “in your face” as the Sansung.

And it runs Cheese Lander.

Guide Text Entry in Windows Phone

image
The layout may not be perfect, but it is a lot easier than writing your own text input.

Some of our students are making quite a good job of Evil Squash. There are even a few Windows Phone versions out there, which is nice. One of the things that the game must do is ask the player for their name. Anyone who is using XNA for the game has a problem here, as text entry in XNA can be non-trivial. Unless you use the XNA Guide.

The Guide is a way that you can ask the user questions and do lots of other interesting things. I used it to write a silly program that asks the user for their name.

if (text.Length == 0)
{
    if (!Guide.IsVisible)
    {
        // display the guide

        Guide.BeginShowKeyboardInput(PlayerIndex.One, 
            "Name entry",       // title for the page
            "Enter your name",  // question for user
            "Fred",             // default text
            new AsyncCallback(gotText),  // callback method 
            this);                       // object reference
    }
}

This is the code that I wrote. It is part of the Update method. The variable text is going to hold the name that the user enters. If it is empty I must display the guide to read it. The first thing I do is to check that the guide is not already visible. If it is I don’t need to display it again. Remember that Update is called 30 times a second on the phone, I don’t want to be overwhelmed by loads of guides.

The BeginShowGuide puts the guide on the screen. The first three parameters make very good sense, the last two are a bit more confusing. The fourth parameter gives the Guide the method to call when the user has finished typing in their name and pressed OK to close the Guide down. The fifth parameter just needs to be a reference to an object that can identify the request. I’ve given it the value of this, which is a reference to the current game. The result of this method call is that the guide is displayed, as you can see in the screenshot at the top.

When the user closes the guide, either by pressing ok or cancel, the Guide will call the gotText method that I told it about:

void gotText(IAsyncResult result)
{
    if (result.IsCompleted)
    {
        text = Guide.EndShowKeyboardInput(result);
        if (text == null)
        {
            // user pressed cancel
            text = "Cancelled";
        }
    }
}

This checks to see if the request is completed. If it is the method gets the text from the Guide by calling EndShowKeyboardInput. If the user pressed cancel the Guide will return a null string. The code above sets the text to Cancelled, otherwise the text is left as whatever the user typed in.

My program just draws the name string on the screen:

image

You can find a sample project with this code in it here.

Rampant Robots

DSCF5281

We let the students give their robots names. As well as “Pet Art” above we have two Daves and one Eric.

We had a proper session of robot control today. We were making robots that don’t fall off the desk. We had a few miss-wired connections and people discovered that two motors told to go at full speed don’t actually go at the same speed. So the program can’t just assume that things will happen the way they should….

Next week we are going to see about making the control software multi-threaded so that we can drive the motors and monitor the sensors at the same time. Great fun.

Windows Phone Camp Hull

Hull Phone Camp 1

Ben addresses the audience.

Ben and Joanna from Microsoft came to see us today and deliver a full afternoon of Windows Phone sessions. We had phones, programs, pizza and tea and coffee. But no biscuits. Sorry about that. Anyhooo, a great time was had by all. Thanks to Ben and Joanna (I keep thinking of ice-cream when I type their names like this) for coming all this way and back in a day.

We did some silly development and we spent some time making a really funky windows phone camera. I promised a download of the code, here it is.