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

前端 未结 1 589
轮回少年
轮回少年 2021-01-03 06:22

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 i

1条回答
  •  被撕碎了的回忆
    2021-01-03 06:48

    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 讨论(0)
提交回复
热议问题