4

I have a fully-functional Java program that's fairly long, and I want to transfer it to an Android tablet. It's my first time doing anything for the Android. I know that it requires a different type of Java (or whatever the fancy lingo for that is), but I reeeeeaaallllly don't want to rewrite this WHOLE thing. Are there any easy swaps or equivalent thingies to import for my Android app? Here are the imports I have in the current program:

import java.awt.*;  
import java.util.*;  
import java.awt.event.*;  
import java.awt.geom.*;  
import java.awt.color.*;  
import java.awt.image.BufferedImage;  
import javax.swing.*;  
import java.io.*;  
import java.text.*;  
import javax.imageio.ImageIO;

Any other tips or links regarding the matter would be appreciated.

thkala
  • 84,049
  • 23
  • 157
  • 201
Kalina
  • 5,504
  • 16
  • 64
  • 101

1 Answers1

11

You aren't going to able to port your application without some serious rewriting. From that list, Android does not have anything from:

  • java.awt.* (other than font)
  • java.awt.event
  • java.awt.geom
  • java.awt.color
  • java.awt.image.BufferedImage
  • javax.swing
  • javax.imageio.ImageIO

Any of your code that uses those will have to change dramatically.

The most significant issue is that Android has its own activity/view system instead of Swing/AWT, so you will have to redo your entire user interface from scratch.

Christopher Souvey
  • 2,890
  • 21
  • 21
  • So basically he has to rewrite his GUI, which considering that it was written for a desktop is a good idea anyhow (does swing even has touchsupport?). Let's just hope someone was a good boy and used MVC or something similar ;) – Voo Jun 11 '11 at 20:52