-----------------
英文文档见android-ndk-r6b的documentation.html
属于Android Native Development Kit (NDK)的一部分
见
http://developer.android.com/sdk/ndk/
翻译仅个人见解
-----------------
Android NDK x86 (a.k.a. IA-32) instruction set support
Android NDK x86(即IA-32)指令集支持
------------------------------------------------------
Introduction:
介绍:
-------------
Android NDK r6 added support for the 'x86' ABI, that allows native code to run on Android-based devices running on CPUs supporting the IA-32 instruction set.
Android NDK r6 添加对x86 ABI的支持,允许原生代码运行在使用支持IA-32指令集CPU的基于Android的设备。
The Android x86 ABI itself is fully specified in docs/CPU-ARCH-ABIS.html.
Android x86 ABI自身完全在docs/CPU-ARCH-ABIS.html中指定。
Overview:
概述:
---------
Generating x86 machine code is simple: just add 'x86' to your APP_ABI definition in your Application.mk file, for example:
生成x86机器代码的方法很简单:只要添加x86到你的Application.mk文件中的APP_ABI定义,例如:
APP_ABI := armeabi armeabi-v7a x86
will generate machine code for all supported ABIs with this NDK. Doing so will ensure that your application package contains libraries for all target ABIs. Note that this has an impact on package size, since each ABI will correspond to its own set of native libraries built from the same sources.
它将生成含有对这个版本NDK所支持的全部ABI的机器代码。这么做确保你的应用程序包包含供所有目标ABI使用的库。注意这会对包的大小造成影响,因为每个ABI将对应它自己特定的从同一份源码中构建出来的原生库集合。
The default ABI is still 'armeabi', if unspecified in your project.
默认的ABI仍然是armeabi,如果在你的工程中没有指定。
As you would expect, generated libraries will go into $PROJECT/libs/x86/, and will be embedded into your .apk under /lib/x86/.
正如你所期待的,生成的库将输出到$PROJECT/libs/x86/,它们将被嵌入进你的.apk文件的/lib/x86/目录下。
And just like other ABIs, the Android package manager will extract these libraries on a *compatible* x86-based device automatically at install time, to put them under <dataPath>/lib, where <dataPath> is the application's private data directory.
而且正如其它ABI那样,Android包管理器将在安装期自动地在一个可兼容基于x86的设备上抽取这些库,并把它们放到<dataPath>/lib目录下,这里<dataPath>是应用程序的私有数据。
Similarly, the Android Market server is capable of filtering applications based on the native libraries they embed and your device's target CPU.
类似地,Android市场的服务器能过滤基于他们所嵌入原生库的应用程序,以及你的设备的目标CPU。
Debugging with ndk-gdb should work exactly as described under docs/NDK-GDB.html.
用ndk-gdb调试应该可以,正如docs/NDK-GDB.html所描述的那样。
Standalone-toolchain:
独立运行工具链:
---------------------
It is possible to use the x86 toolchain with NDK r6 in stand-alone mode. See docs/STANDALONE-TOOLCHAIN.html for more details. Briefly speaking, it is now possible to run:
可以在独立运行模式下使用NDK r6所带的x86工具链。参考docs/STANDALONE-TOOLCHAIN.html的内容以获取详细信息。简单来说,现在可以运行:
$NDK/build/tools/make-standalone-toolchain.sh --arch=x86 --install-dir=
The toolchain binaries have the i686-android-linux- prefix.
工具链的二进制文件带有i686-android-linux-前缀。
Compatibility:
兼容性:
--------------
The minimal native API level provided by official Android x86 platform builds is 9, which corresponds to all the native APIs provided by Android 2.3, i.e. Gingerbread (note also that no new native APIs were introduced by Honeycomb).
官方Android平台构建所提供的最小原生API级别为9,它对应Android 2.3,即姜饼,提供的所有原生API(注意蜂房还没有新的原生API)
You won't have to change anything to your project files if you target an older API level: the NDK build script will automatically select the right set of native platform headers/libraries for you.
如果你的目标是较旧的API级别,你不必改动你的工程文件:NDK构建脚本将自动为你选择正确的原生平台的头文件或库文件。
Note that, as of today (June 2011), *no* compatible x86 devices exist on the market.
注意,时至今日(2011年6月),市场上还没有可兼容的x86设备(注:这里应该指移动设备)。
In particular, while there are various projects which have forked the official Android open-source tree and added their own x86-specific customizations, there is absolutely no guarantee that anything generated with the official Android NDK is going to run on them at the moment.
特别地,当有某些项目从官方的Android开源代码树中分支出去并且添加它们自己特定于x86的定制项,将肯定不能保证现在用官方Android NDK生成的所有东西将能继续运行在它们(注:指分支出去的项目)上面。