Android 什么是 armeabi 以及他们为什么使用它?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/23042175/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-20 06:42:35  来源:igfitidea点击:

What is armeabi and why they use it?

androidshared-libraries

提问by Esmaeel ibrahim

I see this library (armeabi) many times when I explore open sources.

当我探索开源时,我多次看到这个库 (armeabi)。

I net searched for an explanation of it, but all the results I found are talking ABOUT it and not defining it.

我在网上搜索了它的解释,但我发现的所有结果都在谈论它而不是定义它。

What is this armeabi and why are they using it in Android applications?

这是什么 armeabi,他们为什么在 Android 应用程序中使用它?

回答by CommonsWare

Android devices have CPUs. Many of those CPUs are based on the ARM architecture, while some are based on x86, and a few others are based on other stuff like MIPS.

Android 设备有 CPU。这些 CPU 中有许多基于 ARM 架构,而一些基于 x86,还有一些基于 MIPS 等其他东西。

Some Android apps use the Native Development Kit (NDK) to create C/C++ code to link into their app. C/C++ code needs to be compiled for a specific CPU architecture. The NDK places the version of the C/C++ code compiled for each architecture into an architecture-specific directory. One of those directories is armeabi/, which is for a generic ARM CPU. There is also armeabi-v7/(for an ARM v7-compatible CPU), x86/(for x86 CPUs), etc.

某些 Android 应用程序使用本机开发工具包 (NDK) 来创建 C/C++ 代码以链接到其应用程序。需要为特定的 CPU 架构编译 C/C++ 代码。NDK 将针对每个架构编译的 C/C++ 代码版本放入特定于架构的目录中。其中一个目录是armeabi/,用于通用 ARM CPU。还有armeabi-v7/(对于 ARM v7 兼容的 CPU)、x86/(对于 x86 CPU)等。

回答by kosiara - Bartosz Kosarzycki

ABI- Application Binary Interface

ABI- 应用程序二进制接口

EABI- Embedded Application Binary Interface

EABI- 嵌入式应用程序二进制接口

So ARMEABI are compiled binariesmatching your android device's CPU architecture.

因此,ARMEABI 是与您的 android 设备的 CPU 架构匹配的编译二进制文件

e.g.

例如

arm64-v8a(Nexus 5x) - 64bit - ARM Cortex-A35, ARM Cortex-A53, ARM Cortex-A57, ARM Cortex-A72, ARM Cortex-A73

arm64-v8a(Nexus 5x) - 64 位 - ARM Cortex-A35、ARM Cortex-A53、ARM Cortex-A57、ARM Cortex-A72、ARM Cortex-A73

armeabi-v7a- 32bit - ARM Cortex-A5, ARM Cortex-A7, ARM Cortex-A8, ARM Cortex-A9, ARM Cortex-A12, ARM Cortex-A15, ARM Cortex-A17

armeabi-v7a- 32 位 - ARM Cortex-A5、ARM Cortex-A7、ARM Cortex-A8、ARM Cortex-A9、ARM Cortex-A12、ARM Cortex-A15、ARM Cortex-A17

enter image description here

在此处输入图片说明

To include *.sobinary jniLibsusing Android Studio 2.3 place them in src/main/jniLibsfolder and add the following configuration to your *.gradle file:

要使用 Android Studio 2.3包含*.so二进制jniLibs,请将它们放在src/main/jniLibs文件夹中,并将以下配置添加到 *.gradle 文件中:

android {
    sourceSets {
        main {
            jniLibs.srcDirs = ['src/main/jniLibs']
        }
    }
}

dependencies {
    compile fileTree(dir: 'jniLibs', include: ['*.so'])
}

回答by cking24343

I did recently see a pretty good articlerelated to the different CPU's and suggestions on how to maintain APK size while giving support for them. The article gives some info for the following:

我最近确实看到了一篇与不同 CPU 相关的非常好的文章,以及关于如何在为它们提供支持的同时保持 APK 大小的建议。这篇文章提供了以下方面的一些信息:

  • mips
  • mips64
  • X86
  • X86–64
  • arm64-v8a
  • armeabi
  • armeabi-v7a
  • 米普
  • mips64
  • X86
  • X86–64
  • arm64-v8a
  • 阿米阿比
  • armeabi-v7a