gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-11-30 04:53:13 26 4
gpt4 key购买 nike

我想将文件传输到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/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com