tags:

views:

27

answers:

2

Hi, I have a file stored in /data/data/com.sai.myproj/files/a.txt .This is the file I created and wrote data, it was stored in data/data/com.sai.myproj/files/a.txt which can be viewed using FileExplorer of DDMS. How to copy this file from there to res folder as I need to parse this file .

Can anyone help me in sorting out this issue.

Thanks in Advance,

A: 

You can use adb pull on your computer:

adb pull /data/data/com.sai.myproj/files/a.txt your-project-location/res

Adb is located in android-sdk/tools.

Peter Knego
Is there any possibility to do this trough code rather than going to command prompt to copy that file ,becoz it has to be done dynamically for me.
Android_programmer_camera
# adb pull /data/data/com.sai.fileHandling/files/public.xml D:/DocumentViewer_ ndroid/fileHandling/res/xml <br> It was giving error as adb not found
Android_programmer_camera
A: 

AFAIK an installed application cannot write to its own res folder

If you want to copy something from a device into the res folder of your project sources, you can use the adb tool, either from the command line by programmatic usage of the command line as part of a script or .bat file or using the shell exec function of your chosen language on your chosen development platform

Make sure you have the SDK fully installed and that the adb executable is in your path or reference it by its full path name (ie, make sure 'adb shell' works)

Chris Stratton