By Jeffrey Mcallis
This tutorial describes how to use Intel IPP to set Android * OS applications. This library provides a variety of features that allow you to focus on application development rather than specific processor details. They are common interfaces for Intel processors (including Intel Atom, core, and Xeon), but they can expand 2 (Intel SSE2) in any way that supports Intel SIMD stream commands) or the updated instruction set is used on the processor. This tutorial demonstrates how to set up a simple example to help you learn how to use Intel IPP in the Beacon Mountain development environment for Android.
You can preview the Intel IPP feature in Beacon Mountain. This package contains the main components used to develop Android * software. It is very suitable for general Android * development, but it is bound with other tools, such as Intel IPP, Intel thread build module (TBB) and Intel Graphics Performance Analyzer (GPA ), in addition, you must have certain prerequisites, such as the Android * Network Development Kit (NDK), to simplify the development of mobile applications by leveraging its performance and power consumption advantages. After you run the "hello world" application in this article, switching to the IPP library will be very simple.
The procedure is as follows:
1. Start Eclipse
Click the "Eclipse for Android ADT" icon to start the development environment.
2. Enable Android * NDK
IPP can be accessed through Android * Native Development Kit (NDK. That is to say, IPP needs to be called through C/C ++ (similar to Windows *, Linux *, and OSX *) instead of using Java directly. The Eclipse Environment supports native development, but you must ensure that the NDK is available and Eclipse has installed its location. This operation is performed on the "Window" menu under "Preferences.
If you have not entered the NDK installation location, add it. The following are the default Beacon Mountain settings.
3. Create a HelloIPP Project
The next step is to create a new HelloIPP project. The name must be case sensitive. To match the code in this example, enter the name as follows:
This activity is also called HelloIPP. Therefore, make sure that it is created with the correct name and font.
4. Add native support to the HelloIPP Project
Although the settings in the Eclipse environment can enable NDK programming (see step 2), you must add native support in the project. Right-click the HelloIPP project in Eclipse Package Explorer. You can view the options for performing this operation, and click "Android Tools-> Add Native Support ". This will automatically execute all changes to the Project to Support compiling the Java Native Interface (JNI) function in C/C ++.
5. copy the file to the Eclipse * Workspace
Now, you can copy the sample file and IPP preview to the HelloIPP project jni folder in the Eclipse workspace. First, delete the automatically generated contents of the directory. You can copy files from two locations: 1) sample source (as shown below) and 2) Beacon Mountain IPP directory (default c:/Intel/BeaconMountain/IPP ).
The source code of the HelloIPP example is as follows: helloippexamplecode.zip
The main HelloIPP. java file should also be copied to workspace/HelloIPP/src/intel/example/HelloIPP. This will replace the automatically generated files in this directory.
6. Run the application
Now you can start the application. For optimal performance, run on an Android Virtual Device (AVD) simulator that uses the Intel Atom (x86) CPU/ABI or an Intel hardware-based Android * device. At this time, you should see content similar to the following output.
The output is the primary and secondary version numbers returned by the IPP ippGetLibVersion function.
How to switch from Beacon Mountain Intel IPP preview to various features in the IPP Library
Android * applications may use 32-bit non-threaded static Linux. If you have an Intel IPP for Linux * license, copy the static library file (with the extension. a) and the file with the extension. h in Linux installation to your host. Then, these files will be added to the JNI folder of the Eclipse * Project workspace instead of the preview file, as shown below.
Note: you do not need to add all databases, but only need to add files to be used by your project. If you do not need a file in a domain, you only need to comment it out in ipp. h.
After the files in IPP for Linux * are compiled successfully, you will see the same output as when you used the preview build.
Summary
This article briefly introduces how to use IPP for Android * applications. It includes all the elements that allow you to access the performance and power consumption advantages of the IPP function with your own code. Now, all the elements for calling a feature are ready for you to easily extend to other features in IPP preview and other extensive features in the IPP library.