请问各位,如何把android默认的安装路径改为储存卡? RT,手机内存不多,如果每次默认安在储存卡就好了 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 设置软件的安装路径到外部存储<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:installLocation="preferExternal" ... > 是的 要API level 8开始才有效 packages/apps/Settings/src/com/android/settings/ApplicationSettings.javaprivate String getAppInstallLocation() { int selectedLocation = Settings.System.getInt(getContentResolver(), // Settings.Secure.DEFAULT_INSTALL_LOCATION, APP_INSTALL_AUTO); Settings.Secure.DEFAULT_INSTALL_LOCATION, APP_INSTALL_SDCARD); if (selectedLocation == APP_INSTALL_DEVICE) { return APP_INSTALL_DEVICE_ID; } else if (selectedLocation == APP_INSTALL_SDCARD) { return APP_INSTALL_SDCARD_ID; } else if (selectedLocation == APP_INSTALL_AUTO) { return APP_INSTALL_AUTO_ID; } else { // Default value, should not happen. return APP_INSTALL_AUTO_ID; } } 2.2以上系统。接上Pc,打开debug模式,敲adb shell pm setInstallLocation 2这样安装软件的时候,默认就会安装到卡上面去了 我用PhoneGap做的项目安装不成功。在虚拟机上能够运行 请问 如何在Android模拟器中 设置时间? NDK开发中使用stl中的hash_map 小妹求解求思路应用启动的帮助引导页。 下载文件时,报socketTimeoutException问题,请高手分析 提高程序性能[android] 摩托罗拉非原生安卓系统2次开发 我想自己做一个拨号软件 为什么linux编译的程序能运行,用ndk编译后的就不能运行了呢 小白求助,Android Stdio报了一个错误无法解决 buildDrawingCache 如何设置成RGB_565? 关于canvas.drawtext()
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:installLocation="preferExternal" ... >
是的 要API level 8开始才有效
int selectedLocation = Settings.System.getInt(getContentResolver(),
// Settings.Secure.DEFAULT_INSTALL_LOCATION, APP_INSTALL_AUTO);
Settings.Secure.DEFAULT_INSTALL_LOCATION, APP_INSTALL_SDCARD);
if (selectedLocation == APP_INSTALL_DEVICE) {
return APP_INSTALL_DEVICE_ID;
} else if (selectedLocation == APP_INSTALL_SDCARD) {
return APP_INSTALL_SDCARD_ID;
} else if (selectedLocation == APP_INSTALL_AUTO) {
return APP_INSTALL_AUTO_ID;
} else {
// Default value, should not happen.
return APP_INSTALL_AUTO_ID;
}
}
这样安装软件的时候,默认就会安装到卡上面去了