How Do I Copy Apps to my SD Card?
by Android Tapp
Nov 30, 2008 5:08 PM –
All over the web you’ll find a variation of this question for installing Android Apps on the SD Card of the T-Mobile G1:
How Do I Copy Apps to my SD Card?
Applications on SD Cards?
Saving apps to SD Card?
How do I backup Android Apps to SD Card?
Where do Android Apps install?
I spoke with Konrad Hübner of Skycoders, the dudes who brought you Cab4Me, to help answer this question.
Android apps are installed on the internal memory and there is nothing you can do against it. This is part of the security concept. Each app or more precisely all apps signed with the same developer certificate run in the context of the same Linux user and get file access through that user. There are user and group ids generated whenever you install an app. All data of the app, also created files, get the user and group assigned and thus can only be accessed by the app itself. In addition, each app (identified through its package) runs in its own Dalvik VM sandbox.
If you put apps on the SD card, this security concept (file access) is broken. That is why you have no choice. The described concept is only a part of the entire security concept, but it is the one responsible for not being able to install apps outside the internal memory.
The problem with the G1 is that the internal memory is much too small to install all the apps you might want to have. This is killing half of the Market right because of that “I need to uninstall” thing.
-Konrad
UPDATE
Bratman asked an interesting question in the comments about a software hack to get around this. We posed the question to some top Android app developers, here’s some of their responses:
Well, yes, due to the security model, you can’t change where the app is installed. But if your app is that large I’m sure whatever data makes it so bulky can be stored onto the SD card. The problem is that that data can’t be embedded into the apk. You’d have to download (or side-load) or something. An example of this model is the music player.
Rylan Barnes of Big in Japan (ShopSavvy)
I would expect that you can cheat the system by using symbolic links and moving the software to a different mount. This mainly requires root access (so this is where you need to hack the phone which most users probably do not do, at least the standard users) and support for symbolic links on the phone. As the entire security system works based on linux user rights and user accounts. I have no idea if this would really work. It might be a chance, but it is a quite tough hack.
Konrad Hübner (Cab4Me Lite)
As a short follow-up:
I played around a bit. With a standard formatted SD card it does not work. I copied the .apk file from the internal memory to the sd card and created a symbolic link. The phone then told me that the app is not installed. Maybe the sd card needs to be formatted with a linux file system and not the default FAT. So the first try failed. For that I even had to change the permissions on the file system to get the apk file off the phone as the mv command did not work (cross-device link error).
So it looks like this might need more work.
Cheers,
Konrad Hübner (Cab4Me Lite)
No software hack will work until Google itself adds it to the Android platform, which will take some time. To deal with the space issue on internal memory what we will be doing with the premium version of PicSay is to move all of the user data to the SD card. But the application itself needs to be on internal memory. [More can be found here: http://groups.google.com/group/android-platform]
Eric Wijngaard (PicSay)
Sorry peeps… looks like either we won’t have it for a while (maybe OTA update) or the G1 won’t get it at all…