droidcon 2014: How to bring compute intensive C++ based apps to Android
Channel: droidcon
Date: 2014-07-31

How to bring compute intensive C++ based apps to Android - Martin Siggel (German Aerospace Center)

Find out more at: http://de.droidcon.com/2014/session/how-bring-compute-intensive-c-based-apps-android

The TiGLViewer desktop application is used at the German Aerospace Center for aircraft design. It is mainly used to display 3D aircraft geometries, which are computed from a parametric description. The core components of the application are the CAD kernel OpenCASCADE for 3D geometry computation and the OpenGL based rendering engine OpenSceneGraph – both written in C++. Due to its relatively large tested code base and the use of the third party libraries, a reimplementation in Java was not reasonable. In this talk, we present the required steps in porting the program to Android by reusing the native C and C++ Code. These steps include cross-compiling the CMake based libraries for Android (arm, x86) using a standalone tool chain from the Native Development Kit (NDK), setting up the NDK build system for the native parts of the TiGLViewer app, integrating the NDK build into the Gradle build system, using the Java Native Interface (JNI) to communicate with the native code, and creating an EGL surface for OpenSceneGraph’s renderer. Further, we want to present the differences in the Android lifecycle for native code compared to Java code. Finally, we show how even CPU and GPU hungry apps can be tested efficiently with the x86 based Android emulator using Intel’s HAXM acceleration. All these steps will be executed live during presentation on a small tutorial app.