Android 在应用程序首次初始化时选择安装存储

发布于 2024-12-15 03:42:59 字数 205 浏览 1 评论 0原文

我正在开发应用程序,我对一件事感到好奇:有什么方法可以检测手机中的所有可用存储空间,并让用户选择在第一次启动时安装应用程序的位置。例如:

  1. 用户启动应用程序并检测:内部存储 - 150MB 免费,SD 卡 - 2GB 免费
  2. 如果用户选择 SD 卡/内部存储应用程序正在所选设备上安装。

提前致谢!

I'm working on application and I'm curious about one thing : Is there any way I can detect all available storages in phone and let the user select where to install the application on first start. For example :

  1. User start application and it's detecting : Internal Storage - 150MB free, SD Card - 2GB free
  2. If user select SD Card / Internal Storage application is installing on selected device.

Thanks in advance!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

枕花眠 2024-12-22 03:42:59

听起来有些奇怪,启动应用程序后,用户选择在哪里安装应用程序?

你不能,因为要启动应用程序,你的应用程序需要安装在设备上,而你只能做清单中提到的一件事,

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
         ...
          android:installLocation=["auto" | "internalOnly" | "preferExternal"] >
    . . .
</manifest>

编辑:

首选“自动”应用程序可能安装在外部存储上,但系统默认会将应用程序安装在内部存储上。如果内部存储已满,则系统会将其安装到外部存储上。安装后,用户可以通过系统设置将应用程序移动到内部或外部存储。

Sound some strange, After starting application user make a choice where to install application?

You can't, because for starting application your application need to install on device and you can do only one thing is mentioned in manifest,

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
         ...
          android:installLocation=["auto" | "internalOnly" | "preferExternal"] >
    . . .
</manifest>

EDIT:

Prefer "auto" The application may be installed on the external storage, but the system will install the application on the internal storage by default. If the internal storage is full, then the system will install it on the external storage. Once installed, the user can move the application to either internal or external storage through the system settings.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文