Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Installing application on SD-card in Android sdk 2.2

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:

alt text

  1. Is this memory related issue of internal memory or external memory?
  2. What i have to do to run application and still test with emulator?
  3. How do i install application in sd-card in Android sdk 2.2?
like image 543
Paresh Mayani Avatar asked Aug 27 '10 12:08

Paresh Mayani


People also ask

How do I set my apps to automatically install on my SD card?

They usually have limited internal storage, so larger apps have to be installed on the SD card. From the Home screen, Tap Settings > Navigate and Tap Storage > Check to turn on the SD card, and set the SD card as the default storage place.

Can you put apps on SD card?

To move apps to the memory cardFrom your Home screen, tap the Application screen icon. Find and tap Settings > Apps. Tap the On SD card tab. Select application, then tap Move to SD card.


2 Answers

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

like image 116
Milan Avatar answered Oct 25 '22 14:10

Milan


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.

like image 27
Daniel Avatar answered Oct 25 '22 13:10

Daniel