Java 减少 android 应用程序 (apk) 大小
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/25101534/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Reducing android app (apk) size
提问by Vivek Warde
I would be now publishing my first app on Google play store. I have already compressed images used in my app. And I have some questions regarding the app size.
我现在将在 Google Play 商店发布我的第一个应用程序。我已经压缩了我的应用程序中使用的图像。我对应用程序大小有一些疑问。
If the size of app is less that 2 MB then there are less chances that user will uninstall the app, is my this statement true for apps belonging to education field ?
如果应用程序的大小小于 2 MB,那么用户卸载该应用程序的机会就会减少,我的这句话对于属于教育领域的应用程序是否正确?
However, When I see my apk file in windows it shows 3.10 MB but when it gets installed in device as viewed from App info it shows:
但是,当我在 Windows 中看到我的 apk 文件时,它显示为 3.10 MB,但是当它安装在设备中时(从 App info 中查看),它显示:
Total............................8.68 MB
App..............................7.02 MB
USB storage app..................0.00 B
Data.............................1.66 MB (perhaps it is the size of sqlite db + ttf's)
SD card..........................0.00B
So, Why do I see that much increase in my app size, Can it be minimized ?
那么,为什么我看到我的应用程序大小增加了这么多,可以最小化吗?
And, I am using 4 libraries (jars) in my project which are in Android Private Libraries
, but these library have their copy outside this folder also.
而且,我在我的项目中使用了 4 个库(jar),它们在Android Private Libraries
.
Is it safer to delete them, & deleting them can help to decrease apk size?
删除它们是否更安全,删除它们有助于减小 apk 大小?
Also I have visited many web pages describing what Proguard
does, I truly understand how Proguard reduces size of apk, it shrinks, optimizes, and obfuscates our code by removing unused code and renaming classes, fields, and methods with semantically obscure names. The result is a smaller sized .apk file that is more difficult to reverse engineer. But I do not know How should be my proguard-project.txt
should look like ?
I am using 4 libraries in my app namely easyfacebookandroidsdk_2.3.jar
,android-support-v7-appcompat.jar
,google-play-services.jar
& android-support-v4.jar
.
此外,我访问了许多描述其Proguard
作用的网页,我真正了解 Proguard 如何通过删除未使用的代码和重命名具有语义模糊名称的类、字段和方法来缩小 apk 的大小,缩小、优化和混淆我们的代码。结果是较小的 .apk 文件更难逆向工程。但我不知道我的应该是proguard-project.txt
什么样子?
我在我的应用程序中使用了 4 个库,即easyfacebookandroidsdk_2.3.jar
, android-support-v7-appcompat.jar
, google-play-services.jar
& android-support-v4.jar
。
Currently my proguard-properties.txt
looks like this & also it do not uses WebView
目前我proguard-properties.txt
看起来像这样,它也不使用 WebView
# To enable ProGuard in your project, edit project.properties
# to define the proguard.config property as described in that file.
#
# Add project specific ProGuard rules here.
# By default, the flags in this file are appended to flags specified
# in ${sdk.dir}/tools/proguard/proguard-android.txt
# You can edit the include path and order by changing the ProGuard
# include property in project.properties.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html
# Add any project specific keep options here:
# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}
-keep class com.facebook.** { *; }
-keepattributes Signature
So, what lines should I add in my proguard-properties.txt
so that it can remove unused references,classes,etc., in order to reduce the apk size ?
那么,我应该添加哪些行proguard-properties.txt
以便它可以删除未使用的引用、类等,以减少 apk 大小?
Using AndroidUnusedResources.jar available at https://code.google.com/p/android-unused-resources/finds unused resources in android project.
使用https://code.google.com/p/android-unused-resources/ 上的AndroidUnusedResources.jar 可 在 android 项目中查找未使用的资源。
I think this is the same thing which proguard has already done ? Or should it also be used after enabling proguard ?
我认为这与 proguard 已经做过的事情相同?还是应该在启用 proguard 后使用它?
Also you can mention in your answer anything that is missing which you feel should be shared.
Thanks in Advance...
您也可以在答案中提及您认为应该分享的任何缺失内容。
提前致谢...
采纳答案by Christopher Rucinski
So, Why do I see that much increase in my app size, Can it be minimized?
那么,为什么我看到我的应用程序大小增加了这么多,可以最小化吗?
Almost solely because of your res folder images! You should have around 4 copies of each image in the drawable-mdpi, -hdpi, xhdpi folders. The only difference is that theu are all different sizes.
几乎完全是因为您的 res 文件夹图像!您应该在 drawable-mdpi、-hdpi、xhdpi 文件夹中拥有每个图像的大约 4 个副本。唯一的区别是它们都是不同的尺寸。
Is it safer to delete them, & deleting them can help to decrease apk size?
删除它们是否更安全,删除它们有助于减小 apk 大小?
Chances are there aren't multiple copies of those jar files! Just one copy with links to it!
可能没有这些 jar 文件的多个副本!只有一份带有链接的副本!
Proguard
混淆器
Yes, what you said was right about Proguard. However, realize that you are talking about text files here. They are really small. I mean really small in size (kilobyte-wise). Your problem is something in the megabyte (MB) size. That is images!!!!
是的,你说的关于 Proguard 是正确的。但是,请意识到您在这里谈论的是文本文件。他们真的很小。我的意思是尺寸非常小(以千字节为单位)。您的问题是兆字节 (MB) 大小的问题。那是图片!!!!
Repeat. That is images!!!!
重复。那是图片!!!!
Enabling proguard will save a little bit size-wise.
启用 proguard 将节省一点大小。
Also you can mention in your answer anything that is missing which you feel should be shared?
您也可以在回答中提及您认为应该分享的任何遗漏之处?
Yes, these are all more important in your case. Please read and apply these. Good luck!
是的,这些对你的情况来说都更重要。请阅读并应用这些。祝你好运!
If a user finds your app helpful, then they won't uninstall it; however, there are several things you can do
如果用户发现你的应用有帮助,他们就不会卸载它;但是,您可以做几件事
- Can you move images to the weband
async
them into your app? - Make sure your files are completely compressedas much as possible. Use pngquantor tinypng.
- Check for any repetition in the images. You might be able to use 9-patchfor it.
- You might be able to make your own drawablesfor certain images.
Allow users to move data to an SD card.
[EDIT] After the app has been in the Play Store for a while, check the Developer Console and see which screen size/density is used the least.Remove that drawable folder from your app!This could reduce the size a good amount! But, check my edit below for the cons of this approach!!
- [EDIT 2] In Windows Explorer, check the folder sizefor your whole res folder, and the whole java folder. If your java folder's size is small, then all your effor to reduce APK size should be what I state above.
- 您可以将图像移动到网络并将
async
它们移动到您的应用程序中吗? - 确保您的文件尽可能完全压缩。使用pngquant或tinypng。
- 检查图像中是否有任何重复。您也许可以使用9-patch。
- 您也许可以为某些图像制作自己的可绘制对象。
允许用户将数据移动到 SD 卡。
[编辑] 应用在 Play 商店中一段时间后,检查开发者控制台并查看使用最少的屏幕尺寸/密度。从您的应用程序中删除该可绘制文件夹!这可以大大减少尺寸!但是,请检查下面我的编辑以了解这种方法的缺点!!
- [编辑 2]在 Windows 资源管理器中,检查整个res 文件夹和整个java 文件夹的文件夹大小。如果您的 java 文件夹的大小很小,那么您减少 APK 大小的所有努力都应该是我上面所说的。
You might want to show a few of the images, as that would allow us to see what you are dealing with
您可能想要展示一些图像,因为这将使我们能够看到您正在处理的内容
EDIT
编辑
@Ashwin N Bhanushali Has a great answer herefor the part of the question I did not answer, but he basically told you that there was nothing you could really do except what I said, plus an idea or 2 more.
@Ashwin N Bhanushali对于我没有回答的部分问题,这里有一个很好的答案,但他基本上告诉你,除了我说的话,你真的无能为力,再加上一个或两个想法。
I did have another idea that was based on one of his ideas that would be even better, because Android Studio does not include the drawable-ldpi folder in the project anymore. So it would only be helpful if you use Eclipse, mine expands
我确实有另一个想法,它基于他的一个想法会更好,因为 Android Studio 不再在项目中包含 drawable-ldpi 文件夹。所以只有当你使用 Eclipse 时才会有帮助,我的扩展
- Release the APK into the Google Play Storeafter making the recommended fixes
- After some time has passed-- a week, a month, etc -- you can check the statsof your application in the Google Play Developer Console.
- Look for the screen size buckets(drawable-mdpi, -hdpi, -xhdpi, -xxhdpi) that are used the least!You could remove those bucketsfrom your app altogether!
- 完成推荐的修复后,将APK 发布到 Google Play 商店
- 过了一段时间(一周、一个月等)后,您可以在Google Play Developer Console中查看应用程序的统计信息。
- 寻找使用最少的屏幕尺寸桶(drawable-mdpi, -hdpi, -xhdpi, -xxhdpi)!您可以完全从您的应用程序中删除这些存储桶!
This works because pictures take up way more bytes than text files. And all those drawables have the same images in them(just different sizes). Removing the images from less used buckets can save a lot of space!!
这是有效的,因为图片比文本文件占用更多的字节。所有这些可绘制对象都具有相同的图像(只是大小不同)。从较少使用的存储桶中删除图像可以节省大量空间!!
Take note that removing those bucketsfrom your app will mean that your app will have to do more work on those phones that use the removed buckets. The app might be slower for those users; however, the app size can be reduced more.
请注意,从您的应用程序中删除这些存储桶意味着您的应用程序将不得不在使用已删除存储桶的手机上做更多的工作。对于这些用户来说,应用程序可能会更慢;但是,应用程序的大小可以减少更多。
EDIT 2
编辑 2
Text files take up almost nothing.Take a look in the file system for your project!
文本文件几乎不占用任何内容。查看您项目的文件系统!
In the picture below. Check the size of...
在下面的图片中。检查尺寸...
- the javafolder
- the resfolder
- 在Java的文件夹
- 在资源文件夹
In your case, you will see that the java folder is probably really small in size(10 through a few hundred KBs); however, you will see that the res folder is really large in size(several MBs!).
在您的情况下,您会看到 java 文件夹的大小可能非常小(10 到几百 KB);但是,您会看到 res 文件夹的大小非常大(几 MB!)。
That means that any compression, or reduction in your code basewill be very small and not worth it!!
这意味着任何压缩或代码库的减少都将非常小并且不值得!!
Therefore the best way to reduce your APK size is to follow my instructions above!
因此,减小 APK 大小的最佳方法是按照我上面的说明进行操作!
Edit 3
编辑 3
Here is a test that you can do right away and see the absolute maximum (plus more) that tools like Proguard, and AndroidUnusedResources.jarwill reduce the size of the APK file!
这是一个您可以立即进行的测试,看看Proguard和AndroidUnusedResources.jar等工具将减少 APK 文件大小的绝对最大值(加上更多)!
What you have to do is remove ALLcode from your project except for the class declarations. Do the same for Abstract classes, Interfaces, Enums, etc... Your project structure should stay the same, and you should not be using any external libraries at all then.
您需要做的是从项目中删除除类声明之外的所有代码。对抽象类、接口、枚举等做同样的事情......您的项目结构应该保持不变,并且您根本不应该使用任何外部库。
So you will have something like this for all of your classes...
public class CustomClass { private String variable; // List of variables public CustomClass() { ... } // List of constructors public getVariable() { ... } // List of Assessors public setVariable(String val) { ... } // List of Mutators private String helperMethods() { ... } // List of helper and other methods }
You should remove all the code inside of the classes, interfaces, enums, etc to look like the following; however, leave all your images alone!! ...
public CustomClass { // Everything is removed!! No libraries used, nothing. Unless certain classes // require some methods like Activity. Those methods should be empty though! }
Now compile and build your project.
Check the new APK size to your current APK.
- This will be the smallest possible compressed size file you can achieve with your code. Yes, your program wont do anything, but that is besides the point. You care about size here, and this is ONLY a test.
Install the app on your phone, and check the new app size to your current app size
- This will be the smallest possible uncompressed size file your can achieve with your code. Yes, your program wont do anything, this is just a test.
所以你所有的课程都会有这样的东西......
public class CustomClass { private String variable; // List of variables public CustomClass() { ... } // List of constructors public getVariable() { ... } // List of Assessors public setVariable(String val) { ... } // List of Mutators private String helperMethods() { ... } // List of helper and other methods }
您应该删除类、接口、枚举等中的所有代码,如下所示;然而,不要管你所有的图片!!...
public CustomClass { // Everything is removed!! No libraries used, nothing. Unless certain classes // require some methods like Activity. Those methods should be empty though! }
现在编译并构建您的项目。
将新的 APK 大小检查为您当前的 APK。
- 这将是您可以使用代码实现的最小压缩文件。是的,你的程序不会做任何事情,但这不是重点。你关心这里的大小,这只是一个测试。
在您的手机上安装该应用程序,并将新应用程序大小检查为您当前的应用程序大小
- 这将是您可以使用代码实现的最小的未压缩文件。是的,你的程序不会做任何事情,这只是一个测试。
If you notice that the 2 apps are still around the same size, then spending all your time with Proguard and AndroidUnusedResources.jar is meaningless at this stage. This is a test to see where you would spend your personal resources in app size reduction.
如果您注意到这两个应用程序的大小仍然大致相同,那么在此阶段将所有时间都花在 Proguard 和 AndroidUnusedResources.jar 上是没有意义的。这是一项测试,以了解您将个人资源用于减少应用程序大小的位置。
回答by DanKodi
First of all look in to your drawables.
首先看看你的drawables。
- If you are using a PSD to get the images for the app, those images might not be optimized for web and devices. You Photoshops "Save for Web and Devices" to optimize the images. You can reduce lot of kbs from this.
- Next, see if you can replace images with XML drawables. For example, buttons and background can be done using XML
- 如果您使用 PSD 获取应用程序的图像,则这些图像可能未针对 Web 和设备进行优化。您可以使用 Photoshop“保存为 Web 和设备”来优化图像。您可以从中减少很多 kbs。
- 接下来,看看您是否可以用 XML 可绘制对象替换图像。例如,按钮和背景可以使用 XML 来完成
回答by Eric Lafortune
ProGuard by default applies its shrinking, optimization, and obfuscation -- that's its main purpose. You do have to enable it in your Android build, by editing the documented ProGuard line in your project.properties
. It enables ProGuard (with or without optimization) for release builds with Ant and Eclipse. With Ant, you'll see ProGuard output in the build log.
ProGuard 默认应用它的收缩、优化和混淆——这是它的主要目的。你必须在你的 Android 版本中启用它,方法是在你的project.properties
. 它为使用 Ant 和 Eclipse 的发布版本启用 ProGuard(有或没有优化)。使用 Ant,您将在构建日志中看到 ProGuard 输出。
See the Android documentation > Tools > ProGuard.
请参阅 Android 文档 > 工具 > ProGuard。
You should then check your processed application. You may need additional -keep options, e.g. possibly for Google Play Services. The less you can keep, the smaller your application will be.
然后,您应该检查已处理的申请。您可能需要额外的 -keep 选项,例如可能用于 Google Play 服务。您可以保留的越少,您的应用程序就越小。
回答by Jim
The reason you see the increased file size is that APK's are compressed files. Use of Proguard can help - here's a good resource:
您看到文件大小增加的原因是 APK 是压缩文件。使用 Proguard 可以提供帮助 - 这是一个很好的资源:
http://developer.sonymobile.com/2012/01/31/tips-for-reducing-apk-file-size/
http://developer.sonymobile.com/2012/01/31/tips-for-reducing-apk-file-size/
However, I can assure you that you can get millions of downloads without being file-size sensitive. Both from my personal experience but also from looking at Google Play. There are thousands of apps with millions of downloads where the file size greatly exceeds 2MB. In fact, there are many that are around 20MB. In other words, do what you can to keep it small, but don't worry that it will impact use or downloads.
但是,我可以向您保证,您可以获得数百万次下载,而不会对文件大小敏感。既来自我的个人经验,也来自 Google Play。有数以百万计的下载数以千计的应用程序的文件大小大大超过 2MB。事实上,有很多大约 20MB。换句话说,尽你所能保持它很小,但不要担心它会影响使用或下载。
回答by Vaishali Sutariya
Try enabling http://developer.android.com/tools/help/proguard.html, even without obfuscation. It will remove unused Java code from your dependencies. See if you have unneeded dependencies - JARs that you've added but aren't using Check your resources for large images or other files. You may want to change their format or resolution, or remove them if they're not in use.
尝试启用http://developer.android.com/tools/help/proguard.html,即使没有混淆。它将从您的依赖项中删除未使用的 Java 代码。查看您是否有不需要的依赖项 - 您已添加但未使用的 JAR 检查大图像或其他文件的资源。您可能想要更改它们的格式或分辨率,或者在它们不使用时将其删除。
回答by Ashwin N Bhanushali
So, Why do I see that much increase in my app size, Can it be minimized ?
那么,为什么我看到我的应用程序大小增加了这么多,可以最小化吗?
The .apk-file
.apk 文件
An .apk-file is not magical at all. It's just a bundle of files which represent the content of an Android application. If you open it in a archive-tool (like 7Zip), you can browser and extract it's contents.
.apk 文件一点也不神奇。它只是代表 Android 应用程序内容的一组文件。如果您在存档工具(如 7Zip)中打开它,您可以浏览并提取其内容。
Now this apk file is extracted during installation hence there is increase in the size of the App.
现在这个 apk 文件是在安装过程中提取的,因此应用程序的大小增加了。
Some more detail regarding compilation
关于编译的更多细节
What happens to the .java-files?
.java 文件会发生什么?
Well, first they are normally compiled by an installed JDK implementation. After they are compiled (to .class-files), the dx-tool from the Android SDK then cross-compiles those "normal" java-classes into Dalvik-Bytecode.
好吧,首先它们通常由已安装的 JDK 实现编译。在它们被编译(到 .class-files)之后,来自 Android SDK 的 dx-tool 然后将那些“正常”的 java 类交叉编译成 Dalvik-Bytecode。
This "special" java-code is then interpreted by the DVM (Dalvik Virtual Machine), which is based on the opensource JRE-implementation Apache Harmony.
这个“特殊”的 java 代码然后由基于开源 JRE 实现 Apache Harmony 的 DVM(Dalvik 虚拟机)解释。
What happens to the resources i put into the /asset-directory?
我放入 /asset-directory 的资源会怎样?
Android offers the /assets-directory to add some binary raw-files (e.g. a SQLite Database). Files which are put into this directory are not compiled or optimized.
Android 提供了 /assets-directory 来添加一些二进制原始文件(例如 SQLite 数据库)。放入此目录的文件不会被编译或优化。
If you put your files into this directory, this is the kind of behavior you would expect from Android.
如果您将文件放入此目录,这就是您期望从 Android 获得的行为类型。
What happens to the resources i put into the /res/raw-directory?
我放入 /res/raw-directory 的资源会怎样?
Like the /assets-directory, you can also put binary (or other) raw-files in here (e.g. HTML-files for the Help-page). These files are compiled/optimized (if possible).
与 /assets-directory 一样,您也可以在此处放置二进制(或其他)原始文件(例如帮助页面的 HTML 文件)。这些文件被编译/优化(如果可能)。
What happens to the Manifest and the other XML-files?
Manifest 和其他 XML 文件会发生什么?
The Android-Manifest and also the other XML-files (Layouts, Strings, etc.) are stored and "compiled" into a binary XML-format. This is a speed-optimization.
Android 清单以及其他 XML 文件(布局、字符串等)被存储并“编译”为二进制 XML 格式。这是速度优化。
So you got the answer why app size is increased after installation.
所以你得到了为什么安装后应用程序大小会增加的答案。
Now Is it safer to delete them(Android Libraries), & deleting them can help to decrease apk size?
现在 删除它们(Android 库)是否更安全,删除它们可以帮助减小 apk 大小?
You can remove google-play-services.jar
since it is required only in development environment it's not required in runtime environment.Prompt user to install it from the play store.
您可以删除,google-play-services.jar
因为它仅在开发环境中需要,在运行时环境中不需要。提示用户从 Play 商店安装它。
Coming to Proguard:: It will remove the unused java classes and will do the code obfuscation.It will not remove unused resources like layout xmls,drawables etc. So my opinion is to run the tool to remove unused resources.
来到 Proguard:: 它将删除未使用的 java 类并进行代码混淆。它不会删除未使用的资源,如布局 xmls、drawables 等。所以我的意见是运行该工具来删除未使用的资源。
Below are some tips to reduce the size.
下面是一些减小尺寸的技巧。
You can remove drawable-ldpi folder if you are using it.Since there are no more devices with ldpi screen resolution.
You can remove drawable-ldpi folder if you are using it.Since there are no more devices with ldpi screen resolution.
Reduce the use of image drawables(i.e .png or jpg files).Use xml drawables and 9-patch drawables.
Reduce the use of image drawables(i.e .png or jpg files).Use xml drawables and 9-patch drawables.
Remove any debug info related code.
Remove any debug info related code.
Avoid code duplication.Follow the principal of Don't Repeat yourself.
Avoid code duplication.Follow the principal of Don't Repeat yourself.
I think this is enough to reduce app size in your case.
我认为这足以减少您的应用程序大小。
回答by Abx
In most of the cases app size is propotional to the resource file(images and other stuff) that you use to create an application.Always consider the following.
在大多数情况下,应用程序大小与您用于创建应用程序的资源文件(图像和其他内容)成正比。始终考虑以下事项。
- Try using minimal images.(In most cases ,there is not need to add images in the Ldpi folder) .
- Use vector images instead of putting images for all screen resolutions .One way is to use SVG ,9 patch
- Try to use xml drawable to create generic images like square,rectangle circle,borders etc instead of .png images Try some image compression techniques.
- Try fetching large images from Api rather than putting it in the res folder.(Download only when needed).
- 尝试使用最少的图像。(在大多数情况下,不需要在 Ldpi 文件夹中添加图像)。
- 使用矢量图像而不是为所有屏幕分辨率放置图像。一种方法是使用 SVG ,9 patch
- 尝试使用 xml drawable 创建通用图像,如正方形、矩形、圆形、边框等,而不是 .png 图像尝试一些图像压缩技术。
- 尝试从 Api 获取大图像,而不是将其放在 res 文件夹中。(仅在需要时下载)。
Library imports
库导入
- Try to remove unwanted libraries while creating a build for appstore.
- If you need a particular functionality in a alibrary then try to extract the required class files and use it rather than importing the whole library jar.
- Clean your class by removing unused import (although it won't have much effect on size but it will make things more simple and straight).In eclipe select the src folder->rightclick->source->organize imports
- 在为 appstore 创建构建时尝试删除不需要的库。
- 如果您需要库中的特定功能,请尝试提取所需的类文件并使用它,而不是导入整个库 jar。
- 通过删除未使用的导入来清理您的类(虽然它不会对大小产生太大影响,但会使事情变得更简单和直接)。在 eclipe 中选择 src 文件夹->右键单击->源->组织导入
回答by Deep Shah
It is one option that you compress all your PNGs for that you can go to https://tinypng.com/.
压缩所有 PNG 是一种选择,您可以访问https://tinypng.com/。
After that remove unnecessary library imports for example it is not require to import support library v4 if you already imported v7 for appcompat.
之后删除不必要的库导入,例如,如果您已经为 appcompat 导入了 v7,则不需要导入支持库 v4。
And finally after completion of signing procedure of apk use zipalign tool that is shipped with android-sdk for more details refer http://developer.android.com/tools/help/zipalign.html.
最后在完成 apk 的签名过程后,使用 android-sdk 附带的 zipalign 工具获取更多详细信息,请参阅http://developer.android.com/tools/help/zipalign.html。
That's all i know.
这是我知道的全部。
回答by Uday Kumar
There are two things I can point out from experience.
我可以从经验中指出两件事。
If you use eclipse to create apk file then the resources are duplicated (atleast it happened in my case), you can try using ant and build.xml to create the apk and compare the size. Also look into aliasing the resources.
如果您使用 eclipse 创建 apk 文件,那么资源会重复(至少在我的情况下发生过),您可以尝试使用 ant 和 build.xml 创建 apk 并比较大小。还要研究别名资源。
回答by user2642486
Re-compress APK/ZIP as high, it will save 30% more then normal apk build by Android SDK, useful if large number of text files but not if large number of images.
将 APK/ZIP 重新压缩为高,它将比 Android SDK 构建的普通 apk 节省 30%,这在大量文本文件时有用,但如果大量图像则无效。