assimp/port/AndroidJNI
Daniel-Genkin 6e5600a9a5 Added another constructor to avoid requiring a full ANativeActivity 2021-10-28 10:26:14 -04:00
..
AndroidJNIIOSystem.cpp Added another constructor to avoid requiring a full ANativeActivity 2021-10-28 10:26:14 -04:00
BundledAssetIOSystem.cpp Update BundledAssetIOSystem.cpp 2021-02-15 13:44:07 +01:00
CMakeLists.txt removed trailing spaces and tabs from source and text 2021-07-29 13:28:51 +02:00
README.md Update README.md 2020-12-01 08:58:45 +01:00

README.md

Build Asset Importer Lib for Android

This module provides a facade for the io-stream-access to files behind the android-asset-management within an Android-native application.

  • It is built as a static library
  • It requires Android NDK with android API > 9 support.

Building

To use this module please provide following cmake defines:

-DASSIMP_ANDROID_JNIIOSYSTEM=ON
-DCMAKE_TOOLCHAIN_FILE=$SOME_PATH/android.toolchain.cmake

"SOME_PATH" is a path to your cmake android toolchain script.

The build script for this port is based on android-cmake.
See its documentation for more Android-specific cmake options (e.g. -DANDROID_ABI for the target ABI). Check Asset-Importer-Docs for more information.

Code

A small example how to wrap assimp for Android:

#include <assimp/port/AndroidJNI/AndroidJNIIOSystem.h>

Assimp::Importer* importer = new Assimp::Importer();
Assimp::AndroidJNIIOSystem *ioSystem = new Assimp::AndroidJNIIOSystem(app->activity);
if ( nullptr != iosSystem ) {
  importer->SetIOHandler(ioSystem);
}