android - 我如何知道要选择哪些目标架构?

标签 android xamarin xamarin.android cpu-architecture

我正在构建我的 Xamarin.Android 项目,并且我选择了 AOT 编译,这使得我的 .apk 膨胀到 165mb。

为了减小我的 .apk 大小,我正在查看目标架构,目前我的目标是:

armeabi, armeabi-v7, x86, arm64-v8a

但我不知道这些架构如何与现代设备相对应。

我已阅读Android CPU Architectures它说:

Xamarin.Android defaults to armeabi-v7a for Release builds. This setting provides significantly better performance than armeabi. If you are targeting a 64-bit ARM platform (such as the Nexus 9), select arm64-v8a. If you are deploying your app to an x86 device, select x86. If the target x86 device uses a 64-bit CPU architecture, select x86_64.

因此我需要针对armeabi和armeabi-v7吗?

现代 Android 平板电脑和手机应该采用哪些架构?

最佳答案

armeabi 适用于较旧的设备,因为大多数较新的设备都运行 armeabi-v7。其次,64 位设备可以回退到其他 ABI。如果您担心大小,那么最好的选择是创建多个 apk:

https://developer.xamarin.com/guides/android/application_fundamentals/cpu_architectures/#Targeting_Multiple_Platforms

尽管 Google 建议使用单个 APK,但情况并非总是如此:

Although we encourage you to develop and publish a single APK that supports as many device configurations as possible, doing so is sometimes not possible. To help you publish your application for as many devices as possible, Google Play allows you to publish multiple APKs under the same application listing. Google Play then supplies each APK to the appropriate devices based on configuration support you've declared in the manifest file of each APK.

https://developer.android.com/google/play/publishing/multiple-apks.html

关于android - 我如何知道要选择哪些目标架构?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45465284/

相关文章:

c# - Monodroid - 处理重用 ListView 行的 subview 上的事件

c# - 由于重载方法,使用 Xamarin Android 的绑定(bind)错误

c# - Xamarin.Android:SQLite-Net 扩展多对多 - 没有这样的表,NULL 集合

android - 在android ndk中链接静态库

android - 创建新项目时 Gradle 默认依赖项

android - 缩放 Android 小部件

android - MonoDevelop 默认 M4A 应用程序 "has stopped unexpectedly"

java - 在 Java 中创建一个 Atomic RingBuffer

android - xamarin表单上的“Can' t Write”错误

android - Xamarin.Android 没有 'android:exported' 属性设置错误