This topic applies to Eclipse* for C/C++ on Windows* hosts for Android* targets.
You can automatically integrate the Intel® C++ Compiler that is part of the Intel® Integrated Native Developer Experience (Intel® INDE) into a preexisting Eclipse* CDT installation. If you have already installed the Intel® Integrated Native Developer Experience (Intel® INDE) product you can integrate the Eclipse components separately using Eclipse Help > Install New Software menu item. You can also install Eclipse and integrate its components using the modify feature of the Intel® Integrated Native Developer Experience (Intel® INDE) product installer.
For more information on using Eclipse with the Intel® C++ Compiler refer to the User and Reference Guide for Intel® C++ Compiler > Getting Started > Using Eclipse* in this documentation. For information on which versions of Eclipse are supported refer to the Release Notes supplied with the product.
There are two approaches to building Android* applications with Eclipse* IDE:
Using the environment files and the -platform compiler option.
Using Android* Native Developer Kit plugin.
This topic describes how to configure Eclipse* IDE on Windows* host systems to build C/C++ applications for the Android* target platform using the Android Native Developer Kit (NDK). The Android NDK is a toolset that allows you to compile those parts of your application that use native-code languages such as C and C++. It is installed as part of the Intel® INDE product installation.
Follow these steps to configure Eclipse to use the Android* NDK plugin:
Start Eclipse, open Window> Preferences> Android> NDK and set the path to the NDK.
Create a new project from the NDK samples:
From the Eclipse menu, select File> New> Project...
Select Android Project from Existing Code and click Next.
Browse to the directory [ndk-dir]\samples\hello-jni, check Copy projects into workspace, and then click Finish.
Configure the project to include Native Support:
To add Native Support to the project, right-click on the project name in the Project Explorer window, select Android Tools > Add Native Support …
A dialog opens asking for the Library Name. Set the library name to
hello-jni
as shown below:
Create a new Application.mk file under jni folder with this line:
APP_ABI:=x86
Build the project. Right-click on project name and select Build Project.
Test your application on any x86-based Android device including an x86-based Android Virtual Device (AVD).