Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the difference between armeabi-v7a, arm64-v8a, x86?

I am working on an Android App on Kivy. I am using Buildozer to compile an APK file. In the Buildozer spec file, there's a setting android.arch = armeabi-v7a, I didn't understand this.

Also, when I generated the APK file using the command buildozer -v android debug and installed it using the command adb install bin/<appname>.apk - it didn't Open on my Android Phone.

like image 421
Chitkaran Singh Avatar asked Jun 30 '19 11:06

Chitkaran Singh


People also ask

What is the difference between Armeabi-v7a and ARM64-v8a?

armeabi-v7a is the older target, for 32 bit arm cpus, almost all arm devices support this target. arm64-v8a is the more recent 64 bit target (similar to the 32-bit -> 64 bit transition in desktop computers).

Is ARM64-v8a compatible with Armeabi-v7a?

Many modern Android devices (i.e. Nexus 5x) have AArch64 processors with arm64-v8a instruction set. Both - armeabi and armeabi-v7a - libraries run fine on these modern devices. Therefore, we can assume the answer to your question to be 'YES'.

How do I know if my phone is x86 or ARM?

For the Android version, look at the OS version under the Device section. This explicitly displays the version number. For architecture info, slide over to the System tab and check out the CPU Architecture and Instruction Sets entries under the Processor tab.

What does Armeabi mean?

armeabi stands for ARM embedded application binary interface, it means the image that the android is running is built with EABI support. armeabi-v7a code is extended armeabi code which can contain extra CPU instructions, and have support for hardware floating point operations.


2 Answers

To be clear, these are not instruction sets. They are ABIs, which compile into instruction sets. Most devices today are arm64-v8a, the really cheap devices are armeabi-v7a to save cost, and almost none are x86 or x86_64.

e.g. The armeabi-v7a ABI compiles to armeabi, thumb-2 and VFPv3-D16 instruction set, but arm64-v8a ABI compiles to AArch64 instruction set.

Supported ABIs table 1 from https://developer.android.com/ndk/guides/abis

Each combination of CPU and instruction set has its own Application Binary Interface (ABI). An ABI includes the following information:

The CPU instruction set (and extensions) that can be used. The endianness of memory stores and loads at runtime. Android is always little-endian. Conventions for passing data between applications and the system, including alignment constraints, and how the system uses the stack and registers when it calls functions. The format of executable binaries, such as programs and shared libraries, and the types of content they support. Android always uses ELF. For more information, see ELF System V Application Binary Interface. How C++ names are mangled. For more information, see Generic/Itanium C++ ABI. source

like image 38
Ben Butterworth Avatar answered Sep 19 '22 15:09

Ben Butterworth


These are CPU instruction sets. Mostly you don't have to worry about it, the default is fine, but I've been meaning to add something to the docs about it due to some recent changes.

Basically, a given Android device might have an arm or an x86 cpu (or even something else but that's not important), these are just different architecture types from different manufacturers. Arm cpus are most common, but x86 is not unusual. When you compile code, the output depends on the architecture target. When you build a Kivy app, you specify one of the architectures and then the app will only work on that type of the device. If you want to support all devices, you can compile multiple APKs to distribute - the Play store will let you upload more than one, and will send each device the right one.

Within a given architecture type there are multiple versions. armeabi-v7a is the older target, for 32 bit arm cpus, almost all arm devices support this target. arm64-v8a is the more recent 64 bit target (similar to the 32-bit -> 64 bit transition in desktop computers). I think most new devices are 64 bit, but not sure. arm64-v8a devices can run code compiled against armeabi-v7a, it's backwards compatible.

As of later this year, the Play store will require you to upload an arm64-v8a APK as the minimum, because this gives the best support for newer devices. You will also be able to upload other APKs to support other device types.

That isn't quite the full story: some x86 devices have a special library that lets them run code compiled for arm devices. I'm not sure how widespread this is, but it seems pretty common.

For your app issue, use adb logcat to see what's wrong.

like image 57
inclement Avatar answered Sep 17 '22 15:09

inclement