如何将现有的Java程序转移到Android上? (导入什么)
我有一个功能齐全的 Java 程序,但相当长,我想将其传输到 Android 平板电脑上。这是我第一次为 Android 做任何事情。我知道它需要不同类型的 Java(或者任何花哨的行话),但我真的不想重写这整个事情。是否有任何简单的交换或等效的东西可以为我的 Android 应用程序导入?以下是我在当前程序中导入的内容:
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;
有关此事的任何其他提示或链接将不胜感激。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果不进行认真的重写,您将无法移植您的应用程序。
从该列表中,Android 没有以下任何内容:
任何使用这些的代码都必须进行巨大的改变。
最重要的问题是 Android 有自己的活动/视图系统,而不是 Swing/AWT,因此您必须从头开始重做整个用户界面。
You aren't going to able to port your application without some serious rewriting.
From that list, Android does not have anything from:
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.