porting screen shot java app on android
<p>i want your help very badly..bcz i am seeking an answer for this from couple of day's but did not find a bit...</p>

<p>my query is i have a screen shot app written in java...i just want to port it on android emulator and run it..i know i have to rewrite some android specific code but can anyone tell me what changes i should make to the screen shot java app to make it run on android platform..
here is my java screen shot app: (i know for this the device should be rooted i am okay for that)</p>

<pre><code>import java.awt.AWTException;    
import java.awt.Robot;
import java.awt.Rectangle;    
import java.awt.Toolkit;
import java.awt.image.BufferedImage;
import java.io.*;
import javax.imageio.ImageIO;

class ScreenCapture {

  public static void main(String args[]) throws
           AWTException, IOException {

     // capture the whole screen

     BufferedImage screencapture = new Robot().createScreenCapture(
           new Rectangle(Toolkit.getDefaultToolkit().getScreenSize()) );

     // Save as JPEG
     File file = new File("screencapture.jpg");

     ImageIO.write(screencapture, "jpg", file);

     // Save as PNG
     // File file = new File("screencapture.png");
     // ImageIO.write(screencapture, "png", file);
  }

}
</code></pre>
