How to build VES and KiwiViewer for Android on Linux and Mac

** The instructions have been updated. Please have a look at this blog post: http://www.kitware.com/blog/home/post/642

 

VES (http://ves.vtk.org) is the VTK for Embedded Systems. It is a C++ rendering library for mobile devices using OpenGL ES 2.0. VES integrates with the Visualization Toolkit (VTK) to deliver:

  • scientific and medical visualization capabilities
  • remote rendering and/or data hosting
  • modern/novel/new/collaborative interaction techniques

Recently, we made improvements to building VES (specifically KiwiViewer) for Android on Linux and Mac. The build procedure requires Android NDK  and Android SDK to be installed on the system.  The steps to build VES and KiwiViewer for Android on Linux and Mac are as follows: 

1. Make sure to checkout this code from VES stage

> git clone git://vtk.org/stage/VES.git

 > git checkout improve_ves_android

2. Download Android NDK. The Android NDK r8b is currently the required version. It can be downloaded from:

http://dl.google.com/android/ndk/android-ndk-r8b-linux-x86.tar.bz2

http://dl.google.com/android/ndk/android-ndk-r8b-darwin-x86.tar.bz2

3. Download and install Android SDK. For that please refer to the documentation on this URL: 

http://developer.android.com/sdk/installing/index.html

 4. Download Android SDK and ADT plugin for Eclipse. More information on this can be found here:

http://developer.android.com/sdk/installing/installing-adt.html

 5. Open Android SDK Manager and install 

  • Tools > Android SDK Tools
  • Tools > Android SDK Platform-tools 
  • Tools > Android SDK Build-tools 
  • Android 4.3 (API 18) > SDK Platform
  • ARM EABI v7a System Image

6. Build VES

  • export ANDROID_NDK="path/to/ndk/root"
  • mkdir build 
  • cd build
  • cmake -DVES_ANDROID_SUPERBUILD:BOOL=TRUE "$ves_src/Apps/Android/CMakeBuild"
  • build (make -j8 for instance)

7. Build KiwiViewer

  • cmake \  

             -G "Eclipse CDT4 – Unix Makefiles" \

             -DCMAKE_TOOLCHAIN_FILE="$ves_src/CMake/toolchains/android.toolchain.cmake" \

             -DANDROID_NATIVE_API_LEVEL=8 \

             -DANDROID_TARGET=android-18 \

             -DANDROID_EXECUTABLE="path/to/android" \

             -DVTK_DIR="path/to/cross/build/CMakeExternals/Build/vtk-android" \

              -DVES_DIR="path/to/cross/build/CMakeExternals/Build/ves-android" \

              "$ves_src/Apps/Android/Kiwi"

  • build (make -j8 for instance)

8. Create new project in Eclipse 

9.  Import it in Eclipse

10. Hit Finish. The project should look as show below:

11. Run it as any Android application. 

That's it!. We are hoping to make it work on Windows OS as well. Also, if you have different version of Android NDK or SDK then the above procedure may not work. 

We are in the process of making this work available in VES master. Also, we will have fixes for Windows too in near future. 

Happy building! 

——–

VES is an open source project. You can post your questions to ves@public.kitware.com. For commercial and technical support, please contact us at kitware@kitware.com.  

 

 

One Response to How to build VES and KiwiViewer for Android on Linux and Mac

  1. Bill Hoffman says:

Questions or comments are always welcome!