Android是否会自动加载;“最佳”。那么设备的文件呢?

Android是否会自动加载;“最佳”。那么设备的文件呢?,android,architecture,dynamic,load,Android,Architecture,Dynamic,Load,我正在编写一个需要一些JNI代码的应用程序。 这段代码涉及浮点处理,所以我希望它尽可能快。因此,我希望支持ARM5和ARM7体系结构。在我的Application.mk中,它说: APP_ABI := all 。。。构建过程为ARM5、ARM7和x86编译模块。我验证了所有的.so文件都以.apk文件结尾 现在的问题是:Android会自动加载“best”文件吗?因此,该文件取决于它运行的平台?换句话说:它是否将ARM5模块加载到ARM5设备上,将ARM7加载到ARM7设备上?是 在ARMv5

我正在编写一个需要一些JNI代码的应用程序。 这段代码涉及浮点处理,所以我希望它尽可能快。因此,我希望支持ARM5和ARM7体系结构。在我的Application.mk中,它说:

APP_ABI := all
。。。构建过程为ARM5、ARM7和x86编译模块。我验证了所有的.so文件都以.apk文件结尾

现在的问题是:Android会自动加载“best”文件吗?因此,该文件取决于它运行的平台?换句话说:它是否将ARM5模块加载到ARM5设备上,将ARM7加载到ARM7设备上?

在ARMv5或ARMv6设备(CPU)上,将使用ARMv5二进制文件(APP_ABI=armeabi) 在ARMv7设备上,系统将看到ARMv7二进制文件可用并将使用它(APP_ABI=armeabi-v7a)

在NDK文档中,我们可以阅读:

III.2. Android Platform ABI support:
------------------------------------

The Android system knows at runtime which ABI(s) it supports. More
precisely, up to two build-specific system properties are used to
indicate:

- the 'primary' ABI for the device, corresponding to the machine
  code used in the system image itself.

- an optional 'secondary' ABI, corresponding to another ABI that
  is also supported by the system image.

For example, a typical ARMv5TE-based device would only define
the primary ABI as 'armeabi' and not define a secondary one.

On the other hand, a typical ARMv7-based device would define the
primary ABI to 'armeabi-v7a' and the secondary one to 'armeabi'
since it can run application native binaries generated for both
of them.

A typical x86-based device only defines a primary abi named 'x86'.