android - 在哪里可以创建对 Windows 资源管理器和我的 Android 应用程序可见的目录?

标签 android filesystems file-permissions data-storage

我正在开发具有以下要求的应用程序:

When the device is connected to a computer via USB, the user should be able to use Windows Explorer to drag files into and out of the application directory.

The application will consume some of these files and produces others which should be able to be copied back to the computer.

The target device does not have an external storage device (for example an SD Card).

The directories that the files will be stored in should be accessible whilst the application is running.

我查看了 android 文档中的数据存储页面,但那里提到的方法似乎都不能满足我的要求。

或者,有没有办法在应用程序运行时选择计算机并通过 USB“发送”文件到计算机? “接收”文件怎么样?

满足此要求的最佳方法是什么?

最佳答案

When the device is connected to a computer via USB, the user should be able to use Windows Explorer to drag files into and out of the application directory.

如果“应用程序目录”指的是外部存储上的某个位置,这是可能的。

The application will consume some of these files and produces others which should be able to be copied back to the computer.

如果这应该同时发生,则设备必须运行 Android 3.x 或更高版本。 Android 1.x 和 2.x 不支持同时访问外部存储。

The target device does not have an external storage device (for example an SD Card).

它需要有指定为“外部存储”的东西。这不一定是可移动 存储。在 Android 3.x 和 4.x 上,它通常只是板载闪存的一部分,被指定为可作为外部存储访问。在 Android 术语中,“外部存储”是指“可以由主机使用 USB 访问,也可以由设备上的所有应用程序访问”。

The directories that the files will be stored in should be accessible whilst the application is running.

同样,这需要 Android 3.x 或更高版本。如果这是自定义设备,则很可能意味着您将需要使用最近发布的 Android 4.0 源代码。

Alternatively, is there a way to select the computer when the application is running and 'send' files via USB to the computer? How about for 'receiving' files?

分别没有和没有。

关于android - 在哪里可以创建对 Windows 资源管理器和我的 Android 应用程序可见的目录?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8290475/

相关文章:

android - 在 Android 中通过 Content Provider 提供图像

linux - 我可以授予 Linux 用户与其他用户完全相同的权限吗?

windows - 所有 Windows 用户都可以编辑的建议文件位置?

php - 托管在 Linux 服务器上的文件需要什么文件权限?

android - 如何使用 adjustResize 去除屏幕顶部的白条

java - 我可以在 HTML 中插入一些代码来设置 Android 壁纸吗

android - 两个或多个具有相同优先级的 BroadcastReceivers

vb6 - 如何确定路径是vb6中的文件还是目录?

android - macOS 上的 Android 模拟器文件结构在哪里?

windows - ctime, mtime, holding directory, windows, linux