android – 由于图像而造成的大型应用大小.如何压缩.PNG图像?

我开发的应用程序有很多图像可以工作,因为我的应用程序的大小已经变得非常大.我想压缩或类似的东西来减少应用程序的大小.任何想法?

解决方法

在编译您的应用程序时,放置在res / drawable中的.png文件automatically optimized

Bitmap files may be automatically optimized with lossless image
compression by the aapt tool during the build process.
For example,a
true-color PNG that does not require more than 256 colors may be
converted to an 8-bit PNG with a color palette. This will result in an
image of equal quality but which requires less memory. So be aware
that the image binaries placed in this directory can change during the
build. If you plan on reading an image as a bit stream in order to
convert it to a bitmap,put your images in the res/raw/ folder
instead,where they will not be optimized.

话虽如此,你还有更多的选择.来自Google I / O 2016的“Image Compression for Android Developers”的这个话题有很好的发言,它概述了可能性,解释了他们的不足之处,并给出了一些一般的最佳实践.

如果您的应用程序的大小要高于市场上的发布,那么您也可以

>发送您的应用程序没有图像,并将它们从互联网加载到手机SD卡时,应用程序第一次启动
>使用Android本身的APK Extension Files,这基本上是一样的,但你不必自己做一切.

相关文章

Android性能优化——之控件的优化 前面讲了图像的优化,接下...
前言 上一篇已经讲了如何实现textView中粗字体效果,里面主要...
最近项目重构,涉及到了数据库和文件下载,发现GreenDao这个...
WebView加载页面的两种方式 一、加载网络页面 加载网络页面,...
给APP全局设置字体主要分为两个方面来介绍 一、给原生界面设...
前言 最近UI大牛出了一版新的效果图,按照IOS的效果做的,页...