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

发布于 2024-12-18 02:34:02 字数 391 浏览 2 评论 0原文

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

当设备通过 USB 连接到计算机时,用户应该 能够使用 Windows 资源管理器将文件拖入和拖出 应用程序目录。

应用程序将使用其中一些文件并生成其他文件 应该能够复制回计算机。

目标设备没有外部存储设备(例如 例如 SD 卡)。

存储文件的目录应该是可访问的 当应用程序运行时。

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

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

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

I am developing an application that has the following requirement:

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.

I've looked into the data storage page in the android documentation, but none of the methods stated there seem to do what I require.

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?

What is the best way to fulfill this requirement?

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

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

发布评论

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

评论(2

空城之時有危險 2024-12-25 02:34:02

当设备通过 USB 连接到计算机时,用户应该能够使用 Windows 资源管理器将文件拖入和拖出应用程序目录。

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

应用程序将使用其中一些文件并生成其他文件,这些文件应该能够复制回计算机。

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

目标设备没有外部存储设备(例如SD卡)。

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

应用程序运行时,应该可以访问存储文件的目录。

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

或者,有没有办法在应用程序运行时选择计算机并通过 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.

If "the application directory" refers to a spot on external storage, this is possible.

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

If this is supposed to happen simultaneously, the device must be running Android 3.x or higher. Android 1.x and 2.x did not support simultaneous access to external storage.

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

It needs to have something designated as "external storage". That does not have to be removable storage. On Android 3.x and 4.x, it is usually just a part of on-board flash that was designated to be accessible as external storage. In Android terms, "external storage" means "can be accessed by a host computer using USB and by all applications on the device as well".

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

Again, this requires Android 3.x or higher. If this is a custom device, that most likely means you are going to need to use the recently-released Android 4.0 source code.

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?

No and no, respectively.

护你周全 2024-12-25 02:34:02

您要做的是使用Environment.getExternalStorageDirectory。即使没有 SD 卡,大多数 Android 设备也会将一部分板载内存分区用作外部存储。

What your going to want to do is use Environment.getExternalStorageDirectory. Even if there is no sd card, most android devices partition a part of the on board memory to be used as external storage.

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