The paarc library is a project aimed at developers that want to use a Windows Phone as input device for any .NET application running on a remote/desktop computer. It consists of different included components ranging from the core library, a reference implementation
on the phone and several samples on the PC side (more on all this below). The library doesn't make any assumptions about the remote .NET application per se, which allows you to connect a phone to any kind of desktop application or game, for example to
use it as sensor, as touch input device, game controller, remote keyboard, or whatever else you intend it for.
For a quick live demo of the library in action with some basic explanations, take a look at this 7-minute video:
A stub website that contains more information about the Windows Phone PAARC app as well as a ready-to-go installer for the above demonstrated PC application can be found here (targeted at end-users):
A more elaborate introduction screencast that shows the development side in more detail can be found here (also don't miss the how-tos below):
The following is a collection of how-tos to get you up and running with the library:
Use the library in your own projects
Compile the source code
paarc consists of the following parts:
- Core library: the core components are made of the following four parts:
- Two client-side Windows Phone assemblies that are able to acquire data from different phone sources, and to connect to a remote server using sockets. The communication assembly is able to receive configuration and control commands from a connected server,
send data back to the server, and to use multicast to discover a server on the same network automatically. The data acquisition assembly includes the following possible data sources:
- All built-in sensor APIs of Windows Phone, like the accelerometer, compass, gyroscope and combined motion API (partly restricted by what the device hardware actually supports)
- Raw touch input from the touch panel, including multiple simultaneous touch points
- All built-in high-level touch gestures (tap, double-tap, hold, flick, free/horizontal/vertical drag, pinch)
- A custom drag gesture mode to simplify dragging
- Text input using the built-in SIP keyboard.
- A server-side .NET 4 assembly that listens for incoming client broadcasts or direct connections and is able to both send control and configuration commands to a connected phone as well as receive data that is acquired on the phone.
- A shared assembly for the used data types, interfaces and more.
- A reference Windows Phone client application: this application makes use of the Windows Phone assemblies of the core library. The UI allows connecting to a remote server and provides features to perform user input for all above listed gestures, raw touch
input, sensors and text. The intended use is for developers that do not want or require to create a custom phone application, and the ultimate goal is to publish this app to the Marketplace for public use, once it has reached a mature state.
- Sample desktop applications: The project includes a few sample applications to demonstrate the use of the library. In particular, the following applications are included:
- Cube: Demonstrates how to use sensors (the accelerometer), gestures and raw touch input to control content in an application. The rotation of a 3D cube is controlled using the accelerometer, zoom is handled using pinch gestures, and translations are performed
by raw touch input. A good starting point for developers of .NET applications to learn using the library quickly.
- ConsoleApplication: a simple command line server that allows sending a small subset of the available commands to the phone, and to display data received from the phone. Handy for quick tests and to learn the basics, can easily extended for your own needs.
- PCController: the most sophisticated sample and the original motivation to start developing this library. This sample converts the input received from the phone into operating system commands to manipulate the mouse cursor. It effectively lets you control
your desktop computer using gestures, raw touch, accelerometer and text input, including features like: left, right and double mouse clicks, moving the cursor in relative and absolute positioning mode, drag and drop, two-finger scrolling/mouse wheel emulation.
This sample is not meant as a simple demonstration or to easily learn the use of the library, but a real-world example for a more advanced use.
- LogService: A supporting helper application for troubleshooting and diagnosis.
More detailed documentation about the individual components will be added in the future.
After the update to Windows Phone 7.1/7.5 ("Mango"), there were some phone devices that showed odd behavior with TCP/UDP sockets. This is
a bug in the library, but an issue with the phone's firmware. In particular, the Samsung Omnia 7, several HTC models (Trophy, Mozart and HD7) as well as the Dell Venue Pro are confirmed to be among the problematic models. More information and
a detailed analysis of the problem can be found
. If you run into these issues, please make sure your phone's firmware is up-to-date to solve the issue. In particular, the problem is fixed for:
- the Samsung Omnia 7: firmware 2422.214.171.124+
- the HTC Trophy: firmware 2250.21.51002.161+
- the HTC Mozart: firmware 2250.21.51007.401+
- the HTC HD7: firmware 2250.21.51007.401+
- the Dell Venue Pro: nobody confirmed this is has been fixed for this device so far. If you have more information, please let me know.
There is no official schedule or roadmap; I'm adding features when I find the time. However, the following things are already on my TODO list and can be expected in the future:
Reference client: Add tutorial or help screen to make it easier for the end user to get started
> done Reference client: Add configuration/options screen, in particular:
Add configuration option to disable lock screen (to prevent the screensafer from kicking in if the client only makes use of sensors)
> done Reference client: Once the two features above are added, try to submit the application to the Marketplace
> done, submitted and accepted on Dec 17th Reference client: Improve auto-reconnection after activation if no WiFi connection is available (auto-reconnect after lock screen usually fails because it takes a few seconds to restore the connection)
> done LogService: Make the service endpoint address configurable in the UI
> done Create a binary release that is easier to use for interested devs
> done (Dec 19th)
- Unit testing(?): I've started two different approaches to unit test the library in the past. However, due to the distributed nature, the involved multi-threading, the rather complex code sharing setup of portable class libraries combined with linked
files and conditional compilation, and of course also the lack of isolation frameworks for Windows Phone I'm not satisfied with any of the outcome so far - if some unit testing guru reads this, I'd also be glad to hear an external opinion or recommendation
If you find any bugs, have feature requests or want to contribute to the library, make sure to use the issue tracker or contact me. Forks/pull requests also are welcome.
My name is Peter Kuhn ("Mister Goodcat"), and among much other I'm a Windows Phone enthusiast :).
You can learn more about me
, and read more from me on my blog