简体   繁体   English

可作为 APK 安装的 Android 应用程序的大小限制

[英]Size Limit of Android Application that can be installed as APK

I am currently on an Android project which contains Videos/Audios and many Images.我目前在一个包含视频/音频和许多图像的 Android 项目上。 All these media files are in res/drawable or res/raw or in the assets directory of android project.所有这些媒体文件都在 res/drawable 或 res/raw 或 android 项目的 assets 目录中。 When I build APK its size reached 300MBs and I haven't complete 50% of the project yet.当我构建 APK 时,它的大小达到了 300MB,我还没有完成 50% 的项目。 Although project will not be uploaded on Google Play Store It will be installed as it is.虽然项目不会上传到 Google Play 商店,但会按原样安装。 I am concern about the size of APK it will reach.我担心它会达到的 APK 大小。 Can you tell me what is the size limit of the APK that can be installed on an Android device.你能告诉我可以安装在 Android 设备上的 APK 的大小限制是多少。 Thanks.谢谢。

There is no size limit, but Google play has a limit of 150mb and .aab files that exceed this limit cannot be uploaded as a normal build instead you have to use feature delivery.没有大小限制,但 Google Play 有 150mb 的限制,超过此限制的 .aab 文件无法作为正常构建上传,而您必须使用功能交付。

You say that you are not going to upload to playstore;你说你不会上传到Playstore; still 300mb is huge and cannot be justified.仍然 300mb 是巨大的,不能证明是合理的。

  1. Use code obfuscation techniques to remove unwanted code and resources.使用代码混淆技术删除不需要的代码和资源。
  2. Avoid hardcoding / adding huge resource files with the package.避免对包进行硬编码/添加巨大的资源文件。 ie, images and videos.即,图像和视频。 Instead, if possible, make them load from a backend like Firestore.相反,如果可能,让它们从 Firestore 等后端加载。
  3. Avoid usage of libraries even for menial tasks ( if you are doing that )避免使用库,即使是琐碎的任务(如果你这样做)

In conclusion, 300 mb is huge.总之,300 mb 是巨大的。 Man, bring it down below 100 mb at least.伙计,至少将其降低到 100 mb 以下。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM