指定安装应用程序移至SD卡(App2SD)

指定安装应用程序移至SD卡(App2SD)在2.2发布之后,除了增加FlashPlayer的支持外,最令人瞩目的莫过于ApptoSdcard的支持了。至此之前,android应用程序仅能安装于手机内存,而在“有限”的资源下,至多能安装50-100套程序。1.Intenti=newIntent("android.int

大家好,欢迎来到IT知识分享网。指定安装应用程序移至SD卡(App2SD)"

在2.2发布之后,除了增加Flash Player的支持外,最令人瞩目的莫过于App to Sdcard的支持了。至此之前,android应用程序仅能安装于手机内存,而在“有限”的资源下,至多能安装50-100套程序。    

1.Intent i = new Intent(“android.intent.action.MANAGE_PACKAGE_STORAGE”);

  startActivity(i);

2.

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.spinner"
    android:versionCode="1"
    android:installLocation="preferExternal"
    android:versionName="1.0" >

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

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

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

</manifest>

a.android:installLocation=”preferExternal”   //如API小于8,那系统无法识别

b.android:installLocation=”auto”               //只说下这个把,其他2个就不说了。默认安装在内存里,如果发现手机内存偏低,且内存卡也存在,则由系统决定安装的位置。

c.android:installLocation=”internalOnly”

免责声明:本站所有文章内容,图片,视频等均是来源于用户投稿和互联网及文摘转载整编而成,不代表本站观点,不承担相关法律责任。其著作权各归其原作者或其出版社所有。如发现本站有涉嫌抄袭侵权/违法违规的内容,侵犯到您的权益,请在线联系站长,一经查实,本站将立刻删除。 本文来自网络,若有侵权,请联系删除,如若转载,请注明出处:https://yundeesoft.com/33638.html

(0)

相关推荐

发表回复

您的电子邮箱地址不会被公开。 必填项已用 * 标注

关注微信