移植Java应用程序到Android平台 [英] Porting java apps to Android platform

查看:225
本文介绍了移植Java应用程序到Android平台的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道的Java应用程序可以在Android中运行。但我想知道的是这样的:我有一个完全正常的Java应用程序,我想将它移植到Android平台。我需要什么样的变化做我的应用程序中的图形用户界面和其他code而言,使其在Android中使用吗?我知道Android使用XML文件来控制其应用程序的外观和感觉。所以,我需要彻底改变我的GUI?

我只是想知道如何移植可以进行一般的概述。如果任何人都可以点我正确的资源,这将是巨大的。另外,对于您的信息,我是一个新手,以开发Android应用程序,所以请耐心与我:)

I know Java apps can be run in Android. But what I want to know is this: I have a perfectly normal Java app and I want to port it to an android platform. What changes would I need to do to my app in terms of GUI and other code to make it usable in Android? I know Android uses XML file to control the look and feel of its app. So would I need to change my GUI completely?

I just want to know the general overview of how porting may be done. If anyone could point me to right resources, that would be great. Also, for your info I'm a newbie to developing android app, so please be patient with me :)

更新:两个非常有帮助的答案。谢谢!

Update: Both very helpful answers. Thank you!

推荐答案

简短的回答是,你会简单地重写所有的GUI从无到有,为Android。它只是使用了完全不同的UI框架。虽然基本上所有的核心Java库是那里的,Swing和AWT库不是。

The short answer is that you would simply rewrite all of the GUI from scratch, for Android. It simply uses a completely different UI framework. While basically all of the core Java libraries are there, Swing and AWT libraries are not.

如果您正在寻找自动翻译其中的一部分,我不认为有任何这样的工具。你将要打造一个全新的Andr​​oid界面。

If you are looking to translate parts of it automatically, I don't think there is any such tool. You're going to be building a brand new Android GUI.

真的,这是有道理的。这些框架提供合理的不同的平台和需求(桌面与手机)。你可能需要重新设计将你的应用程序相当多的从桌面到去电话。

And really, that makes sense. These frameworks are serving reasonably different platforms and needs (desktop vs. phone). You probably need to be redesigning your app quite a bit to go from a desktop to a phone.

好消息是,非GUI部分应该工作的,是没有改变的,除非他们做一些不寻常的。您可能需要打包第三方库到你的项目,如果他们使用你的code。

Good news is the non-GUI parts ought to work as-is with no changes, unless they do something unusual. You may have to package third party libraries into your project if they are used by your code.

这篇关于移植Java应用程序到Android平台的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆