Quantcast
Channel: Intel® C++ Compiler
Viewing all articles
Browse latest Browse all 1616

Eclipse* IDE: Using Android* Native Developer Kit (NDK) on Windows* Systems

$
0
0

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® System Studio (ISS) into a preexisting Eclipse* CDT installation. If you have already installed the Intel® System Studio (ISS) 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® System Studio (ISS) product installer.

Note

The Eclipse* SDK, Eclipse* JRE and the Eclipse* CDT integrated development environment are not shipped with the product.

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++.

As a prerequisite to developing Android applications in Eclipse, the IDE must be integrated with the Android Developer Toolkit (ADT) plugin. For more information on ADT, go to http://developer.android.com/tools/help/adt.html

Now, follow these steps to configure Eclipse to use the Android* NDK plugin:

  1. Start Eclipse, open Window> Preferences> Android> NDK and set the path to the NDK.

  2. Create a new project from the NDK samples:

    1. From the Eclipse menu, select File> New> Project...

    2. Select Android Project from Existing Code and click Next.

    3. Browse to the directory [ndk-dir]\samples\hello-jni, check Copy projects into workspace, and then click Finish.



  3. Configure the project to include Native Support:

    1. To add Native Support to the project, right-click on the project name in the Project Explorer window, select Android Tools > Add Native Support …



    2. A dialog opens asking for the Library Name. Set the library name to hello-jni as shown below:



  4. Create a new file named Application.mk in the jni folder with the following lines:

    • For 32-bit targets:

      APP_ABI:=x86
      NDK_TOOLCHAIN:=x86-icc
    • For 64-bit targets:

      APP_ABI:=x86_64
      NDK_TOOLCHAIN:=x86_64-icc
  5. To build your project, right-click on the project name in the Project Explorer and select Build Project.

You can test the application on any Intel architecture-based Android device including an Android Virtual Device.

Inglés

Viewing all articles
Browse latest Browse all 1616

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>