How to port an existing Java program to Android? (what to import)

I have a fully functional Java program that is quite long, and I want to port it to an Android tablet. This is my first lesson for Android. I know that this requires a different type of Java (or something else that is characteristic of it), but I still don't want to rewrite this ALL thing. Are there any simple swaps or equivalent things to import for my Android app? Here is the import that 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 on this subject would be appreciated.

+4
source share
1 answer

You will not be able to transfer your application without a serious dub. Android has nothing from this list:

  • java.awt. * (except 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 them should change a lot.

The biggest problem is that Android has its own activity / view system instead of Swing / AWT, so you have to redo your whole user interface from scratch.

+11
source

All Articles