How to access share folder in windows through android and read files

rwe picture rwe · Feb 22, 2012 · Viewed 16k times · Source

I need to connect from my Android phone to a Windows PC share and access files. I saw some sample apps in Android market that access share folders using smb/samba. But I have no idea about how to create an app like that. Thanks a lot.

Answer

tantonj picture tantonj · Mar 28, 2012

You need to get JCIFS and use SmbFile class to interact with files over the network,

http://lists.samba.org/archive/jcifs/2007-September/007465.html

that is a quick example of how to list files, of coarse you need internet permission on. So Far though everytime I try to call SmbFile.listFiles(); I get an UnknownHostException, However others seam to be able to do it with no problem, this might work for you, try it!