Installing an application on an external storage
As we have discussed in Chapter 4, Defining the Application's Policy File, starting with API level 8, applications can choose to be installed on the SD card. Once the APK is moved to external storage, the only memory taken up by the app is private data of applications stored on the internal memory. It is important to note that even for SD card resident APKs, the DEX (Dalvik Executable) files, private data directories, and native shared libraries remain on the internal storage.
Adding an optional attribute in the manifest file enables this feature. The Application Info screen for such an application either has a Move to SD card or Move to Phone button, depending on the current storage location of APK. The user then has an option to move the APK file accordingly. If the external device is un-mounted or the USB mode is set to Mass Storage (where the device is used as a disk drive), all the running Activities and Services hosted on that external...