在 Android sdk 2.2 中的 SD 卡上安装应用程序 [英] Installing application on SD-card in Android sdk 2.2

查看:29
本文介绍了在 Android sdk 2.2 中的 SD 卡上安装应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

自过去 2 周以来,我一直面临这个问题并正在寻找解决方案.

I am facing this problem and finding solution for this issue since last 2 weeks.

现在我已经为客户端开发了一个 android 应用程序,其大小为 54 MB,其中只有 52 MB 的图像/照片.

Right now i have developed an android application for the client perpose, whose size is 54 MB, from which 52 MB of only Images/Photos.

所以我想将它安装在 Android SDK 2.2 上的 SD 卡中,因为我已经在 AndroidManifest.xml 文件中设置了 android:installLocation="preferExternal".我在创建 avd 时创建了 256MB sd-card堆大小 - 192ram 大小 - 192

So i want to install it in sd-card on Android SDK 2.2 for that i have already set android:installLocation="preferExternal" in the AndroidManifest.xml file. I have created 256MB sd-card while creating an avd , heap size - 192 , ram size - 192

但它仍然显示一个错误:

but it still showing me an error:

[2010-08-27 17:58:28 - demo_test]上传 demo_test.apk 失败设备模拟器-5554"
[2010-08-2717:58:28 - 演示_测试]java.io.IOException:无法上传文件:设备上没有剩余空间
[2010-08-27 17:58:28 - demo_test]发射取消!

[2010-08-27 17:58:28 - demo_test] Failed to upload demo_test.apk on device 'emulator-5554'
[2010-08-27 17:58:28 - demo_test] java.io.IOException: Unable to upload file: No space left on device
[2010-08-27 17:58:28 - demo_test] Launch canceled!

  1. 这个内存问题是内部存储器还是外部存储器的问题?
  2. 我必须做什么才能运行应用程序并仍然使用模拟器进行测试?
  3. 如何在 Android sdk 2.2 的 sd 卡中安装应用程序?

推荐答案

sd 卡的大小真的是 256MB 吗?有时我会忘记后缀,结果是……一些非常小的东西.

Is the sd-cards size really 256MB? I sometimes forget the suffix and end up with.. something very small.

您也可以随时将大小提高到 512、256,266,然后再试一次以确保它是其他大小.

You can also always raise the sizes to like 512, 256,266 and try again to be certain it's something else.

此外,Logcat 的输出也会很好.

Also, Logcat output would be nice too.

看起来,您不能只是在 SD 卡上安装"应用程序,即使您有 30+Gigabyte 的可用空间.即使在 2.2 中,安装也取决于手机的内存.

As it seems, you cant just "install" the app on the SDcard even if you have 30+Gigabyte free on it. Installation depends also on the internal memory of the phone even in 2.2.

示例:Nexus one 有 512MB 的内部存储器.android 操作系统为相机、gpu、内核等占用了所需的内存,让用户只有大约 190MB 的应用程序空间(由于已经安装了应用程序等,这个空间会更低).

Example: Nexus one has 512mb internal memory. The android os takes the needed ram for the camera, gpu, kernel etc leaving a user with only around 190MB app space (which will be even lower due to apps already installed etc).

另一方面,HTC Hero 的内存只有 288mb,因此它的应用程序大小内存"非常小.

HTC Hero on the other hand has only 288mb internal memory, leaving it with a very small "app size ram".

根据手机的不同,nexus one 上的 90mb 应用程序将安装到 SD 卡上,但由于内存限制,Hero 上不会安装.

Depending on the phone, 90mb app will install to SDcard on nexus one, but won't on Hero due to memory limitations.

您收到该错误的原因是,在 android 操作系统从 192MB 中取出所需的 ram 之后,应用程序大小的 ram"不足以容纳 50+mb 的应用程序.

The reason you are getting that error is that, after the android os takes the needed ram out of those 192MB, the "app size ram" is not enough to hold that 50+mb application.

我以为 installLocation 会直接安装到 SD,但事实并非如此.

I thought that installLocation would install directly to SD, but that is not the case.

Vidar Vestnes 博客 通过在他的 HTC Desire 上使用不同大小的应用程序进行测试,证实了我上面描述的内容.

Vidar Vestnes blog confirmed what I described above by performing a test with different app sizes on his HTC Desire..

这篇关于在 Android sdk 2.2 中的 SD 卡上安装应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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