search

Home  >  Q&A  >  body text

android - How to reduce the size of APK

How to reduce the size of APK

仅有的幸福仅有的幸福2827 days ago851

reply all(3)I'll reply

  • 伊谢尔伦

    伊谢尔伦2017-05-16 13:34:04

    The larger ones in apk are generally image resources, so files, and referenced JARs.

    So, you can find breakthroughs from these places.

    1. Image resources,

      • Compress all image resources https://tinypng.com/

      • Use .9 pictures

      • Use webp

      • Use vector graphics

      • Status changes and other pictures can be done with selector

      • If the requirements are not high, just adapt and make two sets of pictures: h-dpi xxh-dpi

    2. so library

      • Generally, it is not necessary to support the x86 architecture. You can delete the so file under this architecture

      • Delete some unused so libraries. It is common to refer to Baidu Maps. As long as the positioning function is used, all so libraries are introduced

    3. Enable compression when packaging to avoid confusion

    Reference link: http://www.fqxyi.com/Android/...

    reply
    0
  • 某草草

    某草草2017-05-16 13:34:04

    What else can I say? Just search it on Baidu and you will know.

    reply
    0
  • 高洛峰

    高洛峰2017-05-16 13:34:04

    The simplest and most effective method:

    • Image format adjustment: change to webp

    • Remove unused resources

    • proguard on

    reply
    0
  • Cancelreply