APK 大小较小但资产较多?

发布于 2024-09-26 10:53:31 字数 396 浏览 2 评论 0原文

我正在创建一个简单的 Android 应用程序来查看漫画书。这些页面很大(每个 0.5-1 mb),高质量的 .png,我将它们加载到 web 视图中以利用内置的缩放控件。到目前为止,我只有 17 个文件,APK 大小已经约为 16 MB。我希望在未来的更新中添加 200 多个文件。我真的不能降低质量太多,因为有一些小文本必须放大才能阅读。有什么建议吗?此处发布了类似的问题:如何减小应用程序(.apk)大小 ,但我不想失去图像的质量。我不确定链接到这里是否合适,但如果有帮助的话,您可以通过在 Android 市场上搜索 Tracer(由 Detour Mobile 提供)来查看我的应用程序。提前致谢。

I am creating a simple android app to view a comic book. The pages are large(0.5-1 mb each), high quality .png's and I am loading them into a webview to make use of the built in zoom controls. So far I only have 17 files and the APK size is already about 16 mb. I'm looking to add over 200 files in future updates. I can't really reduce the quality too much because there is small text that must be zoomed-in on to read. Any suggestions? A similar question was posted here: How to reduce App (.apk) Size, but I don't want to lose the quality of the images. I'm not sure if it's appropriate to link to here, but you can have a look at my app by searching for Tracer (by Detour Mobile) on the android market if it helps at all. Thanks in advance.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

短叹 2024-10-03 10:53:31

您可以在不使用有损压缩的情况下压缩它们 - 例如压缩/压缩它们,但我不相信这会给您带来比各处几千字节更多的空间。否则,请尝试使用比 PNG 更紧凑的格式,例如 JPEG(您不会损失太多质量。)顺便说一句,所有这些都是在引用的帖子中建议的。

如果您确实决定稍微缩小图像的尺寸,请务必使用双三次锐化之类的方法 - 在缩小图像尺寸时,它往往看起来比其他方法更好。

另一种选择是通过预取下载正在阅读的漫画图像,这样阅读就不会被中断太多。

You could compress them without using lossy compression- e.g. zipping/rarring them, but I don't believe this would gain you much more than a few kilobytes here and there. Otherwise, try using a more compact format than PNG, such as JPEG (you won't lose too much quality.) By the way, all of this was suggested in the referenced post.

If you do decide to scale down the images' size somewhat, be sure to use a method like bicubic sharper- it tends to look better than others when reducing image size.

Another option would be to download the images for the comic that is being read on-the-fly with pre-fetching so reading would not be interrupted as much.

妞丶爷亲个 2024-10-03 10:53:31

考虑将图像放置在 Assets 文件夹中,而不是 Res 文件夹中。最大的区别是,资产内容不会被编译到 R.java 类中,因此您将看到大量的存储节省。您必须修改代码,因为您无法通过常规 r.resID 表示法调用图像,但这是可行的

Consider placing your images in Assets folder as opposed to Res. The big difference is, Assets content won't be compiled into R.java class so you will see major storage savings. You'd have to modify your code though as you won't be able to call up the images via the regular r.resID notation, but it's doable

清浅ˋ旧时光 2024-10-03 10:53:31

android提供了一种新的处理方式。
Android 应用程序包 apk 大小的最大大小为 150mb
但您可以使用资源包将 apk 与静态文件分开
并上传您的应用程序

这里是有关资源包的更详细说明:
https://developer.android.com/guide/playcore/asset-delivery

这是将资产包与常规 Android 应用程序集成的指南:
https://developer.android.com/guide/playcore/asset-交付/集成-java

android offers a new way to deal with it.
android app bundle apk size has a maximum size of 150mb
but you can use an asset pack to seperate the apk from the static files
and upload your app

here is a more detailed explanation about asset packs:
https://developer.android.com/guide/playcore/asset-delivery

here is the guide for integrating asset packs with regular android app:
https://developer.android.com/guide/playcore/asset-delivery/integrate-java

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文