开发者

Android Tablet connecting to smb and get a list of files

im a complete noob to android and java but have wanted to learn for a while.

im trying to build a file browsing app which can view files and directories in a samba server or other file shares.

I'm trying to use uri.parse to initialize the uri of my samba server and then i want to convert the uri into a File type so i can essentially do file.list() to get a list of files/folders from the server.

heres what i found so far but im having issues with getting this running:

String[] list = null; Uri uri = Uri.parse("smb://AG-24640/Users/Public/");

File file = new File(new URI(uri.toString()));

list = file.list();

Is there anything im doing wrong or is there an easier way of doing this? Is there anything i need to do to get the build of android to开发者_运维技巧 understand smb:// ?? im running android honeycomb 3.2

Thank you,


I don't think Android supports Samba/CIFS out of the box, you'll probably need to use a 3rd party java library like: http://jcifs.samba.org/

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜