我使用 LWUIT 框架开发了基于 j2me 的应用程序。是否可以将此应用程序更改为基于 android 的应用程序?或者我需要创建新项目吗?
3 回答
您必须将代码从 J2ME 完全重写为 Android。我一直在寻找一种来自 J2ME->Android 的翻译器,但一无所获。最后,我现在将我的 J2ME 代码转换为 Android。Android 的可能性比 J2ME 的精简 API 强大得多。所以你会发现你的新代码会比旧的 J2ME 代码更好。
虽然如果你只是在 Android 中启动 J2ME jar/jad - 这在理论上是可能的,因为 KVM 只是普通 JVM 的一个子集(在 Android Dalvik VM 的情况下)。有一些努力将 KVM 字节码转换为 Dalvik 的字节码。例如看这里
You may be able to take parts of your code across as android is still java but I would say that you're going to have to rewrite most of it and probably all of the code for the user interface. J2ME and Android are designed very differently
I have used LWUIT for this purpose. They created LWUITActivity class for android platform.