RenderScript with NDK (deprecated, checkout RenderScriptNDK)
Enable calling RenderScript in NDK. Build with Gradle + CMake in Android Studio. Currently only support running Intrinsic Scripts.
- Update NDk to the latest r14-beta-2 version or higher.
- Edit the
rs_root
according to your machine (TODO: remove this) - Copy the
rs_root/arm
folder into the same directory asrs_root/armeabi-v7a
if you want to target to armeabi-v7a(same as other arch). This is because jniLibs.srcDirs cannot link to folder namedarm
. (TODO: Remove this) - Include header
<cpp/RenderScript.h>
. Then you can add yourScriptIntrinsic
in your jni cpp.
Currently, you still cannot launch your custom .rs
kernels from NDK using this way. If you want to do this, you need to build your rs scripts with ndk-build
. Then link to your Android Studio project as a shared library. There is an example for this case: rs-hello-compute.