简体   繁体   English

Android的Java级兼容性?

[英]Java level compatibility of Android?

I have a set of Java background programs (daemons) I'd like to port to Android. 我有一组Java后台程序(守护程序),我想移植到Android。 The programs are OpenJDK 1.6 compatible, they currently run on Linux. 这些程序与OpenJDK 1.6兼容,它们当前在Linux上运行。

I have a couple of questions: 我有一些问题:

  1. Is Android compatible with OpenJDK 1.6? Android与OpenJDK 1.6兼容吗?
  2. How would I compile the programs for Android? 我将如何编译Android程序?

Thank you, Caesar. 谢谢凯撒。

Is Android compatible with OpenJDK 1.6? Android与OpenJDK 1.6兼容吗?

In terms of bytecodes, yes. 就字节码而言,是的。 However, existing Java code may well use classes that are not in the Android SDK but happen to be in Java SE, Java EE, etc. 但是,现有的Java代码可能会使用不在Android SDK中但恰好在Java SE,Java EE等中的类。

How would I compile the programs for Android? 我将如何编译Android程序?

You don't. 你不知道 You write an Android app that happens to reuse some of your existing code. 您编写的Android应用程序恰好会重用一些现有代码。 For example, there is no user interface in a Java SE or Java EE app that will work well out of the box on Android. 例如,Java SE或Java EE应用程序中没有用户界面,可以在Android上立即使用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM