且构网

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

安装和放大器;使用Android NDK Eclipse中

更新时间:2023-11-16 22:18:28

尽可能简单,我可以形容它,在Eclipse中使用NDK的构建从Android应用程序需要两个步骤。

As simply as I can describe it, building an Android app from within Eclipse that uses the NDK requires two steps.

首先,你的终端里面,你需要运行NDK您的项目构建脚本。该目录中的cd到你的项目的根目录下,然后执行NDK-构建脚本。

First, inside your terminal you need to run the NDK build script on your project. cd into the root of your project directory and then execute the ndk-build script within that directory.

例如:

cd ~/workspace/hello-jni
./~/android-ndk-1.5_r1/ndk-build

这样做后,你应该会看到一些输出,结果在创建OBJ目录中的项目目录中的* .so文件中。

After doing this, you should see some output that results in the creation of a *.SO file within the obj directory within your project directory.

一旦你的* .so文件,最后一步,通过Eclipse中构建了Android NDK的应用是与Eclipse就像你盖了任何其他应用程序,然后将其部署进行测试。

Once you have the *.SO file, the final step to building an application with the Android NDK through Eclipse is to build it with Eclipse like you would any other application and then deploy it for testing.

如果您进行任何更改的C / C ++ code,你需要重复步骤之一,在Eclipse中再次构建和部署应用程序之前,重新生成* .so文件。

If you make any changes to the C/C++ code you'll need to repeat step one and regenerate your *.SO file before building and deploying your application from within Eclipse again.

我想指出,通过使用Android NDK的Andr​​oid应用程序仍然基于Java的。他们只是用code由 Java本地接口​​>的方式写在C / C ++进行通信。

I would like to note that by using the Android NDK your android apps are still based upon Java. They're just communicating with code written in C/C++ by way of the Java Native Interface.

最后,我不知道有任何Eclipse插件,将与NDK的发展援助。我知道的一切关于NDK我已经学会官方的Andr​​oid NDK文档。请随意发表意见,并让我知道如果有什么我可以清理我的反应。

Finally, I am not aware of any Eclipse plugins that will aid with NDK development. Everything I know about the NDK I have learned the official Android NDK documentation. Please feel free to comment and let me know if there anything I can clear up in my response.