- 精华
- 0
- 帖子
- 2404
- 威望
- 0 点
- 积分
- 2398 点
- 种子
- 20 点
- 注册时间
- 2012-11-30
- 最后登录
- 2024-7-5
|
发表于 2014-6-28 14:07 · 日本
|
显示全部楼层
yinqing1989 发表于 2014-6-28 13:07
早就可以用c++开发,各种大型游戏需要不同的数据包就是用接近底层的代码写的,到现在还拿java说事 ... The NDK is a toolset that allows you to implement parts of your app using native-code languages such as C and C++. For certain types of apps, this can be helpful so you can reuse existing code libraries written in these languages, but most apps do not need the Android NDK.
Before downloading the NDK, you should understand that the NDK will not benefit most apps. As a developer, you need to balance its benefits against its drawbacks. Notably, using native code on Android generally does not result in a noticable performance improvement, but it always increases your app complexity. In general, you should only use the NDK if it is essential to your app—never because you simply prefer to program in C/C++.
Typical good candidates for the NDK are CPU-intensive workloads such as game engines, signal processing, physics simulation, and so on. 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.
能用是不假,但毕竟不是直接的底层接入,google明确的表示不建议这么做,但是在游戏引擎之类的项目中,有可能有些功能Android API没有提供,这个时候才需要Native伺候,虽说不太清楚NDK的具体实现方法,但没有记错的话Native也是要在Android的虚拟机上运行的。
Java在一般的软件应用上确实速度已经足够了,但游戏毕竟是个吃资源的大户,同配置损失50%甚至以上的性能对游戏来说还是不能忍吧。 |
|