Android - 应用程序 (apk) 最大大小
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/3536463/
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
Android - Application (apk) Maximum size
提问by Paresh Mayani
I am going to install first application in my android phone, but having some doubts related to Android Memory (Maximum size of APK).
我将在我的 android 手机中安装第一个应用程序,但对 Android 内存(APK 的最大大小)有一些疑问。
So please help me know and solve the problems:
所以请帮助我了解并解决问题:
- What is maximum size of the apkthat can be supported by the android ?
- When we install any apk file in real phone, where does application installed(in SD-card or other memory) ??
- 什么是该APK的最大尺寸可以由机器人来支持?
- 当我们在真实手机中安装任何 apk 文件时,应用程序安装在哪里(在 SD 卡或其他内存中)?
I have referred this link: http://groups.google.com/group/android-developers/browse_thread/thread/7965885da4d1a03aand also searched lot.
我已经提到了这个链接:http: //groups.google.com/group/android-developers/browse_thread/thread/7965885da4d1a03a并且还搜索了很多。
I came Across the search on the web that many people are facing the same issue
What is the maximum size of Application supported by Android. I think this question also help to the people who are connected with Android application programming and development.
我在网上搜索到many people are facing the same issue
Android 支持的应用程序的最大大小是多少。我认为这个问题对与Android应用程序编程和开发有关的人也有帮助。
Update:
Update:
This time i am having 58Mb application from that 52.5MB Images and it runs on the my HTC Hero mobile but On Emulator, it shows an error:
这次我从 52.5MB 图像中获得了 58Mb 应用程序,它在我的 HTC Hero 手机上运行,但在模拟器上,它显示一个错误:
Failed to upload my_application.apk on device 'emulator-5554'
java.io.IOException: Unable to upload file: No space left on device
Launch canceled!
Now please suggest me the way to store images inside the Drawable folder? is there any way to zip the images or such method?
现在请建议我将图像存储在 Drawable 文件夹中的方法?有没有办法压缩图像或这种方法?
采纳答案by Vidar Vestnes
Its probably device specific as devices has a different amount of memory available for application. ref http://groups.google.com/group/android-developers/browse_thread/thread/18cbb2404778618e?pli=1
Its application dependant. The developer may state that the app should be preferrebly install on internal memory, the SD-card, or to let the user choose from SD-card and memory. This is only supported on Android 2.2. On older version of android, version <= 2.1, the app will be installed into the memory. Its defined inside the AndoridMainfest.xml via the
android:installLocation
element. It supports the valuesinternalOnly
,preferExternal
orauto
. But again, only supported on Android 2.2. ref https://developer.android.com/about/versions/android-2.2.html
它可能是特定于设备的,因为设备具有不同数量的可用于应用程序的内存。参考http://groups.google.com/group/android-developers/browse_thread/thread/18cbb2404778618e?pli=1
其应用依赖。开发者可能会声明应用程序应该优先安装在内存、SD 卡上,或者让用户从 SD 卡和内存中进行选择。这仅在 Android 2.2 上受支持。在旧版本的 android 上,版本 <= 2.1,该应用程序将安装到内存中。它通过
android:installLocation
元素在 AndoridMainfest.xml 中定义。它支持值internalOnly
,preferExternal
或auto
。但同样,仅在 Android 2.2 上受支持。参考https://developer.android.com/about/versions/android-2.2.html
I tested on my HTC Desire with more than 500 MB of memory. With almost none apps installed I can install an apk that is 43MB, but an apk that is 57MB is too large, even i got plenty of available memory... it fails with
我在内存超过 500 MB 的 HTC Desire 上进行了测试。几乎没有安装任何应用程序,我可以安装一个 43MB 的 apk,但是 57MB 的 apk 太大了,即使我有足够的可用内存......它失败了
Failure [INSTALL_FAILED_INSUFFICIENT_STORAGE]
Failure [INSTALL_FAILED_INSUFFICIENT_STORAGE]
The "File Manager"application tells me that im using 60/147MB (40%). The limit seems be 147 MB, but in practice, as i have tested, this is not true...
在“文件管理器”应用程序告诉我,即时通讯使用的60 / 147MB(40%)。限制似乎是 147 MB,但实际上,正如我所测试的,这不是真的......
Update:
更新:
I did some testing, and published the results here:
我做了一些测试,并在这里发布了结果:
::Edit::
I never changes the any thing in this answer just update this.
Update size by Developer blogplease refer this link about the updated answer.
::Edit::
我从不更改此答案中的任何内容,只需更新即可。
开发人员博客的更新大小请参阅此链接以了解更新的答案。
回答by Paresh Mayani
Today i came across one point where it is clearly defined that we can upload maximum 50MB sized APK onto the market. So indirectly, we can install an application from a market having maximum 50MB size.
今天,我遇到了一个明确规定,我们可以将最大 50MB 大小的 APK 上传到市场上。因此间接地,我们可以从最大 50MB 大小的市场安装应用程序。
Here is a link: http://www.google.com/support/androidmarket/developer/bin/answer.py?hl=en&answer=113469, here just check the below sentence.
这是一个链接:http: //www.google.com/support/androidmarket/developer/bin/answer.py?hl=en& answer=113469,在这里只需检查下面的句子。
APK file size: Maximum supported size is 50MB.
APK 文件大小:支持的最大大小为 50MB。
So its clear that we can upload maximum 50MB sized APK file, but if we are developing application locally and running/testing for the internal purpose then it is fine.
很明显,我们可以上传最大 50MB 大小的 APK 文件,但是如果我们在本地开发应用程序并出于内部目的运行/测试,那就没问题了。
Update - 6 Mar 2012
更新 - 2012 年 3 月 6 日
Android Apps Break the 50MB Barrier and expanding the Android app size limit to 4GB., check this tutorial.
Android 应用程序打破 50MB 的障碍并将 Android 应用程序大小限制扩展到4GB。请查看本教程。
Update -28 Sep 2015
2015 年 9 月 -28 日更新
The Google Play team (ANDROID DEVELOPER BLOG) ::(GOOGLE) update the max size limit. They are increasing the APK file size limit to 100MBfrom 50MB. This means developers can publish APKs up to 100MB in size,Please refer this link for more information:Google Developer blog
Google Play 团队 (ANDROID DEVELOPER BLOG) ::(GOOGLE) 更新了最大大小限制。他们正在将 APK 文件大小限制从50MB增加到100MB。这意味着开发者可以发布最大 100MB 的 APK,更多信息请参考此链接:Google 开发者博客