0

Possible Duplicate:
How to Store files on Emulator?

I'm trying to add some files to emulator. Is it possible to do that.

Community
  • 1
  • 1
Praveenkumar
  • 24,084
  • 23
  • 95
  • 173
  • 1
    Check out this post = http://stackoverflow.com/questions/2506661/how-to-import-files-into-the-sdcard-on-emulator-in-android or this one = http://stackoverflow.com/questions/7358023/how-to-store-files-on-emulator – sealz Sep 14 '11 at 12:53
  • if you want to add some file manually then see this [Question.](http://stackoverflow.com/questions/7358023/how-to-store-files-on-emulator). It is must help for you.. – Niranj Patel Sep 14 '11 at 13:01

3 Answers3

4

You can use adb push as explained here:

adb push c:\somefile.txt /sdcard
Shlublu
  • 10,917
  • 4
  • 51
  • 70
3

why not for example

String path = Environment.getExternalStorageDirectory().getAbsolutePath();
File mfile = new File(path, "sample.txt");
mfile.mkdir();

this will create a "sample.txt" file on your sdcard

WarrenFaith
  • 57,492
  • 25
  • 134
  • 150
Mohammed Azharuddin Shaikh
  • 41,633
  • 14
  • 96
  • 115
2

you can also push file from ddms select the device from the device window in the ddms and click on the File Explorer tab now select the sdcard.

Now on right side of File Explorer window two button are their which are enable to you for file import or export to the device to pc and vice versa

here is the image: File Explorer Screenshot

Pratik
  • 30,639
  • 18
  • 84
  • 159