当前位置:网站首页>Performance optimized APK slimming
Performance optimized APK slimming
2022-07-28 23:06:00 【ZZ White Dragon】
Basic slimming
1. Tools (Lint Test code )

arrow 1: Comprehensive testing
Examine dimensions :
Daniel's article :
https://www.cnblogs.com/andy-songwei/p/7090934.html
http://www.javashuo.com/article/p-vtcbvgwr-nc.html
arrow 2: According to the specific test type lint
2. The image processing :
1. Picture compression
Batch compression is recommended ( The use of plug-in :TinyPngPlugin)
1、Tools --> TinyPngPlugin
2. use WebP Format
3. Confusion handling minifyEnabled true
4. Resource reduction shrinkResources true
Note if there are some resource files that are not sure to use , I dare not delete , Or not sure if the requirements will change , So keep it first ,
have access to shrinkResources To reduce resources
5. Useless so file , Three party Library , Two party Library , And the deletion and reduction of reusable third-party libraries
6. In order to solve the complex tripartite library introduced by simple functions , Try to refer only to their implementation , Avoid introducing third-party libraries
7. Remove unused spare resources
defaultConfig { resConfigs(“en”,“zh”,“zh-rCN”) } The same goes for resource files
defaultConfig { resConfigs(“xxhdpi”,“xxxhdpi”) }
Slimming advanced
1. Resource confusion resources.arsc Resource confusion
Reference resources AndResGuard
2.ReDex
dex Files are the product of packaging ,redex yes facebook Open source subcontracting optimization scheme . You can refer to :ReDex.
3.so Dynamic loading
about so After reduction ,so The proportion of documents is still relatively large , Other than the first start-up can be considered so Dynamic distribution of documents . That is, the idea of plug-in , Load on demand , But while the benefits are great , There's also a lot of risk ,
There's a lot of case Need to take into account , For example, download time 、 The network environment 、 Thread process , If loading fails, whether there is a degradation strategy, etc .
You can refer to facebook Open source SoLoader.
4. pluggable
Load on demand , The greater the return, the greater the risk , The risk is the same as above. .
5. Native switch to H5 Or small programs
6. Picture networking
Upload the picture to the server , Reduce the package volume through dynamic download , The disadvantage is that the first load depends on the network environment , For loading speed , The flow needs to be balanced . Pictures can be preloaded , But traffic consumption is unavoidable , If you care about traffic indicators , It needs to be weighed .
7.DebugItem
DebugItem It mainly contains two kinds of information :
Debugging information . Parameter variables and all local variables of the function .
Troubleshooting information . Correspondence between all instruction set line numbers and source file line numbers .
Remove debug Information and line number information , If not the ultimate , Not recommended . You can refer to this article by Alipay. Alipay App Build optimization resolution :Android Package size is extremely compressed .
8.R Field inline
inline R Field Can solve R Field Too much leads to MultiDex 65536 The problem of , And this step can play a significant effect on code downsizing .
Reference bytes are open source shrink-r-plugin, And Didi's open source booster, Meituan scheme
9. Picture shader
Processing for different colors in the same image , have access to tint, For example, it was originally a black return icon, Now the other page is going to be white , You don't need two pictures ,
But use tint To change it to white .
10. Reduce ENUM Use
Every time you cut one ENUM Can be reduced by about 1.0 To 1.4 KB Size .
The idea of reducing body size :
Packet volume monitoring
Package volume monitoring should be a part of the release process , It's best to be a platform 、 Process , Otherwise it will be difficult to continue , In a few versions, the package volume has risen again .
General idea : Compare the package size of the current version with that of the previous version , exceed 200KB Approval required . For temporary approval, follow-up optimization schemes need to be given .
边栏推荐
- 【雷达】基于核聚类实现雷达信号在线分选附matlab代码
- 【物理应用】水下浮动风力涡轮机的尾流诱导动态模拟风场附matlab代码
- Summary of core functions of software testing tool Fiddler postman JMeter charlse
- 轮子七:TCP客户端
- 无代码开发平台通讯录导出入门教程
- 【图像分割】基于方向谷形检测实现静脉纹路分割附MATLAB代码
- OSV_ Q write divergence operator div and Laplace stepped on the pit
- Yolov5 improvement 5: improve the feature fusion network panet to bifpn
- Leetcode exercise 3 - palindromes
- [copy] Internet terms, abbreviations, abbreviations
猜你喜欢

Target detection notes -yolo

Migration from IPv4 to IPv6

PCA学习

Thesis reading (2) - vggnet of classification

Xshell7, xftp7 personal free version official download, no need to crack, no activation, download and use

无代码开发平台管理后台入门教程

There are four ways for Nacos to configure hot updates and multiple ways to read project configuration files, @value, @refreshscope, @nacosconfigurationproperties

Summary of the problem that MathType formula does not correspond in word

一份来自奎哥的全新MPLS笔记,考IE必看 ----尚文网络奎哥

No code development platform management background tutorial
随机推荐
记录一下关于三角函数交换积分次序的一道题
PCA学习
Goer shares and Shanghai Taisi Weida growth cooperation agreement! Special SOC jointly promotes the development of TWS headphones
MySQL常用的日期时间函数
leetcode 199. 二叉树的右视图
sql优化常用的几种方法
Mspba [anomaly detection: representation_based]
无代码开发平台管理后台入门教程
[radar] radar signal online sorting based on kernel clustering with matlab code
Introduction to address book export without code development platform
Use FFT, matrix multiplication and conv2d to calculate convolution based on pytorch
投资500亿元!中芯京城正式注册成立!
(important) first knowledge of C language -- function
赋能中国芯创业者!看摩尔精英如何破解中小芯片企业发展难题
Simple es highlight practice
Leetcode 199. right view of binary tree
Xshell7, xftp7 personal free version official download, no need to crack, no activation, download and use
Nacos配置热更新的4种方式、读取项目配置文件的多种方式,@value,@RefreshScope,@NacosConfigurationProperties
Yolov5 improvement 5: improve the feature fusion network panet to bifpn
一种分布式深度学习编程新范式:Global Tensor