在 Android Studio 上调试 Codename One 应用

Debugging Codename One app on Android Studio

我需要在 Android 上调试我的 CN1 应用程序。这就是为什么我成功地按照 this Codename One tutorial 中给出的说明进行操作(我按照说明复制并更新了 gradle 文件依赖项内容)。

我现在对更新的源部分有点困惑。

There is a portion we didn’t get into with the video, copying updated sources directly without sending a build. This is possible if you turn on the new Android Java 8 support. At this point you should be able to remove the libs jar file which contains your compiled data and place your source code directly into the native project for debugging on the device.

如果我更改本机实现文件中的内容并且启动调试过程,它似乎可以正常工作。但是我必须从 libs 目录中删除 userClasses.jar 文件吗?实际调用此 jar 文件的时间是什么时候?

此外,我还可以更改 Android Studio 中的 CN1 代码(例如 Main Class 中的更改)或者这些需要在服务器上进行适当的构建过程吗?

2016 年 11 月 22 日更新

根据我的经验,第一次在 Android 中调试应用程序时,您需要复制粘贴源文件和 userClasses.jar(在 libs 文件夹中)。当您仅更新本机实现文件时,您可以 运行 调试而无需发送构建。但是,如果您更改 CN1 代码中的某些内容,只要您不更新 userClasses.jar,它就不会反映在 Android 中(这似乎合乎逻辑,因为 Android 对 CN1 一无所知).

感谢任何信息,

干杯,

构建服务器无法访问您的代码,只能访问带有 bytecode/data 个文件的 jar,而用户 jar 就是 "almost" 那个 jar。

我们 运行 一些字节码处理,例如 retrolambda 和其他东西,因此它与您在构建项目时编译的内容不完全相同。

如果您将源目录复制并粘贴到项目中,您将需要删除该 jar,这样您就不会看到重复的 类。您还需要启用 Android Studios Java 8 种语言支持才能使其正常工作。