如果我不在 Android 中压缩纯文本文件,它是否会在 APK 中被压缩?

发布于 2024-11-24 01:05:41 字数 149 浏览 1 评论 0原文

我正在与自己争论是否要压缩我的应用程序中包含的大约 1.5 MB 的纯文本文件。我可以使用 zip 将其压缩到 400k 并在应用程序中解压缩,但这只是另一件需要处理的事情。如果我不这样做,它会在 APK 中被压缩吗?我可以把它放在一个特殊的地方来实现这一点吗?我真的只关心下载大小。

I'm debating with myself whether or not to compress a plain text file I'm including in my application that is about 1.5 MB. I can compress it to 400k with zip and unzip it in the application, but that's just one more thing to mess with. If I don't do that, will it get compressed anyway in the APK? Is there a special place I could put it to make this happen? I'm really only concerned with download size.

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

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

发布评论

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

评论(1

远山浅 2024-12-01 01:05:41

文件根据其扩展名进行压缩:

/* these formats are already compressed, or don't compress well */
static const char* kNoCompressExt[] = {
    ".jpg", ".jpeg", ".png", ".gif",
    ".wav", ".mp2", ".mp3", ".ogg", ".aac",
    ".mpg", ".mpeg", ".mid", ".midi", ".smf", ".jet",
    ".rtttl", ".imy", ".xmf", ".mp4", ".m4a",
    ".m4v", ".3gp", ".3gpp", ".3g2", ".3gpp2",
    ".amr", ".awb", ".wma", ".wmv"
};

来源

如果它不是其中之一,它将在构建 apk 时被压缩。

Files are compressed based on their extension:

/* these formats are already compressed, or don't compress well */
static const char* kNoCompressExt[] = {
    ".jpg", ".jpeg", ".png", ".gif",
    ".wav", ".mp2", ".mp3", ".ogg", ".aac",
    ".mpg", ".mpeg", ".mid", ".midi", ".smf", ".jet",
    ".rtttl", ".imy", ".xmf", ".mp4", ".m4a",
    ".m4v", ".3gp", ".3gpp", ".3g2", ".3gpp2",
    ".amr", ".awb", ".wma", ".wmv"
};

Source

If it's not one of those it will be compressed when building the apk.

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