App2sd is a new feature supported by android2.2 (frozen yogurt ).ProgramInstall it on the memory card and only keep some necessary files in the phone memory (ROM.
To support this feature in your own program, you need to set build target to 2.2 (or higher) when creating a project ):
Note: Although 2.2 is specified here, it does not mean that our program will only run in systems above 2.2. the min SDK version below can set the lowest compatible API level, if it is set to 4, it can be compatible with the lowest version 1.6.
During development, be careful not to use APIs not available in version 1.6 to ensure compatibility. After real-machine testing, users of lower-version systems will not notice any exceptions during installation and use.
(To avoid using incompatible APIs accidentally, we recommend that you modify the build target attribute after project development. You can right-click the project and select the properties menu item, in the settings window, select the android item on the left and then set the build target on the right .)
The next step is to open the androidmanifest. xml file of the program. You may see the following warning on the left side:
This simply means that our build target and Min SDK version are not uniform, so we don't need to worry about it.
We add attributes to the manifest element:
Android: installlocation="Preferexternal"
After adding it, it looks like this:
Then compile and release the APK. During installation, the program will be automatically mounted to the memory card.
If the above property value is set to Auto, the program will automatically determine the installation location based on the memory (ROM) Capacity of the mobile phone, and the user can manually change the installation location after installation.
after testing, a kb program occupies KB of mobile phone memory (ROM) after installation .; A masterpiece like Angry Birds, 14.1 MB, occupies 1.89 MB of mobile phone memory (ROM) after installation.