为什么使用 armeabi-v7a 代码而不是 armeabi 代码? [英] Why use armeabi-v7a code over armeabi code?

查看:32
本文介绍了为什么使用 armeabi-v7a 代码而不是 armeabi 代码?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我当前的项目中,我使用了多个 .so 文件.它们位于 armeabi 和 armeabi-v7a 文件夹中.不幸的是,其中一个 .so 文件是 6MB,我需要减小文件大小.我不想使用胖 APK 文件,而是只使用 armeabi 文件并删除 armeabi-v7a 文件夹.

In my current project I make use of multiple .so files. These are located at the armeabi and armeabi-v7a folder. Unfortunately one of the .so files is a 6MB and I need to reduce file size. Instead of having a fat APK file, I would like to use just the armeabi files and remove the armeabi-v7a folder.

根据 NDK 文档,armeabi-v7a 代码是扩展的 armeabi 代码,可以包含额外的 CPU 指令.这一切都超出了我的专业知识,但我质疑为什么要同时拥有 armeabi-v7a 和 armeabi 代码.两者都必须有充分的理由,对吗?

According to the NDK documentation, armeabi-v7a code is extended armeabi code which can contain extra CPU instructions. This all goes beyond my expertise, but I question why one would like to have both armeabi-v7a and armeabi code. There must be a good reason to have both, right?

在我的测试设备上,这一切似乎都运行良好.这些具有 ARM v7 CPU.假设现在一切正常是否安全?

On my test devices this all seem to work fine. These have ARM v7 CPU's. Is it safe to assume that everything works now?

推荐答案

取决于你的原生代码做什么,但 v7a 支持硬件浮点运算,这有很大的不同.armeabi 可以在所有设备上正常工作,但速度会慢很多,并且不会利用较新设备的 CPU 功能.请为您的特定应用程序进行一些基准测试,但删除 armeabi-v7a 二进制文件通常不是一个好主意.如果您需要减小尺寸,您可能需要为旧的 (armeabi) 和新的 (armeabi-v7a) 设备使用两个单独的 apk.

Depends on what your native code does, but v7a has support for hardware floating point operations, which makes a huge difference. armeabi will work fine on all devices, but will be a lot slower, and won't take advantage of newer devices' CPU capabilities. Do take some benchmarks for your particular application, but removing the armeabi-v7a binaries is generally not a good idea. If you need to reduce size, you might want to have two separate apks for older (armeabi) and newer (armeabi-v7a) devices.

这篇关于为什么使用 armeabi-v7a 代码而不是 armeabi 代码?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆