如何安装和使用Eclipse构建NDK? [英] How to install and Build NDK with eclipse?

查看:186
本文介绍了如何安装和使用Eclipse构建NDK?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用Ubuntu 10.10版本在那里我用来开发使用eclipse Android应用程序。现在,我需要使用NDK用它来加载本地libraries.So任何一个可以请帮我在这里安装和构建NDK最新版本。

I am using ubuntu 10.10 version where i used to develop android applications using eclipse. Now i need to use NDK with it to load native libraries.So can any one please help me here to install and build NDK latest version.

先谢谢了。

推荐答案

我也跟着由Santhosh_pulliman提到的链接中给出的步骤,我得到的输出。这可能会帮助你。

I followed the Steps given in the link mentioned by Santhosh_pulliman and I got the output. This may help you.

第1步:在Eclipse中的C / C ++支持安装
         这将使你在Eclipse做C语言程序。如果这
         安装完成后,那么你将能够看到C / C ++项目选项
         在创建新的项目。

Step 1 : Installation of C / C++ support in eclipse This will enable you to do c language program in eclipse. If this Installation completed, then you will be able to see the c / c++ project option while creating new project.

第2步:安装Cygwin
         因为你是在Ubuntu 10.10的工作不需要你这一步。所以,你会
         能够使用该终端。

Step 2 : Installing Cygwin This step is not needed for you as you are working in ubuntu 10.10. So you will be able to use the terminal.

第3步:安装NDK的Andr​​oid
         下载NDK,并把它放在你有Android SDK中的文件夹中。

Step 3 : Installing Android ndk Download the ndk and put it in the folder where you have you android sdk.

步骤4:创建一个新的Andr​​oid项目,并创建一个新文件夹命名为JNI和该文件夹中
         添加make文件和.c文件中给出的链接。

Step 4 : Create a new android project and create a new folder named jni and in that folder add the make file and .c file as given in the link.

第五步:打开终端,用cd命令浏览到您的项目目录

Step 5 : Open the terminal, navigate to your project directory by using cd command.

     cd /path of your workspace/project name 

现在从项目文件的位置执行NDK-build命令。

Now from the project file location execute the ndk-build command.

/your ndk path/android-ndk-r4/ndk-build

这会给你的.so文件,这意味着生成的库文件。

This will give you .so file which means the library file is generated.

如果你在这里得到错误,则安装等步骤将是有错误。

If you are getting error here then the installation and other step will be having error.

第六步:最后一步是创建你的java文件

Step 6 : Final step is creating your java file.

现在可以运行该应用程序。你会得到输出

Now you can run the application. you will get the output

这篇关于如何安装和使用Eclipse构建NDK?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆