0

I want to test the behaviour of the mediaplayer I have implemented. This one doesn't read a stream from internet so I downloaded a mp4 video to test. But I cannot access my windows hard drive when using Environment.getExternalStorageDirectory(). The command Environment.getExternalStorageDirectory().getAbsolutePath() gives me /storage/sdcard. So here is my question : how to access windows hard drive from android emulator ? And is it possible ?

Mr. Starck
  • 232
  • 6
  • 16

1 Answers1

0

As far as I know, it is impossible.

You can not access windows hard drive from android emulator directly.

Instead, If you are familiar with client-server programming, you can access localhost(10.0.2.2).

For now, if you want to load your mp4 file, push that file to emulator sdcard using DDMS.

  • Inside Eclipse, window->Open perspective->DDMS.

  • There you have a file explorer (if not seen, window->show view-> file explorer)

  • Navigate to your sdcard (/storage/sdcard in your case)
  • On top-right of the explorer, there are buttons for push/pull/remove files
Nizam
  • 5,698
  • 9
  • 45
  • 57
  • Hey thanks Nizam. I did like this but I still have a read only error :/ [2013-10-25 15:47:01 - ddms] transfer error: Read-only file system [2013-10-25 15:47:02] Failed to push selection: Read-only file system – Mr. Starck Oct 25 '13 at 13:56
  • Do you have sdcard created during creating emulator? See emulator details to see sdcard size using AVD manager – Nizam Oct 25 '13 at 14:01
  • Yes it is. I saw a tuto saying i should modify the hardware options too but my avd screen doesn't have it – Mr. Starck Oct 25 '13 at 14:14
  • Well it seems I have no luck because I try to do this without success... http://stackoverflow.com/questions/5174824/android-emulator-sdcard-suddenly-read-onlyfailing-to-mount – Mr. Starck Oct 25 '13 at 14:21
  • Yup. but path differs. So, does that work after changing permission? – Nizam Oct 25 '13 at 14:30
  • Which permissions ? I relaunched cmd in admin mode and re entered the command line but still this result : Usage: mount [-r] [-w] [-o options] [-t type] device directory which means it doens't work cause I tried to copy my file again :/ And on both sdcard folders... – Mr. Starck Oct 25 '13 at 14:40
  • Even if permissions are both set to lrwxrwxrwx – Mr. Starck Oct 25 '13 at 14:41
  • You missed the link in my comment? I was asking about changing the properties as in [this](http://stackoverflow.com/a/14293973/2124004) link. – Nizam Oct 25 '13 at 14:44
  • OK it seems to work now. I had seen this link earlier but I hadn't found Documents and settings. I finally localized avd and changed the permissions and now I did not have this error message. A big Thanks Nazim ;) – Mr. Starck Oct 25 '13 at 14:56
  • AH sorry Nizam. Nazim is the name of someone I know so your name made me think to him. And I had forgotten to put the problem as resolved, it's done now ;) – Mr. Starck Oct 28 '13 at 08:23