Android - 应用程序 (apk) 最大大小 [英] Android - Application (apk) Maximum size

查看:27
本文介绍了Android - 应用程序 (apk) 最大大小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我打算在我的安卓手机上安装第一个应用程序,但有一些疑问与 Android 内存相关(APK 的最大大小).

I am going to install first application in my android phone, but having some doubts related to Android Memory (Maximum size of APK).

所以请帮助我了解并解决问题:

So please help me know and solve the problems:

  1. android可以支持的apk的最大大小是多少?
  2. 当我们在真机上安装任何 apk 文件时,应用程序安装在哪里(在 SD 卡或其他内存中)??
  1. What is maximum size of the apk that can be supported by the android ?
  2. When we install any apk file in real phone, where does application installed (in SD-card or other memory) ??

我参考了这个链接:http://groups.google.com/group/android-developers/browse_thread/thread/7965885da4d1a03a 并搜索了很多.

I have referred this link: http://groups.google.com/group/android-developers/browse_thread/thread/7965885da4d1a03a and also searched lot.

我在网上搜索到很多人都面临同样的问题 Android 支持的应用程序的最大大小是多少.我认为这个问题对 Android 应用程序编程和开发相关的人也有帮助.

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.

更新:

这次我从 52.5MB 图像中获得 58Mb 应用程序,它在我的 HTC Hero 手机上运行,​​但在模拟器上,它显示一个错误:

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:

Failed to upload my_application.apk on device 'emulator-5554'
java.io.IOException: Unable to upload file: No space left on device
Launch canceled!

现在请建议我将图像存储在 Drawable 文件夹中的方法?有没有办法压缩图片或类似的方法?

Now please suggest me the way to store images inside the Drawable folder? is there any way to zip the images or such method?

推荐答案

  1. 它可能是特定于设备的,因为设备具有不同数量的可用内存供应用程序使用.参考 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 中定义.它支持值 internalOnlypreferExternalauto.但同样,仅在 Android 2.2 上受支持.参考 https://developer.android.com/about/versions/android-2.2.html

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 values internalOnly, preferExternal or auto. But again, only supported on Android 2.2. ref https://developer.android.com/about/versions/android-2.2.html

我在内存超过 500 MB 的 HTC Desire 上进行了测试.几乎没有安装任何应用程序,我可以安装一个 43MB 的 apk,但是 57MB 的 apk 太大了,即使我有足够的可用内存......它失败了

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

失败 [INSTALL_FAILED_INSUFFICIENT_STORAGE]

"文件Manager" 应用程序告诉我,我使用的是 60/147MB (40%).限制似乎是 147 MB​​,但实际上,正如我所测试的,这不是真的...

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...

更新:

我做了一些测试,并发布了结果此处:

I did some testing, and published the results here:

:::
我从不更改此答案中的任何内容,只需更新即可.更新大小来自开发者博客,请参阅此链接了解更新后的答案.

:::
I never changes the any thing in this answer just update this. Update size by Developer blog please refer this link about the updated answer.

这篇关于Android - 应用程序 (apk) 最大大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆