问题

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

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.

[Edit: I need to keep images in "drawable" folder ]

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]

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!

Edit:

Is this memory related issue of internal memory or external memory?

What i have to do to run application and still test with emulator?

How do i install application in sd-card in Android sdk 2.2?

回答1:

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

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

Also, Logcat output would be nice too.

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

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 on the other hand has only 288mb internal memory, leaving it with a very small "app size ram".

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

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.

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

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

回答2:

A better approach would be to put your resources in their own directory on the SD card. Then your app can load them when it needs.

回答3:

I suggest you try increasing the internal memory available (screenshot says 43MB), in case the .apk is being copied there first before it is installed to the SD card by the OS.

回答4:

Assuming you need the images on your device instead of on the cloud, the easiest way would be to make the app connect to a server of yours and download a zip containing all the images on its first run. Until devices get a larger "app ram size" this might be your only solution.

回答5:

You can use the following:

adb shell pm setInstallLocation 2

from the android-sdk/tools directory to force the emulator to install to your sd card, whatever its size -- preferably large enough to hold your app(s), obviously.

If you want to go back to the default installation location (phone app memory), do:

adb shell pm setInstallLocation 0

You can also use these adb commands on your phone / tablet.

Once you have set up the emulator to install to the sd card, you can then go into Settings --> Applications --> Manage Applications, choose the app you want to be on the sd card, and the "Move to SD Card" button will no longer be grayed out.

回答6:

you can check if the sd card is really mounted and enough space is available by the running

adb shell df

command in the android-sdk/tools directory

it shows you which partitions are currently mounted, how big they are and how much free space is available

来源:https://stackoverflow.com/questions/3584297/installing-application-on-sd-card-in-android-sdk-2-2

card2phone android,Installing application on SD-card in Android sdk 2.2相关推荐

  1. [sqlite] android create db in SD card

    ref http://blog.csdn.net/chtnj/article/details/7838033 一.在手机的/data/data/应用程序包名/ 目录下创建数据库. 如果创建的数据库的大 ...

  2. android 5.1.1 sd卡权限,android - 适用于Android 5.1.1及更高版本的Cordova的外部存储路径(SD卡) - 堆栈内存溢出...

    从Android 5.0开始,外部(可移动)SD的位置不再是固定路径. 而是在路径中使用SD卡的序列号. 例如,在运行Android 7.1.1的Samsung Galaxy S4上,物理外部可移动S ...

  3. 把android系统装到sd卡,在Android系统中将软件安装在SD卡的方法

    这样就可以装上更多自己喜欢的软件了. 在Android手机刚面世的时候,系统版本1.5至后来的2.1都不支持把程序装到SD卡上,由于系统内置的空间较小,装不了太多软件,于是人们 想出App2SD的概念 ...

  4. 如何在android模拟器中模拟sd卡,如何在Android模拟器中模拟SD卡

    如何在Android模拟器中模拟SD卡 简介 Android允许开发者创建一个SD卡镜像并在启动模拟器加载它, 用于模拟物理设备中的SD卡. 下面将介绍: 1. 如何创建一个SD卡镜像? 2. 如何拷 ...

  5. android打开文件管理获取文件名,如何从android中的文件路径获取文件名

    我想从sdcard文件路径获取文件名.例如:/storage/sdcard0/DCIM/Camera/1414240995236.jpg I want get 1414240995236.jpg 我已 ...

  6. android 5.0 模拟sd卡,如何使用为Android5.0(Lolliop)提供的新的SD卡访问API?

    在下面链接的我的Android项目中,您可以找到允许在Android 5中的ExtSDCard上编写的工作代码.它假设用户可以访问整个SD卡,然后允许您在这张卡上随时随地写东西.(如果您只想访问单个文 ...

  7. Android采用Application总结一下

    什么是 Application Application和Activity,Service由于是android框架的一个系统组件,当android程序启动时系统会创建一个 application对象.用 ...

  8. Android使用Application总结

    对于application的使用,一般是 在Android源码中对他的描述是; * Base class for those who need to maintain global applicati ...

  9. android 无法显示SD卡目录,Android studio无法在SD卡上创建新目录?

    我使用名为scanlibrary的库来扫描照片,然后将它传递给tess-two来执行OCR过程.问题是,在目录"ScanDemoExample"不被创建因此tessdata文件不会 ...

最新文章

  1. Linux命令中21个不太好搜索其含义的特殊符号你都知道吗?
  2. Python:判定IP地址合法性的三种方法
  3. uboot启动 及命令分析(3)
  4. python sorted下标_Python学习教程(Python学习路线):第七天-字符串和常用数据结构
  5. 【Linux】Linux查看机器负载-CPU负载 CPU使用率达到100%
  6. 解决 github clone慢
  7. Bailian2685 打印水仙花数【进制+宏定义】
  8. C/C++ 内存四区模型
  9. linux脚本运行出现bc,Linux硬件管理命令---bc
  10. 金蝶K3 Wise单据导入导出工具使用说明
  11. 网络新文化现象:newbilitynbsp;(不代表…
  12. w3c标准的深入理解
  13. 【优化】共轭函数(Conjugate Function)超简说明
  14. M8系统开发手记(2)
  15. Origin设置线条颜色和符号颜色一致
  16. 你还不知道什么是市场占有率?
  17. 关于Qt翻译在Vs编辑器上面出现乱码问题
  18. 使用top做sql分页
  19. 【Android取证篇】Android设备USB调试打开方式(开发者模式)
  20. Python爬虫入门教程 50-100 Python3爬虫爬取 m3u8 视频-Python爬虫6操作

热门文章

  1. css实现圆形钟表,js+css3圆形指针时钟代码
  2. java 自定义 operator_java8 自定义Collector
  3. kettle预览点两下才出数_孩子过生日选“阴历”还是“阳历”?有3点讲究,需斟酌再决定...
  4. 用TensorFlow训练第一个模型
  5. 吉林大学计算机科学与技术学院推免,2017吉林大学计算机科学与技术大学生推免夏令营...
  6. [CentOS7] 常用工具 之 差异备份工具 rdiff-backup
  7. 网络对抗技术 实验报告 三
  8. Thinkphp框架中D()和M()的区别
  9. 使用sql语句,查询 mysql 的安装地址
  10. JAVA-封装-静态属性