Appcelerator Blog

The Leading Resource for All Things Mobile

Installing Android apps to the SD card

0 Flares 0 Flares ×

Editor’s note: This blog post is a basic tutorial, a more update version of this tutorial is always available on the wiki.

Your Android apps are installed by default to the device’s internal storage. But that limited space can fill quickly, especially on older devices like my Motorola Droid original. Fortunately, you can configure your Titanium apps to install to the SD card.

To do so, you need to modify the AndroidManifest.xml configuration file. Titanium makes this easy: you simply update your tiapp.xml file and Studio will take care of creating the necessary manifest file. Locate the <android> node near the end of that file. You’ll need to add a couple of properties and tags. When you’re done, it should look like this:

[gist id=1105296]

Build and deploy your app to a device. As the screenshot shows, your app should be installed to the SD card (though that’s not guaranteed, read on).

Let’s go over that code, because you can control a few options. First, the <tool-api-level> node specifies the version of the Android development tools that will be used to compile your app’s code. At minimum, you must specify version 8. Higher (newer) versions aren’t necessary for installing to the SD card, but perhaps offer other benefits.

Next, is the <manifest> node and the android:installLocation property. You’d choose one of these values for that property:

  • android:installLocation="preferExternal" — specifies that you prefer your app to install to the SD card, but if one isn’t present the app can be installed to internal storage.
  • android:installLocation="auto" — specifies that the phone’s configuration will determine the installation location. Generally, your app will be installed to internal storage if sufficient space is available. In that case, users could still move your app by opening Settings > Applications > Manage applications, tapping your app, and tapping Move to SD card.
  • android:installLocation="internalOnly" — which specifies that your app cannot be installed to the SD card. See the Android docs for the various reasons why you might choose this option.

Finally, you need to add the <uses-sdk> tag within the <manifest> node. This tag specifies that your app requires Google’s version 7 or newer APIs — in other words, the phone must be running Android 2.1 Update 1 or newer. That pretty much covers all the newer phones, but will exclude some older devices. On those phones, your app will install to the internal storage.

Keep in mind that even if your app is installed to the SD card, application data (such as your database) will still be stored on the device. For more details, visit this Android docs page.

0 Flares Twitter 0 Facebook 0 Google+ 0 LinkedIn 0 Email -- 0 Flares ×


  1. BrianC

    Hi Tim:
    this is important.many customers need this to testing on android devices with limited space. ex: HTC Desire, we have mentioned it in our blog.

  2. Olaf

    Very helpful article…Tnx!!!

    I think that it’s a recursive problem. All my problem were fixed adding the line:


    just after the line:


    in AndriodManifest.xml file.

    Thank you TIM.

  3. My mobile apps not installed for externalsd card install in phone storage solution this problem and send soulotion for me

Comments are closed.

Sign up for updates!

Become a mobile leader. Take the first step to scale mobile innovation throughout your enterprise.
Get in touch
computer and tablet showing Appcelerator software
Start free, grow from there.
0 Flares Twitter 0 Facebook 0 Google+ 0 LinkedIn 0 Email -- 0 Flares ×