简体   繁体   English

如何在带有Android的设备中创建新文件夹?

[英]How to create a new folder in a device with android?

我想在设备的根目录中创建一个新文件夹,但我无法:(我想如何转到设备的根目录并创建一个新文件夹,例如,我的设备的字母为G:/我想在“ G:/ new folder”中创建文件很抱歉,起草不力

In my understanding, you can't just go to the root dir of your device and create it programmatically in your app, since the app is running as a separate user which doesn't have those privileges. 以我的理解,您不能只是转到设备的根目录并在应用程序中以编程方式创建它,因为该应用程序是作为没有这些特权的单独用户运行的。 Moreover, I doubt you can do it as a simple user manually on your phone, because you are not root either. 此外,我怀疑您是否可以以简单的用户身份在手机上手动进行操作,因为您也不是root用户。 (I am not even talking about hardcoding letter of the disk partition) (我什至没有在谈论磁盘分区的硬编码字母)

The main question here is I guess why you would need that folder. 这里的主要问题是我想为什么您需要该文件夹。 If it is for app purpose, then, you should look at this documentation: 如果是出于应用目的,那么您应该查看以下文档:

http://developer.android.com/guide/topics/data/data-storage.html http://developer.android.com/guide/topics/data/data-storage.html

It has pretty much all described starting from storage on your server ending with preference files. 它几乎所有描述都是从服务器上的存储开始,以首选项文件结束。

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM