简体   繁体   English

在 android 中,如何获取所有已安装的外部 memory 的列表

[英]In android how can I get a list of all external memory installed

I am developing an android application and for creating an directory on sdcard I have used the method我正在开发一个 android 应用程序并在 sdcard 上创建目录我使用了该方法

File myMedia = new File(Environment.getExternalStorageDirectory(),"MySaveCellData");

But this is creating the directory MYSaveCellData in to the internal memory.但这是在内部 memory 中创建目录 MYSaveCellData。 However, this phone has a an internal memory of 8 GB and has a 16 GB external card.但是,这款手机有一个 8 GB 的内部 memory 和一个 16 GB 的外部卡。

In normal phones its creating directory on external disk.在普通手机中,它在外部磁盘上创建目录。

Let me know the solution.让我知道解决方案。

I am finding a way to get a list of all external drive installed on a android phone.我正在寻找一种方法来获取安装在 android 手机上的所有外部驱动器的列表。

In normal phones its creating directory on external disk.在普通手机中,它在外部磁盘上创建目录。

Not for all "normal phones".不适用于所有“普通手机”。 Some phones do not have "external disk" in the form of an SD card.有些手机没有 SD 卡形式的“外置磁盘”。

Let me know the solution.让我知道解决方案。

There is no "solution".没有“解决方案”。 It is up to the device manufacturer to determine what is "external storage" for their device.由设备制造商决定什么是他们设备的“外部存储”。 If they choose to make it be on-board flash instead of an SD card, that is their choice.如果他们选择使其成为板载 flash 而不是 SD 卡,那是他们的选择。

I am finding a way to get a list of all external drive installed on a android phone.我正在寻找一种方法来获取安装在 android 手机上的所有外部驱动器的列表。

Android has exactly one "external drive", referred to as "external storage". Android只有一个“外置驱动器”,简称“外置存储”。 If a device manufacturer supports both an on-board flash area as "external storage" and a SD card, Android will not know about the SD card.如果设备制造商同时支持板载 flash 区域作为“外部存储”和 SD 卡,则 Android 将不知道 SD 卡。

SDK developers should simply use external storage, as your code does. SDK 开发人员应该像您的代码一样简单地使用外部存储。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何在Android中获取所有内存路径(内部或外部内存)列表 - How to Get All Memory Path (Internal or External Memory) list in android 如何使用 kotlin 语言在我的 android 应用程序中获取所有已安装的应用程序列表? - How can i get all installed applications list in my android app using kotlin language? 如何获取所有已安装应用的列表? - How can I get a list of all installed apps? 如何获取Android设备的已安装外部存储列表 - How can I get the list of mounted external storage of android device 如何获取Android设备中所有已安装应用程序的apk列表 - How to get list of apk of all installed app in android device Android 4.4:如何获取所有已安装打印机的列表? - Android 4.4: How to get a list of all installed printers? 如何获取安装在Android设备中的所有用户CA证书的列表? - How to get list of all user CA certificates installed in an Android Device? 如何获取Android手机上安装的所有白日梦的列表 - How to get list of all daydreams installed on android phone 如何获取android中主屏幕Launcher中找到的所有已安装快捷方式的列表 - How to get the list of all installed shortcuts found in the homescreen Launcher in android 如何获取手机上安装的所有输入法(及其名称)的列表? - How can I get a list of all the Input Methods (and their names) that are installed on the phone?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM