如何让用户选择Android应用程序的安装位置(SD卡或内部存储) [英] How to allow users to select the Android app's installation location (SD card or internal storage)

查看:208
本文介绍了如何让用户选择Android应用程序的安装位置(SD卡或内部存储)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要让用户选择的应用是否应安装到SD卡或内部存储器。我找不到在 developer.android.com 有关的任​​何信息。

I need to allow a user to select whether the app should be installed to an SD card or the internal memory. I cannot find any information about that at developer.android.com.

我能做的唯一一件事就是指定安卓的installLocation 为internalOnly,自动或preferExternal。不过,我想,让用户选择要安装的应用程序时。

The only thing I can do is to specify android:installLocation as "internalOnly", "auto", or "preferExternal". However, I'd like to let users choose that when the app is being installed.

是否有可能做到这一点在Android?

Is it possible to do that on Android?

推荐答案

不幸的是,这是不可能明确地让用户选择安装您的应用程序

它的安装之前,您的应用程序无法运行,所以你不能在那个时候运行任何code。

Before it's installed, your app can't run so you can't run any code at that time.

选项你提到:internalOnly,自动和preferExternal只选项

Options you mention: "internalOnly", "auto" and "preferExternal" are only options.

从个人的经验,我建议你,除非你有一些限制,迫使你用internalOnly使用自动。

From personal experience, I recommend you to use "auto" unless you have some restrictions that force you to use "internalOnly".

preferExternal可以产生一些旧设备错误(无法打开SD卡的或类似的东西,我记不清了)。

"preferExternal" can produce errors on some older devices ("can't open SD card" or something like that, I can't remember).

这篇关于如何让用户选择Android应用程序的安装位置(SD卡或内部存储)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆