ABI特定的android资源限定符 [英] ABI specific android resource qualifier

查看:92
本文介绍了ABI特定的android资源限定符的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我打算在我的应用中使用python代码.因此,我必须将python二进制文件与该应用程序一起提供.我打算将apk存储在 raw 资源目录中.

I am planning to use python code in my app. So I have to ship python binaries along with the app. I was planning to store the apks in the raw resource directory.

但是,如果我将所有abi二进制文件都包含在一个apk中,则apk的大小将会很大,因此我想对apk进行基于abi的拆分.为此,我需要一个特定于ABI的android资源限定符.有没有类似的东西?我找不到任何东西.

However since the apk size would be huge if I include all abi binaries in a single apk, I would like to do an abi based split on my apk. To do that I need an ABI specific android resource qualifier. Is there anything like that? I couldn't find any.

推荐答案

PackagingOptions can be combined with ProductFlavors to achieve any level of flexibility, but this is not necessary to achieve your declared goal.

我邀请您使用我提议agp 的技巧.最重要的是,如果您将可执行文件放在 jniLibs 下的预期目录中,并给它们提供有趣的名称,它们的名称以 lib 开头,以 .so 结束strong>,Android生成工具会很乐意将它们打包到您的APK中,安装程序会很乐意根据ABI准备使用它们.

I invite you to use the trick that I proposed a while agp. The bottom line is that if you put the executables in the expected directories under jniLibs, and give them funny names that start with lib and end with .so, Android build tools will happily pack them into your APK, and the installer will happily prepare them to be used according to the ABI.

这样,您可以使用也由ABI确定的分组.

这篇关于ABI特定的android资源限定符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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