This project is read-only.

How a PixelSense unit can intarct with some WP7 devices

Main purpose of show how a PixelSense device can interact with a Windows Phone 7 device.

To achieve this result the idea is to place some WP7 devices on a sur40 and on the screen of the handled device will be shown the portion of PixelSense's monitor that is directly under the phone.

Also, when the phone is above a content and the user makes a gesture on the phone (that could simply be an hold gesture) the PixelSense’s content will be directly sent to the phone!

As last interaction the user can select a content on the phone and send it on the PixelSense unit, in that way another user can go with its phone on the content and get it!

There are two main problem to solve to achieve these results:

  • How to "connect" the big and small touch devices
  • How to get the position of the little one and send only the correct portion of screen

Well, for the first problem we will use WCF to expose some services and thanks to these PixelSense will be connected to the handled device.

For the second problem we will use some Surface SDK 2 events and components

How services are implemented

There is a namespace called “SurfaceInteraction.MetaData” where all entity definitions, service contracts and common types and object are defined. This assembly is referenced by both the Surface UI and Service and in a rhetorical beautiful world have to be used by WP7 UI too (for the moment WP7 will use the proxy generated object)

If some of my colleagues will read my words will say: “Gian Paolo is coupling? What’s happeningjQuery15207042980549233602_1340831411247” Well, Surface emmm PixelSense world is not the huge distributed world so, about me, for this and some other reason that maybe I will discuss in some other posts, coupling is allowed.

Now let’s look at SurfaceInteraction.Services.Implementation

It is not a WCF service but only a class library, or if you prefer a WCF Service Library (that is a class library with the needed reference for WCF) in that way you can host it on IIS or directly on an application.

If you will host the service on IIS you will need some content repository (such as a database) to let the PixelSense application to share contents with the service, if you host the service in process the PixelSense application will be able to share content with the service simply setting some public properties exposed by each service and also to subscribe to some events generated by the service to request content.

Here we are hosting the service in process connection between WP7 and PixelSense is done.

You can also use this pattern when you need to connect any kind of device such as Sifteo cubes, Windows 8 devices or also iPhone, iPad (wcf offers some really simple ways to expose services as Json).


How to send the right portion of monitor to WP7

As said before in this sample we will use tagged phones so when a phone is placed on the surface it will start polling asking for its portion of monitor we will simply cut it in a correct way and make this image available for the service that once invoked will send the image


What there is to do

Unfortunatelly in these perihod I'm really busy and I've this proof of concept in my todo list from some moths so I decided to share it and hopefully find someone else intrested in finishing it. I will give all the time and support I will be able to give

I noticed that on simulators all works fine, but not on the sur40, unfortunately at this moment my sur40 in waiting for the second time for assistance so I’m not able to do this

The size of the cut image is not correct so some other test on sur40 have to be done

All the part of send and receive images from and to sur40 have to be implemented


Something else to say

In these poc I'm using tags but with some more effort all this will work with untagged objects.

The WP7 you will see is my really first app so don't expect mutch, I wrote it in 2 hours, so don't expect to see wonderfull code.

Last edited Jun 27, 2012 at 10:42 PM by GianPaoloSantopao, version 7