How to install and Build NDK with eclipse?
Asked Answered
C

1

4

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.

Crabber answered 23/2, 2012 at 4:35 Comment(0)
D
10

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

Dempsey answered 24/2, 2012 at 8:27 Comment(7)
I have been trying for the past 10 days to build ndk finally i got the output today. Thank you so much.Crabber
You are welcome senthil prabhu. Where did you do the mistake ?Dempsey
I have done with Step 1,3 and 4 got confused with step 2. and tried to build every time it fails. You helped me a lot to do thisCrabber
oh thats ok, and at last you got your error cleared. Thanks for accepting the answer Senthil prabhuDempsey
Yes it is working fine now. It has been breaking my head to do that since last 10 days. You helped me a lot thanks once again.Crabber
where is a link that you are refering in the step 4 ?Dissenter
Please refer to this link androidsnippets.wordpress.com/2012/08/30/…Pejoration

© 2022 - 2024 — McMap. All rights reserved.