1

Is there any way to access a file of android phone's sd card from desktop? I wrote an application, where there is a file named video.mp4 in /mnt/sdcard/. I have started a nanohttp server(http) when the activity started, which working directory is /mnt/sdcard. So why i can't access 'protocol://x.x.x.x:port/video.mp4' from vlc player?? I successfully checked this in apache web server. My application have read/write permission to external storage.

private class MyHTTPD extends NanoHTTPD {
    public MyHTTPD() throws IOException {
        super(PORT, Environment.getExternalStorageDirectory());
    }
.......
.......
}
Stephan
  • 41,764
  • 65
  • 238
  • 329
shantanu
  • 2,408
  • 2
  • 26
  • 56
  • Do you have any evidence that VLC is compatible with NanoHTTTP anywhere, let alone Android? – CommonsWare Feb 24 '13 at 16:39
  • You can check my answer here http://stackoverflow.com/questions/17102954/why-images-and-style-files-couldnt-found-on-nanohttpd/17103609?noredirect=1#comment24743838_17103609 with this solution I was able to get files from sdcard – MP23 Jun 14 '13 at 08:23

1 Answers1

1

It may be better to do some push call from the Android side. "A server on a phone" may work through wireless but is normally disabled by the GSM provider (calls must originate at the phone side).

Audrius Meškauskas
  • 20,936
  • 12
  • 75
  • 93