Install to SD card, How-To Enhance Your Buzztouch App

MySkylla’s Guide to Buzztouch

Modifying the Manifest to allow Installing of your App to the SD card:

Beginning with API Level 8, you can allow your application to be installed on the external storage (for example, the device’s SD card).

The process is simple, open the Manifest in Eclipse, add a line, save the changes, export the .apk.

Using Eclipse find your App’s Package (your Source Code).
You’ll find the AndroidManifest.xml file. Open the file by double clicking.

image

Use the Editor to view the Manifest.

image

You’ll see the following:

package=“com.your_app_name”
      android:versionCode=“1”
      android:versionName=“1.0”>

Add the following:

android:installLocation=”preferExternal”

End Result:

package=“com. your_app_name “
      android:versionCode=“1”
      android:versionName=“1.0”
android:installLocation=“preferExternal”>

Save the changes.

Look at your project in Eclipse.
If you made an Error you’ll see a Red X.

Also note the > make sure it’s at the end of the new line.

If it’s not, you’ll notice the new line is not the same color as the previous lines.

Verification: Go to Manage Applications in your device and take a look as to the App’s installation.

Note, Your options are:

“auto”
“preferExternal”
“internalOnly”

Why you should allow Install to sdcard.

Reason number one:

It’ll free up memory in your device.

Reason number two:

You’ll learn to make changes to the Manifest.

Reason number three:

Many devices have limited memory and find it difficult if not impossible to use apps that don’t allow install to SD card. Plus if you app allows it, you’re showing a skill that most app creators have yet to accomplish.

Reason number four:

INSTALL_FAILED_INSUFFICIENT_STORAGE error is the bane of every Android developer’s life. It happens regardless of app size, or how much storage is available. Rebooting the target device fixes the problem briefly, but it soon comes back. There are hundreds (if not thousands) of message board posts from people asking why the problem occurs, but the folks at Google are frustratingly silent on the issue. There is a simple workaround. If your test device is running Android 2.2 or later then add the android:installLocation attribute to your application’s manifest file, with the value “preferExternal”. This will force the app to be installed on the device’s external storage, such as a phone’s SD card.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s