<分区>
在 Android 上 NDK您可以阅读的网站:
The Android NDK is a companion tool to the Android SDK that lets you build performance-critical portions of your apps in native code.
...
If you write native code, your applications are still packaged into an .apk file and they still run inside of a virtual machine on the device
...
Using native code does not result in an automatic performance increase, but always increases application complexity.
如果 C 也被编译为 VM 代码,那么如何使用 C 和 NDK 提高性能?您可以绕过 API,或者 C 编译成更优化的代码,或者什么?
或者它只是“开发加速”,所以如果你有一些 C 代码,你不必将它移植到 Java?
编辑:
我不问是否“Java 比 C 慢”。我的考虑是,如果C是用gcc编译的,那么可移植性是如何解决的(不过这是第二个问题,在后台)