- Expert Android Programming
- Prajyot Mainkar
- 356字
- 2021-07-08 10:29:06
Reducing the APK file size with APK Analyzer
When users download the APK from the Play Store, the package manager is smart enough to install only the code for the architecture it is installed on, but there is no relief for the data consumed if the APK size is large. Memory space on the phone is a competitive area and to make it worse, if users spot the large APK size they may well decide not to bother. Ensure that your app utilizes memory in a way appropriate for making users download and retain the app. The smaller you make your APK, the more likely it is for the user to at least download the app in the first instance.
The APK file is a simple archive file and there's no way of compressing its size further. Hence, the actions that need to be performed should be followed skillfully using some tools like APK Analyser, before the build is shipped.
This tool helps to understand the contents and the sizes of the different components in your APK. With the help of this tool, you can reduce the size of your APK, by identifying the raw file size and estimated download size of each component that combine, to make up your APK.
To use APK Analyser, select Build>AnalyzeAPK. Follow this step by selecting the APK you want to take a closer look at. The tool will then output in the main Android Studio window, so that you can explore the various components that make up the APK. Using this information, you can nail down the areas where you think there's a loss of some excess bytes.
You need to understand the contents and sizes of different components in your APK, avoid 64K referenced method limit issues with your dex files, diagnose ProGuard configuration issues, view the merged AndroidManifest.xml file, and inspect the compiled resources file. This feature can help you reduce your APK size (you'll see both the raw file size as well as the download size of the various components). You can check out the official reference at https://developer.android.com/studio/build/shrink-code.html for more details regarding the preceding topics.
- Kubernetes實(shí)戰(zhàn)
- PHP程序設(shè)計(jì)(慕課版)
- 我的第一本算法書(shū)
- VSTO開(kāi)發(fā)入門(mén)教程
- R語(yǔ)言編程指南
- Elastic Stack應(yīng)用寶典
- Learning Firefox OS Application Development
- Python編程:從入門(mén)到實(shí)踐
- 軟件測(cè)試實(shí)用教程
- Go語(yǔ)言精進(jìn)之路:從新手到高手的編程思想、方法和技巧(2)
- 用案例學(xué)Java Web整合開(kāi)發(fā)
- Python程序設(shè)計(jì)與算法基礎(chǔ)教程(第2版)(微課版)
- C語(yǔ)言程序設(shè)計(jì)習(xí)題與實(shí)驗(yàn)指導(dǎo)
- Image Processing with ImageJ
- Learning Splunk Web Framework