简体   繁体   中英

Reduce Size of .apk file

I want to reduce the size of my android application, so I started exploring what is there in my apps .apk file, strange I want images from hololighttheme in the resources folder, although I selected none in themes while creating my project in eclipse. Can anyone help to prevent these default images creeping into my application?

Make sure you are not keeping unnecessary images in drawable folders. The APK file is basically a .zip file, so there's no way of compressing its size any further.

I can give you following tips which will help you reduce the size of APK file.

Use ProGuard to obfuscate the code,which will not only will provide you security but also it will shrink the code to great extent.

Switch off all debug logs when you are releasing app in production.

static final boolean debug = false;
if (debug) {
Log.v(TAG,"blah blah blah");
}

Use a tool such as OptiPNG or PNGCrush reducing PNG file size while still ensuring image quality.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM