Sigh… stay focussed, Dennis!

A couple of days ago I was playing around with Silverlight 4. Amazing platform, especially since they now support multi-touch events. But before you can run, you’ve got to learn how to walk, right? So, in order to learn some of the new capabilities of the platform I decided to make an application to keep track of all my contacts. I know, there are numerous applications out there that can peform that task much better, but I didn’t want to create a usefull program, I just wanted to have a ‘real’ project in order to see what Silverlight 4 does for me.

As you probably know, in Silverlight you have to make use of webservices whenever you want to get some data from the server. You cannot create a database connection from the Silverlight app directly so you have to call the server who will go to the database for you.

No problem, I’ve worked with WCF so many times before that this should be a no-brainer. I can probably do that with my eyes closed. As it turned out, I think I did just that. Read on about my stupid mistake and maybe you can spare yourself the humiliation of doing the same thing.

Let’s walk through the steps I took to get some data from the database into my SL app. I won’t bore you with all the details; in this post I will just recreate what I did but make it a lot simpler.

Of course, we need a database. In this case I have just one table, named Contacts. It looks like this:

image

ContactId is an Identityfield, FirstName is a nullable nvarchar(50) and LastName is non-nullable nvarchar(50). Just a basis table.

I added a Linq to SQL field in my web project and I am ready to go.

Now, I don’t want to pass the WebContact class to my SL client, so I decided to make a simple POCO class to hold the data. It’s redundant, but it gives me flexibility should I decide to change my data access strategy and don’t want to mess with my WCF interface. The class looks like this:

using System;

namespace MyStupidBugProgram.Web.WCF
{
    [Serializable]
    public class Contact
    {
        public int Id { get; set; }
        public string FirstName { get; set; }
        public string LastName { get; set; }
    }
}

Nothing special about that one. I made it Serializable so I could, well, serialize it.

Next, the WCF Service:

using System;
using System.Linq;
using System.ServiceModel;
using System.Collections.Generic;
using System.ServiceModel.Activation;

namespace MyStupidBugProgram.Web.WCF
{
    [ServiceContract( Namespace = "" )]
    [AspNetCompatibilityRequirements( RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed )]
    public class DataService
    {
        [OperationContract]
        public List<Contact> GetAllContacts()
        {
            using (var ctx = new Data.ContactClassesDataContext())
            {
                var allDBContacts = from dbContact in ctx.WebContacts
                                    select dbContact;

                var result = new List<Contact>();

                foreach (var dbContact in allDBContacts)
                {
                    result.Add( new Contact()
                    {
                        Id        = dbContact.ContactId,
                        FirstName = dbContact.FirstName,
                        LastName  = dbContact.LastName
                    } );
                }

                return result;
            }
        }
    }
}

I just get all the contacts in my database, move them to my new Contact class and return the List<Contact> with all those found items.

Let’s move to the Silverlight part.

I’ll add a new Service reference to the project containing my webservice (which is the same project that also houses the Silverlight ClientBin folder). When I added the service reference, I noticed that the generated Contact class had some weird looking fieldnames in it. The field Id for instance was called Idk__BackingFieldField. It had probably to do with some option I didn’t set correctly so I don’t really care about it (after all, it’s just a fool-around project, right?).

But I don’t like those names so I decide to add a new class, named WebContact that will hold the data for me. In fact, I’ll make it a viewmodel so I can use MVVM for this:

using System;
using System.ComponentModel;
using MyStupidBugProgram.DataServices;

namespace MyStupidBugProgram
{
    public class ContactViewModel : INotifyPropertyChanged
    {
        private Contact _Contact;

        public ContactViewModel(Contact contact)
        {
            _Contact = contact;
        }

        public event PropertyChangedEventHandler PropertyChanged;

        public int Id
        {
            get { return _Contact.Idk__BackingField; }
            set
            {
                _Contact.Idk__BackingField = value;
                RaisePropertyChanged( "Id" );
            }
        }

        public string FirstName
        {
            get { return _Contact.FirstNamek__BackingField; }
            set
            {
                _Contact.FirstNamek__BackingField = value;
                RaisePropertyChanged( "FirstName" );
            }
        }

        public string LastName
        {
            get { return _Contact.LastNamek__BackingField; }
            set
            {
                _Contact.LastNamek__BackingField = value;
                RaisePropertyChanged( "LastName" );
            }
        }

        private void RaisePropertyChanged(string propertyName)
        {
            var eventCopy = PropertyChanged;
            if (eventCopy == null)
                return;

            eventCopy( this, new PropertyChangedEventArgs( propertyName ) );
        }
    }
}

Notice the weird names on my Contact class…. Ah well, I’ve got them wrapped in my viewmodel so I don’t have to worry about them right now.

Ok. Let’s get some data. I create a ContactGetter class that will call my WCF service and gets the data:

using System;
using System.Windows;
using System.Collections.ObjectModel;
using MyStupidBugProgram.DataServices;

namespace MyStupidBugProgram.DataStuff
{
    public class ContactGetter
    {
        private DataServiceClient GetServiceClient()
        {
            Uri sourceUri = new Uri( Application.Current.Host.Source, "../WCF/DataService.svc" );

            var result = new DataServiceClient( "CustomBinding_DataService", sourceUri.AbsoluteUri );
            return result;
        }

        public void GetAllContacts(Action<ObservableCollection<Contact>> callback)
        {
            var client = GetServiceClient();
            client.GetAllContactsCompleted += (sender, e) =>
            {
                callback.Invoke( e.Result );
            };

            client.GetAllContactsAsync();
        }
    }
}

In the GetAllContacts method I pass an action which is called when the data is returned. Since all communications in Silverlight will be done asynchronously you will have to jump through some hoops to get the data but this works just fine. Of course, there are much better ways of doing this (I recommend the Rx framework, but that’s something for another post) but for this demo, this will do.

Note the construction of the sourceUri: this way I don’t have to change anything should I ever move the project from the webserver in Visual Studio to IIS or even to a hosting company: the code will figure out where the webservice is.

In my MainWindow I call this code like this: (don’t get confused by the lambda’s :-) )

First, I create a dependencyproperty of the type ObservableCollection<ContactViewModel> that will be the source for my listbox later on:

public static readonly DependencyProperty AllContactsProperty =
    DependencyProperty.Register(
        "AllContacts",
        typeof( ObservableCollection<ContactViewModel> ),
        typeof( MainPage ),
        new PropertyMetadata( null ) );

public ObservableCollection<ContactViewModel> AllContacts
{
    get
    {
        return (ObservableCollection<ContactViewModel>)GetValue( AllContactsProperty );
    }
    set
    {
        SetValue( AllContactsProperty, value );
    }
}

In the MainWindow constructor I get the data:

public MainPage()
{
    InitializeComponent();
    DataContext = this;
    // Get the data
    ContactGetter contactGetter = new ContactGetter();

    Action<ObservableCollection<Contact>> loadingAction =
        p =>
        {
            Action<ObservableCollection<Contact>> dispatchedAction =
                cvm =>
                {
                    AllContacts = new ObservableCollection<ContactViewModel>();
                    foreach (var contact in cvm)
                    {
                        AllContacts.Add( new ContactViewModel( contact ) );
                    }
                };
            Dispatcher.BeginInvoke( dispatchedAction, p );
        };
    contactGetter.GetAllContacts( loadingAction );
}

A little clarification might be in order:

When I call my contactGetter.GetAllContacts I pass in an Action<ObservableCollection<Contact>>. This action is called back from the ContactGetter.GetAllContacts whenever the data is retrieved from the server. Since it’s all asynchronously we don’t know when this will happen but we are guaranteed it will be on another thread. That’s the reason I created another action that will be given to the Dispatcher. The Dispatcher makes sure the processing of tthe data will be done on the UI thread so we can set the ObservableCollection<ContactViewModel> dependencyproperty (which is the itemssource for a listbox).

We could split the code up, it would look like this:

public MainPage()
{
    InitializeComponent();
    DataContext = this;
    // Get the data
    ContactGetter contactGetter = new ContactGetter();

    Action<ObservableCollection<Contact>> loadingAction =
        (Action<ObservableCollection<Contact>>)ProcessDataFromWCF;

    contactGetter.GetAllContacts( loadingAction );
}

private void ProcessDataFromWCF(ObservableCollection<Contact> p)
{
    Action<ObservableCollection<Contact>> dispatchedAction = (Action<ObservableCollection<Contact>>)ParseDataForUIThread;
    Dispatcher.BeginInvoke( dispatchedAction, p );
}

private void ParseDataForUIThread(ObservableCollection<Contact> cvm)
{
    AllContacts = new ObservableCollection<ContactViewModel>();
    foreach (var contact in cvm)
        AllContacts.Add( new ContactViewModel( contact ) );
}

It’s a bit more readable but not as cool. And next to that: my code will be littered with methods I never use but on one place. I don’t like that. When you get used to lambda’s they are much more readable.

Final detail: the view.Well, I just put the whole thing in my xaml:

<UserControl x:Class="MyStupidBugProgram.MainPage"
   xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
   xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
   xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
   xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
   mc:Ignorable="d"
   d:DesignHeight="300" d:DesignWidth="400">

    <Grid x:Name="LayoutRoot" Background="White">
        <ListBox ItemsSource="{Binding AllContacts}">
            <ListBox.ItemTemplate>
                <DataTemplate>
                    <Grid>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition />
                            <ColumnDefinition />
                        </Grid.ColumnDefinitions>
                        <Grid.RowDefinitions>
                            <RowDefinition />
                            <RowDefinition />
                            <RowDefinition />
                        </Grid.RowDefinitions>
                        <TextBlock Grid.Row="0" Grid.Column="0" Text="Id:"/>
                        <TextBlock Grid.Row="1" Grid.Column="0" Text="Voornaam:"/>
                        <TextBlock Grid.Row="2" Grid.Column="0" Text="Achternaam:"/>

                        <TextBlock Grid.Row="0" Grid.Column="1" Text="{Binding Id}"/>
                        <TextBlock Grid.Row="1" Grid.Column="1" Text="{Binding FirstName}"/>
                        <TextBlock Grid.Row="2" Grid.Column="2" Text="{Binding LastName}"/>
                    </Grid>
                </DataTemplate>
            </ListBox.ItemTemplate>
        </ListBox>
    </Grid>
</UserControl>

 

So we have a listbox, it’s bound to our DP AllContacts and in the ItemTemplate we bind the correct fields.

Let’s run it:

image

To quote Borat: great success!

At this point I was quite pleased with myself. I was so happy with it that I decided to put it on my website. So I published the whole project to my hoster. I did, it published, I ran it and then….

Nothing.

Empty screen.

No error message.

Mmm.

I checked the whole thing. Did it deploy correctly? Yes. Did I change to connectionstring to the correct database? Yes.

Then I noticed this tiny little error icon in the leftbottom corner of my webbrowser. Double clicking this produced the next result:

image

What could this be? It works on my machine.. (I’ve heard that one before).

I tried using my own IIS and that worked fine. Why didn’t the server at the hoster work? It runs Silverlight 4, I’ve tested that. I have the ClientAccessPolicy.xaml in the root, although I don’t need it in this case. What is the cause?

I guess it’s debug time… But how to debug when it all works locally? I decided to write a small .aspx page to read out the data from the wcf service. Just to skip the Silverlight application all together. And then I got this:

image

Not using HTTP protocol? And why is that a problem? Why doesn’t that work on the remote server? What does “This could be due to the service endpoint binding not using the HTTP protocol” mean?

Then it all became clear… if it doesn’t use the HTTP protocol, or doesn’t use it correctly, it probably uses some form of binary serialization of my data. Uhm… wait a minute. Let’s go back to the service I started out with:

using System;

namespace MyStupidBugProgram.Web.WCF
{
    [Serializable]   
    public class Contact
    {
        public int Id { get; set; }
        public string FirstName { get; set; }
        public string LastName { get; set; }
    }
}

Ah.

I see the problem.

Let’s change it to:

using System;
using System.Runtime.Serialization;

namespace MyStupidBugProgram.Web.WCF
{
    [Serializable]   
    [DataContract]
    public class Contact
    {
        [DataMember]
        public int Id { get; set; }
        [DataMember]
        public string FirstName { get; set; }
        [DataMember]
        public string LastName { get; set; }
    }
}

Now it’s a datacontract. Now WCF knows how to serialize this before giving this to my Silverlight application.

Let’s rebuild, let’s refresh the service reference, let’s test local (it works) and let’s deploy.

Et voila, it works on the remote machine as well.

Focus, Dennis, focus!!!

Surface development: it’s just like software development

Surface is magic. Everyone using it seems to think that way. And I have to be honest, after working for almost 2 years with the platform I still get that special feeling the moment I turn on the unit to do some more work.

The whole user experience, the rich environment of the SDK, the touch, even the look and feel of the Surface environment is so much different from the stuff I’ve been working on all my career that I am still bewildered by it.

But… and this is a big but.. in the end we’re still talking about a computer and that needs software to become useful. Deep down the magic of the Surface unit there is a PC somewhere, running Windows Vista and the .net framework 3.5. When you write that magic software that makes the platform come alive you’re still working with .net, WPF/XNA, C#, VB.Net and all those other tools and technologies you know so well.

Sure, the whole user experience is different from what you’ve known. And the way of thinking about users, their interaction and the positioning of screen elements requires a whole new paradigm. And that takes time. It took me about half a year before I had the feeling I got it nailed down. But when that moment came (about 18 months ago…) I realized that everything I had learned so far on software development still is true when it comes to Surface.

The last 6 months I have been working with some people with a different background to start a new company. The idea was that the new company would be focussing on Surface and Surface only. These people come from a marketing background and had some good ideas for some applications. And I have to admit: their ideas were good. Very good. Where it all fell down of course is that these ideas need to be implemented in a piece of software. And creating great software takes skilled developers and a lot of time and money. That’s where things went wrong: the marketing guys didn’t realize and didn’t want to realize that software development is a job that takes skill. You can’t just hire a bunch of developers and expect them to deliver the best sort of software, especially not when it comes to Surface.

I tried to explain that yes, their User Interface in Photoshop looked great, but no: I couldn’t develop an application like that in a weeks time. Even worse: the while backend of the software (WCF for communications, SQL Server for the database, etc) would take a lot more time than the frontend.

They didn’t understand. It took them a couple of days to drawn the UI in Photoshop so in Blend I should be able to build the software in about the same amount of time.

Well, you and I know that it doesn’t work that way. Software is hard to write, and even harder to write well, and it takes skill and dedication. It’s not something you can do as fast as you can draw a mock up for a Surface application in Photohop.

The same holds true for web applications of course. A lot of designers there fail to appreciate the hard work that goes into writing the plumbing for a good web app that can handle thousands of users. Although the UI is very important, it’s not all there is to it.

And in Surface development this is the same. The UI should create the feeling of magic, but the software behind it is what makes it come alive. And that takes time. A lot of time.

So brush of you skills and don’t throw them away if you start developing for Surface. Because projects (and colaborations) can fail there as hard as they can in any other area of software development.

On a side note: we decided to stop the colaboration (something the other parties involved didn’t appreciate and were very angry about) and decided to hire a designer for the Surface projects. The focus is back where it belongs: on the software development we know so well and have been doing very well for 13 years. UI is just a part of the whole project and not the end product. So my company Detrio is still going strong when it comes to develivering Surface solutions but once again from a technological background, not a marketing background.

Doing a talk on Surface Development

On Saturday November 21st the Dutch .net usergroups SDN, VBCentral and my own dotNed will host the third annual CodeCamp. This time it will take place in Rotterdam. As with all CodeCamps, attending the event is free provided you register first at the http://www.codecamp.nl site.

on this day Freena Eijffinger (from NSquared) and myself will present a session on development on Surface. I am currently hard working on the content of it, but now it looks like Freena and I will split up the talk in two parts: one technical, and one functional. It may not come as a surprise that I, the C# MVP, will focus on the technical part.

I am looking forward to the event! If you are in the Netherlands around that date, I suggest you come visit us in Rotterdam and say hi!

Developing for Surface, part I

Surface is cool. There’s no doubt about that. People who walk up to the machine and start using it are usually impressed by it. That also goes for developers: they are sometimes even overwhelmed by it and start to wonder how hard it is to develop software for this platform.

The good news is, is that it is actually fairly easy to build software for the Surface platform. Well, easy… if you know how to develop in WPF that is. In this post I will outline the most common steps to take to develop your own Surface application.

Surface SDK

First of all, you need access to the Surface SDK. When you buy a Surface unit you get access to the Surface Community site where you can download this. On a developer unit it is preinstalled, but I wouldn’t recommend doing all your development on the unit itself. It’s likely there are more people than just one working on a project and the team cannot use the unit at the same time (the multi-user experience doesn’t extend to developing software on Surface). When you install the SDK you get the API’s, the tools, Visual Studio templates and the simulator. This last piece of software is a tool that mimics the Surface Shell so you can develop your software on your workstation. Of course, testing should be done on the Surface unit itself!

XNA or WPF?

There are two possible ways to write software for the Surface. When you install the SDK you will find that there are two new templates installed in Visual Studio

New Project Dialog

As you can see you can choose between a WPF application and a XNA application. The reason you have this choice is not quite clear, but it is likely that it has to do with the origins of XNA.

When the XBox came out, Microsoft decided they needed a development environment for this platform. This became XNA. Later, when the Zune was launched, they added Zune capabilities to the XNA environment. Apparently, they thought that XNA was going to be the platform for development for devices. Surface is such a device so it was pretty obvious that XNA would be the way to go. Until they discovered that the development experience for Surface looks a lot like developing in WPF (which was still in the works back then). So they added a set of libraries to standard WPF and tried that.

I wouldn’t be surprised to see that the XNA version will disappear in the future. For me, as a WPF developer, the WPF template is the way to go. And that goes for about 90% of the Surface developers I meet.

WPF Development

When you create a new WPF Surface application, you get a project consisting of a couple of files:

image

At first, this looks like a normal WPF project.You have your App.xaml and a SurfaceWindow1.xaml which is your startup windows. Next to this the template has additional references: Microsoft.Surface, Microsoft.Surface.Presentation and Microsoft.Surface.Presentation.Generic. Finally you’ll see the MyFirstSurfaceApp.xml, which is a file we need when we deploy our application. Last, there are some default resources, with the icon (this will show up in the Launcher), the iconPreview (also for the Launcher but this is the one that gets shown when  your app is selected) and the default WindowBackground (the background image for your main window). You can (and should) change these. For now, let’s leave them like they are.

You should now start up the simulator, then build this project and run it. You will see this:

Default application

Not very exciting, but this is your first Surface application! You can move the mouse and see a finger moving across the screen! Again, not very exciting but this is only the first step….

In Visual Studio you can now stop the application and you will return to the editor.

Surface Controls

In the toolbox you’ll find the controls needed for developing Surface applications. These fall apart in three categories:

Tool box

The first category are the ‘default’ WPF controls that have been altered for Surface. You will recognize these controls as they are ‘normal’ WPF controls but they additional capabilities. They are usually larger than the normal controls to allow fingers to use them (a finger is less precise than a mouse). Also they support multi-touch (imagine two fingers pressing the same button: what happens when the first one lets go?)

These controls are:

  • SurfaceScrollbar
  • SurfaceButton
  • SurfaceCheckBox
  • SurfaceContextMenu
  • SurfaceInkCanvas
  • SurfaceTextBox
  • SurfaceMenu
  • SurfaceMenuItem
  • SurfaceSlider
  • SurfaceListBox
  • SurfaceListBoxItem
  • SurfaceRadioButton
  • SurfaceScrollViewer
  • SurfacePasswordBox

As you can see, the names are the normal names of the controls but prefixed with ‘Surface’.

The next category are the controls that are specifically designed for Surface. These are:

  • ElementMenu
  • ElementMenuItem
  • LibraryBar
  • LibraryBarItem
  • LibraryStack
  • LibraryStackItem
  • LibraryContainer
  • ScatterView
  • ScatterViewItem

I will go deeper into these controls in my next post

The last category, consisting of just one control, is the category with the non-visual controls. For now, there’s only one of them: the TagVisualizer. This non-visual control can recognize the tags placed on the screen and take action on this tags.

Development

The development of your application follows the same patterns as with any WPF application. You create a window and place the controls on them. Of course, with Surface you have to take into account the special nature of the platform (360 degrees user interface, no notion of a single user, etc). Next to that, you cannot change the size of the main window: this should remain 1024 x 768. You also shouldn’t use popups or move to different screens, the application should live in one window only. But technically speaking there is little difference in developing for Surface compared to normal WPF development.

In the next post I will go deeper into the various controls.

Tags van Technorati:

Microsoft Surface: just a big touchscreen?

I hear this remark a lot. Whenever I show Surface to people there’s always one in the group who, after about 10 minutes, comments that Surface is just a big IPhone or a flat touch screen.

Of course, it’s not.

First of all, you can’t use a Surface unit out of the box to make phone calls. Second, the Surface unit is hardly portable where the IPhone most definitely is. To these commentators, Surface is like an IPhone but with less features.

Again, of course, it’s not.

Usually I can convince these skeptics that Surface isn’t anything like the IPhone. It’s even not “just a big touch screen”. It’s way more than that. People who think otherwise apparently fail to understand the nature and the philosophy of the Surface platform. In this post I will explain why these people are wrong and, more important, what the philosophy and power behind Surface is.

Surface is a table with a PC in it, not the other way around.

This might sound a bit childish, but in fact this statement puts the emphasis on the form factor. Surface is, well, a surface. Just like a table. You can put things on a surface, you can sit on it, you can even stand on it, rest your elbows on it, place you notepad on it, sit at with with other people, and so on. Nobody needs explaining what a table is, yet somehow I always seem to have to give permission to people to use the Surface as a table. People are very hesitant to place their coffee mugs on it, for example. Children do not have these reservations. They will treat the Surface for what it is: a table they can use just like any other table.

But let’s be honest: Surface is more than just a table. It is a table that can interact with the people sitting at it. It can respond to actions people take. The display can and will change according to what people are doing at the table. This offers a lot of possibilities!

Another question I get a lot is “Can we wall mount a Surface?”. The answer to that is “Yes, you can, but don’t even think about doing it.” Let’s be honest: if you have a big enough and sturdy enough wall, you technically could place the unit in the wall. But why would you? If it’s in the wall you cannot place objects on the unit anymore: everything will fall off. And if you put it in the wall you loose the table form factor, you reduce the Surface unit to a touch screen like system.

Let me repeat myself: the power of the the Surface unit is that people sit at it, interact with each other and let the screen interact with the people around it. This is something a normal (vertically mounted) touch screen does not allow you to do.

Surface is not a big IPhone.

Of course, it is not. People say this because they see the demo’s with the photos being resized and moved. That reminds me of the demo’s they’ve seen off the IPhone. The truth is that the IPhone and the Surface have as much in common as a, uhm, two things which aren’t related at all.

One is a phone, the other is a table. Yes, they both have a computer inside somewhere, but the goal and purpose of the two are completely different. The IPhone is a communications, and maybe even an entertainment device, where the Surface is a way for people to interact directly. Surface is massive multi touch, the IPhone is meant for one person at the time.  The list of differences is endless, the list of similarities is pretty short (it’s touch enabled, it has similar gestures for moving and resizing, and that’s about it).

Let’s never make this comparison again, it’s silly.

Surface is a way for people to communicate.

This, of course, is what Surface is all about. It can help people to communicate and to help in understanding each other. More important: it can help people to get the work done, whatever that work might be. It’s a smart table that can interact with you and your fellow co-workers, your customers, your partners or whomever sits at the table with you.

How you can achieve that level of communication and collaboration is something I’ll write about next time.

Tags:

Reduced finger recognition on Surface

Tags:

Development of Surface applications is done on the Surface Simulator. Even at Microsoft the Surface team works most of the time in the simulator: I’ve heard they have 1 Surface unit per 8 developers.

The simulator works fine and is a great tool for developing the applications: the debugging experience is actually quite nice. But sometimes you have to deploy your application to the actual physical unit to see what it looks like in ‘real life’. I think that is the only way to determine if what you’re building fits the Surface Experience, something you cannot mimic on the simulator.

However, when testing the application I am currently working on, I noticed the unit didn’t recognize my index finger anymore. It did work with my other fingers though, so I checked my finger to see if there was anything wrong with it. To me, my index finger looked just like it always did so I didn’t understand the problem. But, since I am under a tight schedule I didn’t have much time to investigate and used the application with my other 9 fingers.

After a while, the whole machine began less responsive. The launcher was slow, the applications were becoming more and more sluggish and the whole experience was getting worse and worse.

Time to investigate what was going on.

I used the performance counters but didn’t see any problems. The whole machine itself didn’t have any problems, it was just that when I was in User mode the machine didn’t behave the way I expected it to behave.

On top of the responsiveness problems, I noticed the screen wasn’t as vibrant as it used to be. Then the solution hit me: maybe I should clean the unit? So I took some cleaning stuff and gave the screen a good cleaning. And there it was: the screen was as beautiful and vibrant as the day it was delivered. Even better: it suddenly recognized all my fingers again.

So, if you experience bad recognition of your fingers, tags or objects, try cleaning the unit. It might help!

I never thought I would be able to debug applications by using a bit of water and soap….

Dr. Neil to present for the Dutch Surface UG

With pride we announce that the next meeting of the Dutch Surface User Group will have Dr. Neil Roodyn as a speaker!

This is the abstract of his talk:

Surface has sex appeal, people are attracted to Surface as a sexy new technology. The development tools make it easy to build Surface applications and yet so many Surface applications fail to deliver the true value of Surface.

In this session Dr. Neil will explore some of the things you can do to enable your Surface applications to deliver more than just a pretty face.

Dr. Neil has been working with the Surface team helping partners in Europe understand how to build better Surface applications. He has trained and mentored over 100 individuals on Surface development.

Dr. Neil works for nsquared, a leading edge technology company headquartered in Sydney Australia.

---

The meeting will take place on August the 6th, in Utrecht at the Capgemini office. The meeting starts at 19.00 but the doors open at 18.00 with food and drinks. And of course, as always, the meeting is free as long as you register at http://www.dotned.nl (in Dutch)!

I am looking forward to this meeting!

Tags:

Justifications for buying a Surface machine

Tags:

A lot of people come to me with the question “why should we, as an organization, invest in Surface?” Or, to be more honest: developers come to me with the question “What can I do to convince my manager to buy us a Surface Unit"?”, which is the same question but more honest.

The answer is, of course, the same answer as I give to everyone who asks me for a justification for investing in hard- and software: there needs to be a business case. And in these hard economic times: there needs to be a clear and robust proof of the return on investment. Even in the financial crises that we are in right now, there are still funds available for new projects but you have to prove the value of it to the organization.

Now, I don’t have the killer application laying around here. I can however tell you what the killer app should be like in order to convince your organization to invest in Surface computing. So, pick the items from the list below and fit them into your sales pitch:

Software should make the company money

The days when people invested in computers and software just because ‘it is cool’ are over. The budgets don’t allow for fun projects anymore. So when you make your case for your project be sure to focus on the way that this investment is going to make your organization some money.

Focus on the return on investment. It can be that by using Surface your customers will be buying more goods from you. Or that by using Surface the customer satisfaction will increase. Or maybe Surface allows you to tap into markets you haven’t been able to reach: after all, Surface does have an appeal to people.

If you design a system that doesn’t utilize the core features of Surface, or more specifically: doesn’t do anything that cannot be done on a normal computer, then chances are the project won’t get a green light. Outline the added features of Surface that no other platform offers, and you’re halfway there.

Surface is all about communication and collaboration

The Surface machine is a table with a PC inside. It’s not the other way around. The focus is the form factor of the unit: it’s a table! Table are one of the oldest means of communications: people sit at one, gather around one for meetings and use it as a container for documents. I bet you never thought of tables in that way, but it’s true! Now, add a computer to that, a computer that all people can use at once and you’ve got a very good mechanisme for improving communication. People who sit at a table are more effective than when you present your data in a traditional way (i.e. beamer). Tables invite people to share documents and talk to one another. They can look at each other and learn from each other, something that doens’t happen with other computer technologies.

The PC is, as it name implies, personal machines. Surface isn’t a PC: it’s a way for people to interact with each other and the data available to them. So make sure your Surface apps focusses on enabling people to work together, to share insights together and to come to a result they couldn’t have reached with traditional means.

Surface is a way to distinguish yourself from your competitors

Although this point is hard to prove and even harder to measure, it still is valid. We’ve noticed that companies that utilize Surface in the correct way (see the two points above) are considered to be more up-to-date with technology than other companies. So if you want your company to be seen as a leader in technology adaptation, Surface might be the right choice for you. But don’t forget: this point alone isn’t enough: the ROI and communication parts are still as important!

Surface allows non-technical people to interact with computers

The whole nature of the Natural User Interface that Surface stands for, allows for people who are not that savy with mice and keyboards to use computers. Better than that: they might not even notice they are using computers at all. So if you want to target an audience that normally wouldn’t be able to use computers, or not be able to take full advantage of the potential a PC offers, Surface might be the tool for them. Young children and elderly people are the kind of demographic groups you might think about.

If you can think  of a case that addresses most of these points,  you might have a killer app on your hands, one that will convince the management of your organization to purchase a Surface and let you develop with it. And if you do, let me know!

Video impression (in Dutch) of the first Surface UG

During the first meeting of the Dutch Surface User Group we had a video crew available who created an impression of the evening. All in Dutch, but if Dutch doesn’t scare you you might want to watch this.

We’re looking forward to the next meeting!

Tags:

Sounds in a Surface application

Tags:

I have a confession to make. Never in my life have I ever felt the need to include sound effects in my applications. I have been programming professionaly for over 16 years and it has never happened to me that my manager or a customer walked up to me and said “Dennis, please add a whooshing sound to this button so I know that I clicked it.”

I am sure that goes for the most of you. Well, at least the people who write LOB systems. After all, it would be quite disturbing to have a, let’s say order entry application, make sound every time an order is entered. Especially if that application is used by more than one person at the time, in the same office. Computers need to be quite and business applications even more so.

And then I moved to developing Surface applications. I never thought that I needed to include sound effects, mainly because the whole idea of SFX has never been on my horizon. Until I read this article on Sound on a Surface by Richard Wand. It was quite an eye ear opener for me.

Of course my applications can benefit from the right amount of audio feedback! The Surface unit is equipped with 2 pretty decent speakers, so why not use it? I know that there are situations where sound is discouraged, but in most cases the right amount of audio feedback can make the emersive experience that Surface is supposed to deliver even better.

The danger is of course that I will make a big jukebox or pinball machine out of my application: adding sounds to every gesture and action the user can do. To be honest: I have no idea what the right amount of sound is.

But right now I’ve added one little sound effect: the sound of cards shuffling. I think this sound is pretty effective: it gets played whenever the user selects a product from the product catalog and wants to see the photos associated with that product. The visual effect is that you see a list of photos stacking up, the chosen sound effect fits perfectly.

Since I am not a sound designer and our graphical designer doesn’t know anything abuot sound either, I had to find some good sound resources on the web. Luckily, they are not that hard to find. One quick search brought me enough resources to continue improving my application.

So, turn up the volume and enjoy the even better Surface experience!

Tags:
Twitter