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

Building Android* Applications Using Eclipse* IDE and Android* NDK

$
0
0

By default, the Android* NDK is configured to build an application for debugging within Eclipse* and all optimizations are turned off. When the code is ready for deployment, you must compile it for performance.

  1. Open Application.mk in your application’s jni folder at %NDK_DIR%\samples\hello-jni\jni\.

  2. To switch to the release mode, add the following line:

    APP_OPTIM=release

  3. To target a specific processor, for example, to build application to run on the Intel® Atom™ processor, add the following line:

    APP_CFLAGS:=-xATOM_SSSE3

  4. To enable advanced optimizations of Intel® C++ Compiler, for example, to increase the optimization level, add the following line:

    APP_CFLAGS:=-xATOM_SSSE3 –O3
    

  5. To enable interprocedural optimizations, add:

    APP_CFLAGS:=-xATOM_SSSE3 –O3 –ipo
    

  6. Build the application.

Note

The APP_OPTIM and APP_CFLAGS can be given as arguments in building from the command line. Here is an example:

>>ndk-build V=1 -B APP_ABI=x86 NDK_TOOLCHAIN:=x86-icc APP_OPTIM=release
APP_CFLAGS=”-xATOM_SSSE3 –O3 -ipo”


Viewing all articles
Browse latest Browse all 1616

Trending Articles



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