Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
582 views
in Technique[技术] by (71.8m points)

android ndk - How to install and Build NDK with eclipse?

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.

Thanks in advance.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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

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.

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.

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

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.

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

     cd /path of your workspace/project name 

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

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

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.

Step 6 : Final step is creating your java file.

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


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...