tags:

views:

218

answers:

3

How the directories are disposed? Where do I copy my musics and pictures in my virtual device to test my apps?

update: trying with mTools....
update: mtools fails... cant download it to virtual device..

update: I entered the internet on the Android's virtual device, tried to save an image, and it says that "An SD card is required". I thought I've read in the android.developers.com that the device has a SD card by default.. Anyway, I'll look for how to create it..

A: 

In the latest SDK (API level 8, equalling 2.2), you use Environment.

Pontus Gagge
The DIRECTORY_PICTURES attribute have the value "Pictures", but trying to copy with 'adb push' throws: failed to copy '/home/wellington/housemd.jpg' to '/Pictures/housemd.jpg[A': No such file or directory
Tom Brito
So, are you calling getExternalStoragePublicDirectory(Environment.DIRECTORY_PICTURES)?
Pontus Gagge
ops, ok, now I did it right, but still got: failed to copy '/home/wellington/housemd.jpg' to '/mnt/sdcard/Pictures/housemd.jpg': No such file or directory
Tom Brito
I'm in the sdk tools folder, but I believe it makes no difference, as I'm specifying the full path..
Tom Brito
The problem was I had no sdcard on the virtual device.. XD
Tom Brito
A: 

Usually, music and pictures will live anywhere in the /sdcard folder. Keep in mind that not all handsets provide an SD Card.

Cristian
I've tried to copy a file usin adb push, but a got: failed to copy '/home/wellington/housemd.jpg' to '/sdcard/media/housemd.jpg': No such file or directory
Tom Brito
A: 

If you do want to try to use an emulated sdcard, then you have to use the mksdcard utility. It's covered here:

http://developer.android.com/guide/developing/tools/othertools.html#mksdcard

You'll want to create an avd that points to the .img file you created. Once the avd is started, you can then use adb push to put files on it.

Maximus
or, when creating the virtual device in AVD Manager, just mark the box to create the sdcard.. ;)
Tom Brito