views:

94

answers:

1

Hi all,

I want to transfer a file into android dev's SD memory and read the file for parsing it. But i don't know how to transfer a file into the emulators SD Card.

Also I don't know which api is to be used to browse for the file from the application. This app provides the user to show it where he has kept the file which the app has to parse. Which api does android provide for file management using a UI.

Please help. Thanks in advance.

+1  A: 

Steps to push the file into Adroid Emulator SDcard in eclipse.

  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

Shell commands to push and pull files from/to SDcard

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

To read the file programatically you use

import java.io.File

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

Vinayak.B
Vinayak Thanks for the help... but about files this code helps to get a file whose path is know while the prog is written. But here i want to give user the option to select his file from a the devices memory...? what can i do here...?
Sumit M Asok
Have a look at this for the file browserhttp://www.anddev.org/building_an_android_filebrowser_list-based_-t67.html
Vinayak.B
Sad android don't have one in build like it has Intent to contacts
Sumit M Asok