This tutorial shows how to set up an Android* OS application using Intel® IPP. This library provides a wide variety of functions so that you can focus on developing your application, not processor-specific details. They are a common interface to implementations tuned for Intel processors, including Intel® Atom™, Core™, and Xeon®, though they can be used on any processor supporting Intel® Streaming SIMD Extensions 2 (Intel® SSE2) or newer instruction sets. The goal of this tutorial is to walk through setting up a very simple example to help you get started with using Intel® IPP in the Beacon Mountain Development Environment for Android*.
A preview of Intel® IPP functionality can be found in Beacon Mountain. This is a package combining key components for developing Android* software. It is suitable for general Android* development but bundles additional tools such as Intel® IPP, Intel® Threading Building Blocks (TBB), and Intel® Graphics Performance Analyzers (GPA) along with prerequisites like Android* NDK for a streamlined start to mobile application development with the performance and power advantages of this toolset. After you have gotten the "hello world" application from this article working it is very simple to switch to the full range of functions in the IPP library.
The steps to get started are outlined below:
Click on the "Eclipse for Android ADT" icon to start the development environment.
IPP is accessed via the Android* Native Development Kit (NDK). That is, IPP is called via C/C++ (much like in Windows*, Linux*, and OSX*), not directly from Java. Native development is well supported in the Eclipse environment, but you must make sure that the NDK is available and Eclipse is set up with its location. The place to do this can be found in the "Window" menu under "Preferences".
If it is not filled in already, add the NDK install location. Below is the Beacon Mountain default.
The next step is to create a new HelloIPP project. Names are case sensitive. To match the code in this example the names should be filled out as below:
The activity is also named HelloIPP, so make sure this is also created with the correct name and cases.
Even though the Eclipse environment itself was set up to enable NDK programming in step 2, native support must be added to the project. You can find the option to do this by right-clicking the HelloIPP project in the Eclipse Package Explorer, then clicking 'Android Tools->Add Native Support'. This will automatically make all of the changes to the project to allow programming Java Native Interface (JNI) functions in C/C++.
Now you can copy the example files and IPP preview to the HelloIPP project jni folder in your Eclipse workspace. Delete the autogenerated contents of this directory first. Files are copied from two places: 1) the example source (below) and 2) the Beacon Mountain IPP directory (default c:/Intel/BeaconMountain/IPP).
Source code for the HelloIPP example is here: helloippexamplecode.zip
The main HelloIPP.java file should also be copied to workspace/HelloIPP/src/intel/example/HelloIPP. This will replace the autogenerated file already in this directory.
Now you can start the application. For best results run on an Android Virtual Device (AVD) emulator using the Intel Atom (x86) CPU/ABI or an Android* device based on Intel hardware. You should see something like the output below.
The output is the major and minor version numbers as returned from the IPP ippGetLibVersion function.
The 32 bit non-threaded static Linux* functions may be used in Android* applications. If you have a license for Intel® IPP for Linux*, copy the static library files (.a extension) and include (.h) files from a Linux installation to your host machine. These can then be added to the JNI folder in your Eclipse* project workspace instead of the preview files, as below.
Note: you do not need to add all library and include files, only what your project will use. If a domain include file is not needed simply comment it out in ipp.h.
After successful compilation with the files from IPP for Linux*, you should see the same output as from building with the preview.
This was a quick introduction to show how to get started with using IPP for Android* applications. This simple beginning has the ingredients you’ll need to access the performance and power advantages of IPP functions in your own code. Now that all of the pieces are there to call one function you can easily expand to the rest of the functions in the IPP preview and the broad range in the IPP library.
Intel's compilers may or may not optimize to the same degree for non-Intel microprocessors for optimizations that are not unique to Intel microprocessors. These optimizations include SSE2, SSE3, and SSSE3 instruction sets and other optimizations. Intel does not guarantee the availability, functionality, or effectiveness of any optimization on microprocessors not manufactured by Intel. Microprocessor-dependent optimizations in this product are intended for use with Intel microprocessors. Certain optimizations not specific to Intel microarchitecture are reserved for Intel microprocessors. Please refer to the applicable product User and Reference Guides for more information regarding the specific instruction sets covered by this notice.
Notice revision #20110804