Introduction
Setting up the Android* development environment on a host machine could be a tedious and frustrating task. Intel® Integrated Native Developer Experience (Intel® INDE) simplifies the above task to a click of a few buttons. One of the strengths of INDE is its ability to integrate and work smoothly with third party software. Updates for the third party software such as Android* NDK, that get installed with INDE, are available in regular INDE updates. However, if you want to update them prior to the INDE update cycles you can do it manually. This article guides you in doing such manual updates to the Android* NDK on Windows* and Apple* OSX* systems, in two simple steps. First the Android* NDK is updated. The second step is only for those who have already installed the Intel® C++ Compiler (ICC) for Android* targets with their INDE installation. In that step the new Android* NDK will be integrated with the ICC for Android* targets.
Updating Android* NDK
Visit the official Android* NDK page (https://developer.android.com/tools/sdk/ndk/index.html) and select and download the appropriate NDK update for your host system. Follow the instruction in https://developer.android.com/tools/sdk/ndk/index.html#Installing to extract the NDK download. As a result a new folder named ‘android-ndk-<version>’ will be generated in both Windows* and Apple* OSX* systems. This article refers to this newly created folder by <new-ndk> folder
You may choose to either update the existing NDK by overriding it or install the new NDK to coexist with the existing one. If you go with the former option, all you have to do is delete everything in the existing NDK folder and copy the entire contents of the <new-ndk> folder in to the existing ndk folder. In a default INDE installation the NDK is located at C:\Intel\INDE\IDEintegration\NDK(let’s call this<old-ndk-path>).
To have the new NDK to co-exist with the old version, you may copy the<new-ndk> folder to a path of your choice (let’s denote this path by<new-ndk-path>) and update the 'ANDROID_NDK_ROOT' environment variable accordingly. Your IDE Android* NDK pointer also has to be updated with the <new-ndk-path>. By changing these pointers you can switch between co-existing NDKs.
In Eclipse*
This pointer change is done by updating the ‘NDK location’ found at Window->Preferences->Android->NDK.
In Android Studio*
Add the following line to your projects local.properties
ndk.dir=<new-ndk-path>
If you are not using the ICC for Android* targets with your Android* NDK, then your NDK update is complete. Otherwise you may proceed to the second step to integrate the ICC for Android* targets (which you should have installed as a part of the INDE installation) with the updated Android* NDK.
Integrating the new NDK with ICC
If you go to the <new-ndk-path>\toolchains(or <old-ndk-path>\toolchainsif you replaced old NDK contents with the new one), you will notice that there are no ICC folders (as opposed to ICC folders such as ‘x86-icc’ and ‘x86-icc 15.*’ which were found in <old-ndk-path>\toolchains prior to the NDK update). This is because the NDK update currently doesn’t include ICC toolchains. Hence the ICC toolchains has to be generated by following these simple steps.
In Windows*
Open a command prompt, then type and enter the following in the command line
cd C:\Intel\INDE\icc_android\toolchains ndk_integration.cmd /f <new-ndk-path>
In Apple* OSX*
Open a terminal and type following commands in it
cd /Applications/Intel/INDE/cc-android/toolchains ./ndk_integration.sh –f <new-ndk-path>
Notes:
- A default INDE installation with a default folder structure was assumed.
- If you replaced the old NDK content by the new one at <old-ndk-path> you have to substitute <new-ndk-path> by <old-ndk-path>
After the correct execution of the above, you will see “Info: Integration is completed.” as the command line output. Go back to the <new-ndk-path>\toolchains (or <old-ndk-path>\toolchainsif that is the case) and you will notice that new folders such as ‘x86-icc’ and ‘x86-icc 15.*’ were created.
Now you are all set to use the updated Android* NDK with Intel® ICC for Android* targets in your Intel® INDE environment.
Legal
Intel and the Intel logo are trademarks of Intel Corporation in the U.S. and/or other countries.
* Other names and brands may be claimed as the property of others.
For more complete information about compiler optimizations, see our Optimization Notice