Android - 每种分辨率都有不同的 apk,以减少 apk 的大小

发布于 2024-11-09 22:10:39 字数 47 浏览 4 评论 0原文

针对不同的分辨率使用不同的 APK 是个好主意吗?我想减小 apk 文件的大小。

Is it a good idea to use different APK for different resolutions? I want to reduce the apk file size.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

尝蛊 2024-11-16 22:10:39

这是一个非常糟糕的主意。 Android 手机有多种不同的分辨率,(a) 为每种分辨率创建不同的分辨率以及 (b) 期望用户下载正确的分辨率是不切实际的。

拥有平板电脑版本可能值得也可能不值得,具体取决于您与应用程序捆绑的内容,但可能不值得。

最好尝试遵循开发人员指南的建议来创建适用于各种屏幕的资源。

That's a pretty bad idea. Android phones come in lots of different resolutions, and it's impractical to (a) create a different one for each resolution and (b) expect the users to download the right one.

It may or may not be worth it, depending on what you have bundled with the app, to have a tablet version, but probably not.

It'd be much better to just try to follow the Developer Guide's advice in creating resources appropriate for a wide variety of screens.

梦里南柯 2024-11-16 22:10:39

我认为这个问题比所提供的答案更有价值。我也有类似的情况。我认为这个问题将通过即将添加到市场的多个 apk 功能来解决(他们说是六月)。

我的大多数设备(非平板电脑)的应用程序是 2.5mb,这很好,支持更大的平板电脑(6.2mb)。这超过了一倍,这是需要精确尺寸 png 的结果。我不希望我的非平板电脑用户必须等待更大的平板电脑 png。这看起来不太对劲。我考虑过多个 apk,但会等待 Android 团队在 6 月份发布的内容。但现在我可能只做更大的 6.2mb apk(我不确定它在应用程序世界中是否很大,但它比 id 更大)

I think the question has more value than the answers provided. I am in a similar situation. I think this will be solved by the multiple apk feature soon to be added to the market (june they say)

My app for most devices (non-tablet) is 2.5mb which is nice, with support for the larger tablets its 6.2mb. This is more than double, which is a result of needing exact dimension pngs. I dont want my non tablet users to have to wait for the larger tablet pngs. It just doesn't seem right. I considered multiple apks, but will wait to see what the Android team releases in June. but for now I might just do the larger 6.2mb apk (which im not sure is large in the app world, but its bigger than id like)

月隐月明月朦胧 2024-11-16 22:10:39

最好的方法是为不同的分辨率提供可绘制/布局,而不是根据分辨率创建不同的 apk。所有分辨率的通用应用程序比不同分辨率的不同应用程序更好。

阅读本文以更好地理解。

此外,这个通用应用程序还可以移植到设备和平板电脑..这两者的唯一区别只是屏幕尺寸,因为 Android 没有设备/平板电脑的概念

Best way is to provide drawables/layout for different resolutions rather than creating different apk depending upon resolutions. Universal application for all resolutions is best than different app for different resolutions.

Read this for better understanding.

Apart from this universal application can be ported for devices and tablet.. and only difference in these two are just screen size, as there is no concept of device/tablet for android

鹤舞 2024-11-16 22:10:39

首先我想知道哪种类型的文件会增加您的 APK 的大小?不建议为不同的分辨率使用同一应用程序的不同 apk。如果您担心减小 APK 的大小,那么您可以执行以下操作:

1) 图形或可绘制文件夹会增加 apk 的大小。如果您有三种类型的可绘制文件夹,用于三种不同的分辨率。你只能有一个drawable文件夹并使用 9-patch 图形来支持不同的屏幕分辨率会减小你的 apk 大小

2) 在 eclipse 中清理你的代码,优化你的代码以获得更好的性能

First of all I want to know which type of files increase the size of your APK? It is not recommendable to have different apk of the same application for different resolution. If decreasing size of APK is your concern then you can do the following things:

1) Graphics or drawable folder increases apk size. If you have three types of drawable folder for three diff resolution. you can have only one drawable folder and use 9-patch graphics to support different screen resolutions which will decrease your apk size

2) Clean up your code in eclipse, optimize your code to get better performance

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文