The Source for Java Technology Collaboration
User: Password:



Daniel Brookshier

Daniel Brookshier's Blog

The Riddle of the Spinx

Posted by turbogeek on August 10, 2003 at 11:22 PM | Comments (6)

RTFM==QED

Sometimes you do something that surprises people. Jaws drop and wonder is seen in your friend’s eyes. You too can tap into these secrets of the ancients. See a source of hidden knowledge, known only to select few. Answer the riddle of the Sphinx, just by reading the manual.

A little knowledge, creativity and some imagination and you can change the way people think. I have just recently done just that. I do it a lot because I have a habit of reading the manual and exploring how I can apply what I have read in ways the authors have not expected. It’s a bad habit from school where I was bored with dry assignments, so I twisted them to be interesting to me, rather than the teacher. Yes, I was a rebel…

I Robot

What I have done recently is to mix a couple disassociated things to create something not really intended by the designers. The first is Robot class in the java.awt package. This is certainly one of those read-the-manual things. You may have not heard of the Robot class. Robot was probably added to Java in 1.4 to help with testing. First it can capture an image of the entire desktop or just a part of it. This is quite a cool considering that in the past Java was limited to its own windows. The second, and very surprising feature is that it can send mouse and keyboard events to the operating system. In effect, controlling the entire desktop. Quite a departure from what you thought Java could do eh?

A Remote Possibility

Of course what this meant to me was that I could do more than capture the desktop or control things for a test. This meant I could control the computer from a Java application. Specifically I wanted to do it remotely. More specifically, using JXTA.

JXTA-Remote-Desktop was born! No need to dig up bodies and piece the monster together. Just pick up a couple of pieces and read the manuals. The Jr. Frankenstein kit.

Open Source A Me

What is JXTA-Remote-Desktop(JRD)? First it is open source and hosted here at java.net. It’s a simple implementation of the remote desktop idea, like PC Anywhere, Go To My PC, or VNC. It is written in 100% Java using JXTA as a transport. The key difference from the competitors (it is hard to compete with VNC because it is free), is that JRD can connect any two PC's even if there is DHCP, a firewall, or a NAT**.

JXTA's P2P network uses other generic computers to act as middlemen for HTTP tunneling and relay of messages. This is not a big security hole because the computer behind the firewall must be a willing party to the communication, just like other HTTP tunneling applications. JXTA also has its own addressing scheme so NAT and DHCP are not a problem.

JXTA is certainly not the best choice (message rather than stream based, and it has unpredictable data rates), but it is the only choice for this type of application. Think about your average PC. You can't get to it with a URL because it has no web address. You can't depend on its IP address because it changes. And there’s usually a NAT or firewall preventing direct access. JXTA lets you access almost any connected PC no matter what its current IP address or topology.

How good is JRD? Well, it is not as good as VNC yet. There still needs to be a little work to get the screenshots to be a little more efficient. Most remote applications use the native OS to get just what changes on the screen while JRD is limited to screen shots. JRD can become better through a combination of compression and differencing techniques similar to Internet video. The I/O of mouse and keyboard are delayed quite a bit so the user does not get too far ahead of the screen updates.

JXTA-Remote-Desktop is getting closer to being a viable application. The code works and there is even a multiplatform installer. I will also have an article at P2PJournal.com soon to explain the code. Since it is open source, I am looking for help to improve it. High on my wish list is better video differencing. I challenge you to look at the code and come up with an innovating solution to this devilish problem.

More to come! Up next, running Java and JXTA applications on an Apple Macintosh!

** NAT is an acronym for Network Address Translation. Most cable modems and DSL routers implement NAT. A NAT prevents anyone from directly contacting a PC from outside your home network.


Bookmark blog post: del.icio.us del.icio.us Digg Digg DZone DZone Furl Furl Reddit Reddit
Comments
Comments are listed in date ascending order (oldest first) | Post Comment

  • Hi Daniel,

    The problem for me about JXTA is the lack of autoconfiguration.

    At this time JXTA is not at all user friendly as you need to be a network wizard to set this up the right way.

    Such a major issue prevent me from using JXTA. And I have to see for alternatives like implementing my own HTTP tunniling mechanism :(

    Regards,
    JB

    Posted by: bjb on March 24, 2005 at 07:09 AM

  • Actually, autoconfig is now available and has been working reasonably for a year or so. See http://wiki.java.net/bin/view/Jxta/ExtConfig for information on the feature.

    Posted by: turbogeek on March 24, 2005 at 07:45 AM

  • Hi Daniel,
    I m also working on remote desktop using robot class, but he problem is that the frame transfer is little slow, i have tried almost all thing to grab pixel from the bufferedImage returned by the robot.createScreenCapture. i have tried pixel grabber, getRGB and i m using imageio.write and read methods to write and read bytes from the buffered image. Do u have any idea about this. And can u guide me i want to work with you.

    Thankx
    Regards
    Umair shahid
    BS(CS)

    Posted by: maxpyane on July 23, 2005 at 01:19 AM

  • hi,
    can you show the source code snppets to get the idea
    by

    Posted by: mandarbhave on December 04, 2006 at 02:55 AM

  • Hello, I also have a JXTA remote desktop application as well. It is open source and supports some features you have listed as todo on your site including tiles that are only sent when they change, encryption and some other features. If you are interested you are welcome to use the code or we could work together on new features. Please see http://www.webpresenter.ca.

    Posted by: jontaylor on October 12, 2007 at 08:40 AM

  • Why r u using Robot class?
    We can do this type of remote screen capturing in means of JMF RTP.


    Posted by: madan_prabhu on December 30, 2007 at 02:58 PM





Powered by
Movable Type 3.01D
 Feed java.net RSS Feeds