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!
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
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:
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:
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:
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:
Surface
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.
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….
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!
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!
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!
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!
Sometimes I get the feeling the Dutch are pretty much of a gadget freak. Somehow we are always one of the firsts to try out new things, to play with new toys and to advocate new technologies. Since we have quite a small population (about 16 million people) I find it rather amazing that everytime there is something new and cool, you’ll always find some Dutch there.
Same goes for Surface. Dr. Neil Roodyn told me once that no matter where he gave his Surface training, there was always at least one Dutch guy in the room. I’ve heard that the Dutch have, relative to the number of people, the largest installed units in the world!
Of course, “a lot of Dutch Surface users” isn’t enough for me. So in order to make people in the Netherlands more aware of the possibilities of Surface and to help companies make the right decisions, we’ve decided to launch the Dutch Surface User Group.
In this usergroup we will focus on three main areas.
1. What? Here we will answer all questions on what Surface actually is, what the hardware is like, how to deploy it, etc.
2. Why? This is a bit harder: why should a company invest in the hardware and the knowlegde around Surface? What is the business case for a Surface machine? What will be the benefit of an organization should they decide to purchase a Surface unit?
3. How? The how is more on the software side of things. We will help out the developers with the struggles every starting Surface Dev faces in the beginning. How do you use the SDK? How do you accomplish a certain task in WPF?
In order to answer those questions we will organize real life meetings (after all, things are much easier to explain when you have access to the hardware!), we will blog (such as this blog!), we will give lectures and we will maintain a forum.
The site of the UG is (all in dutch) http://surface.dotned.nl The UG is part of the larger dotNed community, which currently is the largest .net usergroup in the Netherlands (of which I happen to be the chairman, but that’s besides the point :-) )
We hope it will be a success and that we will be able to make Surface even more succesfull!
My english blog has landed. Although I have been blogging in Dutch for quite a while now, it’s time to change gears a bit. I will continue to blog on my original blog site (which is http://www.dotned.nl ) but I will also post stuff here which might be of interested to a larger audience.
Being a C# MVP means I will talk about Visual Studio .net, C# but mostly about Microsoft Surface.
So stay tuned!