【发布时间】:2016-07-13 21:33:59
【问题描述】:
有人能解释一下 Java JNI 和 Android NDK 的不同之处、它们的相同之处以及它们如何结合在一起吗?我还没有找到任何可以很好地解释两者之间差异的东西,我有点困惑。
谢谢!
【问题讨论】:
-
developer.android.com/ndk/guides 比这里的 2 个答案更有帮助。概括地说,NDK 就是您想要使用的,而后者又使用 JNI。
Using Android Studio 2.2 and higher, you can use the NDK to compile C and C++ code into a native library and package it into your APK using Gradle, the IDE's integrated build system. Your Java code can then call functions in your native library through the Java Native Interface (JNI) framework.
标签: java android android-ndk java-native-interface native