开发者

If I don't compress a plain text file in Android, will it be compressed in the APK anyway?

开发者 https://www.devze.com 2023-03-20 19:40 出处:网络
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开发者_Go百科 unzip it in the applica

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开发者_Go百科 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.


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消