views:

360

answers:

2

How can I best implement a system for send keystrokes/commands via an iPhone and/or Droid to a desktop or laptop computer via WiFi or bluetooth? There are apps for VLC, Keynote and other applications that do this, so I know it's possible but don't know what technology base to use.

The implementation is probably different on Windows and OS X, but if they could be similar that'd be a big win.

If VNC-type technology is used, that'd be fine but I only need to send key commands and mouse clicks—I don't need to be able to navigate the screen space.

+4  A: 

Assuming you're inquiring about implementation of such a program:

Server

You could write an application that injects keystrokes when given commands over TCP from the mobile device.

What OS is the desktop? Depending on the desktop OS the server solution will likely be different. However, you could write a cross-platform server application using Java and the Robot Class.

Also, if you want Bluetooth connections you will need to use a Bluetooth library. For the most code reuse, try to use a library which supports TCP over Bluetooth so that your command protocol can be reused.

Client

For the client simply write a simple application that sends messages over TCP to the server, which will interpret them and issue the key presses.

Ben S
This answer gives me valuable insight into how I can add bluetooth support and solidified my intent to use a Java-based approach for the iPhone OS if possible. I value both of your answers, I wish I could appoint both as correct. +1
Cirrostratus
+2  A: 

There is an Android app that does exactly what you want, and it is open source. It's called RemoteDroid and it sends keyboard and trackball events from your phone to your PC, and uses the screen as a touchpad. It doesn't do the full VNC thing with a view of the desktop on your phone.

The source is here: http://code.google.com/p/remotedroid/

mbaird
The OP mentions that he knows about such applications but is asking about the implementation.
Ben S
Which is why I posted a link to the SOURCE of the application. So he can view the implementation.
mbaird
A modified version of this is what I need, once I can port it over to the iPhone OS and add bluetooth support. I value both of your answers, I wish I could appoint both to be correct. I'm choosing this as the correct answer because it gives me the largest jump on the project.
Cirrostratus