android - 如何从android内存中选择一个文件对其进行一些操作

标签 android file file-upload

我想将文件传输到android dev的SD内存中并读取文件进行解析。 但是我不知道如何将文件传输到模拟器的 SD 卡中。

我也不知道要使用哪个 api 从应用程序中浏览文件。 这个应用程序让用户可以显示他保存应用程序必须解析的文件的位置。 android提供了哪些api来使用UI进行文件管理。

请帮忙。 提前致谢。

最佳答案

在eclipse中将文件推送到Adroid Emulator SDcard的步骤。

  1. Click on the DDMS tab on the right top corner of the eclipse IDE
  2. Go to File Explore in it, if not there the Windows->Show View->File Explorer
  3. Click on the SDCard in the file explorer
  4. On the top of the File Explorer there are 2 Arrows(Right direction and Left Direction) To put the file into the SD card press the right direction arrow, browse the location
    where the file is located click Ok, To pull the file back from the SDcard click on the
    file to be pulled the click on the left direction arrow

向 SD 卡推送和拉取文件的 Shell 命令

device commands:

adb push <local> <remote>    - copy file/dir to device

adb pull <remote> <local>    - copy file/dir from device

Push sends a file from your desktop computer to your Android device:

adb push test.txt /sdcard/test.txt

Pull pulls a file from your Android device to your desktop computer:

adb pull /sdcard/test.txt test.txt

以编程方式读取文件 使用

import java.io.File

File lObjFile = new File("sdcard/fileName.ext");

关于android - 如何从android内存中选择一个文件对其进行一些操作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2264042/

相关文章:

android - 尝试通过单击按钮更改 textView 中的文本大小时应用程序崩溃

android - 如果条件在 onClick() 中不起作用

java - 如何将文件写入目录?

javascript - 是否可以在没有 ajax 的情况下在普通文件上传中显示进度条?

c# - 上传文件 winForms C#

android - 构建android源代码时出错

android - EditText 在提供的照片中为该指针使用颜色强调

python - 在 openpyxl 中关闭文件

java - 在 struts 2 中上传文件会产生扩展名为 .tmp 的文件

docker - 本地文件传输到 Kubernetes Persistent Volume?