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 we will update the Android* NDK. The second step is to integrate the new Android* NDK with the Intel® C++ Compiler (ICC) for Android* targets, which comes as a part of the INDE installation.
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 your IDE Android* NDK pointer accordingly. By changing this pointer 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>
Integrating the new NDK with ICC
This step is needed to integrate the ICC for Android* targets with the updated Android* NDK. 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 we are going to generate them 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.