Android Move Application To SDCard

In this tutorial you will learn how to allow users that don’t have a huge amount of internal memory to move your Android application into an external SD Card storage. Unfortunately, the ability to install on the external storage is a feature available only on devices running API Level 8 (Android 2.2) or greater. When your application is installed on a device with an API Level lower than 8, the “android: installLocation” attribute is ignored. So lets begin…

Create a new project in Eclipse File > New > Android Application Project. Fill in the details and name your project MovetoSDTutorial.

Application Name : MovetoSDTutorial

Project Name : MovetoSDTutorial

Package Name : com.androidbegin.movetosdtutorial

Open your AndroidManifest.xml, and paste the following code.

AndroidManifest.xml

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.androidbegin.movetosdtutorial"
    android:versionCode="1"
    android:versionName="1.0"
    android:installLocation="auto" >

    <uses-sdk
        android:minSdkVersion="8"
        android:targetSdkVersion="15" />

    <application
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        android:theme="@style/AppTheme" >
        <activity
            android:name=".MainActivity"
            android:label="@string/title_activity_main" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
    </application>

</manifest>

Steps to Move Application to External SD Card.

STEP 1 

Select Settings.

MovetoSD Setting

STEP 2

Scroll down and locate Applications.

MovetoSD Application

STEP 3

In your Downloaded tab, locate the application named MovetoSDTutorial. 

MovetoSD Select

STEP 4

Tap on Move to SD card to move application to external storage.

MovetoSD Move

Try changing android: installLocation=”auto” to android: installLocation=”preferExternal” in your AndroidManifest.xml. If you declare “preferExternal”, you requested that your application to be installed on the external storage, but the system does not guarantee that your application will be installed on the external storage. If the external storage is full, the system will automatically install it on the internal storage. By doing this, the user has the option to move your application between the two locations.

Source Code 

[purchase_link id=”7870″ text=”Purchase to Download Source Code” style=”button” color=”green”]