机器人NDK优点和缺点 [英] Android ndk advantages and disadvantages

查看:156
本文介绍了机器人NDK优点和缺点的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我学习的Andr​​oid NDK。有哪些优点和NDK的缺点是什么?
是否有良好的参考学习的Andr​​oid NDK?

I am studying android ndk. What are the advantages and disadvantages of ndk? Are there any good references to study Android NDK?

推荐答案

你有阅读关于官方Android开发者页面NDK

报价:

而Android NDK是一个配套工具
  Android的SDK,让你打造
  的性能关键部分的
  应用在本地code。它提供
  头文件和库,让你
  建活动,处理用户
  输入,使用硬件传感器,访问
  应用程序资源,以及更多,当
  编程C或C ++。如果你写
  本土code,您的应用程序
  还是打包成一个.apk文件和
  他们仍然是一个虚拟的内部运行
  机设备上。基本
  Android应用程序模型不
  改变。

The Android NDK is a companion tool to the Android SDK that lets you build performance-critical portions of your apps in native code. It provides headers and libraries that allow you to build activities, handle user input, use hardware sensors, access application resources, and more, when programming in C or C++. 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. The fundamental Android application model does not change.

使用本机code不会导致
  一个自动演奏增加,但
  总是提高应用
  复杂。如果你还没有碰上
  采用的是Android任何限制
  框架API,你可能不
  需要NDK。

Using native code does not result in an automatic performance increase, but always increases application complexity. If you have not run into any limitations using the Android framework APIs, you probably do not need the NDK.

所以,除非你正在做一些非常性能密集型的东西,在Java编程时会呛你的应用程序,我建议你保持清晰的NDK的。它的混乱,更难以正确地写NDK code,除非你真的知道自己在做什么,有C和/或C ++的强大的知识。

So, unless you're doing some very performance intensive stuff that will choke your application when programming in Java, I'd suggest you stay clear of NDK. It's messier and more difficult to write NDK code properly unless you really know what you're doing and have strong knowledge of C and/or C++.

这篇关于机器人NDK优点和缺点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆