且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

在实际手机上编译 android 应用程序

更新时间:2023-02-27 08:11:33

我认为您要求的是一种在 android 设备上编译 android 应用程序的方法.

I think what you are asking for is a way to compile android apps on an android device.

像这样的应用新 IDE 的表现.

the way an app like this new IDE does.

如果是这样,您需要做的是采用开源 Java 编译器,例如 ejc(Eclipse 中使用的 Java 编译器)并使用它来编译您的 Java 源代码.然后,您需要移植 dalvik 编译器才能运行,以便从 java 编译器生成的类文件生成 dex.

If so what you would need to do is to take an open source java compiler such as the ejc (the Java compiler used within Eclipse) and use it to compile your java source. You would then need to port the dalvik compiler to be able to run, in order to generate dex from the class files generated by the java compiler.

对 AIDE 开发人员的采访提供了更多关于他们如何做到的信息.

An interview with he developers of AIDE has a little bit more info on how they did it.

更新:

实际上我刚刚遇到了一个 开源项目,它提供了类似的功能,但基于使用 vim 和现有的 SDK cli工具移植到安卓设备上运行.该项目托管在此处.

Actually I just came across an open source project which provides similar functionality but based on using vim and the existing SDK cli tools ported to run on a an android device. The project is hosted here.

更新 2:

我还发现了另一个开源项目,它也可以在我认为的设备编译/构建上执行应该为您提供您正在尝试做什么的示例...

I found yet another open source project that also does on device compile/build which I think should provide you with examples of what you are trying to do...

更具体地说,如果您查看 IDE.java,可以看到各个工具(ejc、dx、aapt)是如何调用/使用的.

More specifically, if you look in IDE.java, you can see how the individual tools (ejc, dx, aapt) are called/used.