Android架构使用? [英] Android architecture usage?

查看:18
本文介绍了Android架构使用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一些本机库,它们相当大并且使应用程序二进制文件变得臃肿.我研究了 APK 拆分,但维护和 QAing 多个 APK 是不是我想做的事.

I have a few native libraries that are fairly big and bloating the application binary size. I looked into APK splitting but maintaining and QAing multiple APKs is not something I want to do.

所以我想使用 ndk.abiFilters Gradle 属性在我的发布版本中排除未使用的架构.(我想单独保留调试版本,以便我可以在 x86 上运行 HAXM 加速的模拟器).

So I'd like to exclude unused architectures in my release build flavour using the ndk.abiFilters Gradle property. (The debug builds I want to leave alone so that I can run the HAXM-accelerated emulator on x86).

我想在我的发布版本中只使用 armeabi-v7a 和 arm64-v8a,但我不确定是否值得担心我正在放弃的其他架构的市场份额.环顾四周后,我找不到任何关于 ARMv6 (armeabi)、MIPS、x86 或 x86_64 的市场份额的参考.我的直觉告诉我,后三个几乎不存在,但我不确定 ARMv6.

I was thinking of just having armeabi-v7a and arm64-v8a in my release flavour, but I'm not sure whether it is worth worrying about the market share of the other architectures I'm dropping. After a lot of looking around I cannot find any reference to market share of ARMv6 (armeabi), MIPS, x86 or x86_64. My intuition tells me that the latter three are almost non-existent, but I'm not sure about ARMv6.

我在论坛上找到了此链接,其中列出了使用各种架构的手机.有没有更可靠的地方?也许有 % 的用户与 Android 版仪表板类似?

I found this link on a forum that has a list of phones that use various architectures. Is there something more reliable somewhere? Maybe with % of users similar to the Android version dashboard?

如果我只是为 armeabi-v7a 和 arm64-v8a(或 armeabi、armeabi-v7a 和 arm64-v8a)构建原生库,还有什么我可能会错过的吗?

Anything else I may miss if I just build my native libs for armeabi-v7a and arm64-v8a (or armeabi, armeabi-v7a and arm64-v8a)?

推荐答案

首先,如果你担心二进制文件的大小,你真的不需要 arm64-v8a,所有这些设备都可以运行 armeabi-v7a 二进制文件美好的.只有当你真的需要把最后的额外性能塞进去时,才可能是值得的.

First off, if you're worring about binary size, you don't really need arm64-v8a, all those devices can run the armeabi-v7a binaries just fine. Only if you really need to cram the last extra performance out of it, it might be worthwhile.

至于 armeabi 和 ARMv6;Android 本身不再正式支持它,因为 Android 4.4(2013 年 10 月) - 并且自 Android 4.0 以来它应该不那么常见(从那个版本开始,AOSP 源需要修改才能仍然为 ARMv6 构建).因此,在实践中,如果您不支持低于 4.4 的版本,则可以放弃该版本而不会造成任何重大损失.

As for armeabi and ARMv6; Android itself doesn't officially support it any longer, since Android 4.4 (October 2013) - and since Android 4.0 it should be much less common (from that version, AOSP source requires modifications to still build for ARMv6). So in practice, if you aren't supporting versions below 4.4, you can drop that one without any significant loss.

另外,对于 x86;其中许多设备都附带了对 arm 二进制文件的惊人模拟,因此这些设备也可以使用 armeabi-v7a 版本进行管理.

Also, for x86; many of those devices ship with surprisingly decent emulation of arm binaries, so those can manage with the armeabi-v7a version just fine as well.

以上写于 2015 年;如今,Play 商店要求应用程序包含对 arm64-v8a 的支持.但现在下一个问题更多是关于您是否需要包含 armeabi-v7a,或者 32 位设备的市场份额是否小到可以放弃支持.

The above was written in 2015; these days Play Store requires that apps include support for arm64-v8a. But these days the next question is more about whether you need to include armeabi-v7a at all, or if the market share of 32 bit devices is small enough to drop support for.

这篇关于Android架构使用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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