APP_ABI := armeabi armeabi-v7a


in armeabi/:,,,
in armeabi-v7a/:,,,,

需要注意这一点:The 'armeabi-v7a' machine code will not run on ARMv5 or ARMv6 based devices. 如果损失一些应用的性能是可以接受的,不希望保留库的两份拷贝,可以移除armeabi-v7a目录和其下的库文件,只保留armeabi目录。在安装应用时,行为是这样的,

When installing an application, the package manager service will scan the .apk and look for any shared library of the form:


If one is found, then it is copied under $APPDIR/lib/, where $APPDIR corresponds to the application's specific data directory.
If none is found, and a secondary ABI is defined, the service will then scan for shared libraries of the form:


If anything is found, then it is copied under $APPDIR/lib/

什么是primary abi和secondary abi呢,

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.
This mechanism ensures that the best machine code for the target device is automatically extracted from the package at installation time.


in armeabi/:,,,
in armeabi-v7a/:,

如此,安装运行在v7a的设备上,会发生什么? 尝试了一些手机和平板,CPU都是ARMv7的,Android都是4.x的。行为是拷贝以下库文件到$APPDIR/lib/目录下,

armeabi-v7a/, armeabi-v7a/, armeabi/, armeabi/, armeabi/

难道Android2.3的设备,package manager service的行为有异?