推出NDK的目的(摘自官方文档)
The NDK will not benefit most applications. As a developer, you need to balance its benefits against its drawbacks; notably, using native code does not result in an automatic performance increase, but always increases application complexity. In general, you should only use native code if it is essential to your application, not just because you prefer to program in C/C++.
Typical good candidates for the NDK are self-contained, CPU-intensive operations that don't allocate much memory, such as signal processing, physics simulation, and so on. Simply re-coding a method to run in C usually does not result in a large performance increase. When examining whether or not you should develop in native code, think about your requirements and see if the Android framework APIs provide the functionality that you need. The NDK can, however, can be an effective way to reuse a large corpus of existing C/C++ code.
不能支持性能上的提高,并高度依赖于CPU,但能吸引C/C++的开发人员和重用现有的C/C++代码.但使用前还需要慎重考虑!
并且必须维护团队开发的工具链!和承受调试的痛苦~
v NDK不是脱离android的framework的,相离,在应用层方面还是与android的framework紧密集成的!
v C++主要是面对游戏开发者和代码的迁移
v 如果要使用android的控件及平台的功能,还必须通过jni使用
v 代码开发和维护的代价很大
如果在平台中使用ndk作为主要开发语言,对开发进度的影响非常大,并且团队中的人员C++水平参差不齐,很难用C++合作快速开发出高质量的应用程序!
其次,与平台及cpu的连联过于紧密,失去了Dalvik的硬件抽象层保护,adroid上的设备将会越来越多,cpu也会变化,作为通用软件,个人认为不认为ndk适合团队开发!
本文的cygwin-lite及编译的代码及安装文件下载地址:
在Linux公社的1号FTP服务器里,下载地址:
FTP地址:ftp://www.linuxidc.com
用户名:
密码:
在 2011年LinuxIDC.com\9月\Android利用NDK实现C++开发