Email me Call me on Skype RSS feed Twitter Facebook Last.fm Spotify Flickr Steam  Github

Moving apps from the Android phone memory to SD card: HTC Desire

Sat, 03/03/2012 - 11:59 -- Morgan

 

So I've had my HTC Desire now for approxmately 2 years now and whilst it has served me well I've had a bug bear with it for a long time. Essentially the phone has only 148 MB of internal storage and after the basic Android OS has been installed this is reduced to under 134 MB. Now I knew that this phone didnt have much memory when I bought it, and as a result when I bought the phone I bought it with a 16 GB microSD card.

-wikipedia.org

However, there are a lot of apps that dont like to play if they're installed to the SD card. And it doesnt take too many apps such as Google+ (at over 20 MB) and suddenly you cant update any apps through a lack of phone space due to apps being downloaded to phone memory before being moved.

Eventually I've got completely sick of this and as I have my phone rooted and running Cyanogenmod I thought I'd use some basic Linux file system trickery to move all apps to the SD card but set some symbolic links in the link file system so that the apps still think they're on phone memory.

So, here's what I've done. This isnt for the faint of heart and if you're worried either dont bother or backup your phone first. All apps you can redownload for free from the Android Market in any case, but I'm not going to take responsibility for your actions.

So open the Terminal Emulator program, and then give it super user permissions so we can access and change core Android.

su

A message prompt should appear saying that the Terminal Emulator has been given super user permissions, if you havent done it before then you need to Allow access. Remember that Android (and linux) is case sensitive

cp -rv /data/data /sdcard/Android

The -rv flag means; r to copy recursively (ie every folder), and v to show us in the terminal every file that is copied. We could copy to any folder on the SD card but I've stuck it into the folder where apps are stored when you send them to the SD card anyway.

With the files copied across we can now remove the old ones (we could have used the mv command but I was prefer a copy and remove, it's a bit safer)

rm -r /data/data

Then we need to link the new location back to the old with a symbolic link

ln -s /sdcard/Android/data /data/data

Sorted! This should have now cleared up an awful lot of space. But if space is still an issue we can move the Dalvik cache. The Dalvik cache is the cache for Dalvik, which doesnt help much unless you know that Dalvik is the Java virtual machine for Android, so the Dalvik cache is basically the space where all the program information gets dumped whilst it's running.

To do this is pretty simple too, following the above:

cp -r /data/dalvik-cache /sdcard/Android

rm -r /data/dalvik-cache

ln -s /sdcard/Android/dalvik-cache /data/dalvik-cache

Obivously, the problem with this is that you can now, never remove your SD card without having to move these back to the phone.

Also note that your apps will take a second or two to start the first time after the move as it rebuilds the cache.

 


Update: After doing a restart (as the battery ran flat), I ran into a huge number of problems with apps not responding; most annoying the keyboard restarting every 10 seconds.

Poking around online I came across a few things. For those not wanting to risk experimental builds then there is a fantastic resource here for managing your apps onto SD. However, newer builds of Android, namely those with an ICS flare have automated memory management by partitioning off part of the SD card to apps so that the root system seems the partition as part of phone memory.

So with a quick flash to Ice Cream Sandwich using a Cyanogenmod 9 beta and everything is hunky-dorey

 

Comments

<p>With Cyanogenmod installed, you can go into the &quot;Manage Applications&quot; app, select an app, and then hit the &quot;Move to SD Card&quot; button.</p>

Morgan's picture
Submitted by Morgan on

You can....but....

Not all apps will move, especially those with widgets. Widgets for some unknown reason wont run from SD card. And the other major problem I've been having is that to update anything the entire app is downloaded to phone memory and then transfered to the SD card, replacing the old one.

What this means in reality is I cant use the "Update all" button in the market. I have to manually download one, let it install, move to SD card before I can update the next.

Add new comment

Latest posts

...is the ability that every day provides the opportunity,...
3 weeks 2 days ago
MISHAP is yet to be made available for general release...
1 month 3 days ago
Faced with fitting well over 30 experiments at room and low...
3 months 1 week ago
  It has been some time since my last blog post, but this...
4 months 3 weeks ago
E2AF or "EPR 2 ASCII folder" is a folder version of E2A,...
6 months 3 weeks ago

Latest comments