I'm working with Smb in the Android SDK.
I have the next code:
public AuthListFiles() throws Exception {
1 SmbFile file = new SmbFile("smb://DOMAIN;USER:PASS@ROUTE");
2 SmbFile[] files = file.listFiles();
3 // for( int i = 0; i < files.length; i++ ) {
// System.out.println( " " + files[i].getName() );
// }
4 // System.out.println();
}
The problem is in the line 2. If I execute a programa like a Java Application runs correctly, buy if I use this in a Android application it has an error. Has anyone used the JCIF library with Android?
The error is:
jcifs.smb.SmbException: Failed to connect: 0.0.0.0<00>/10.67.0.10
jcifs.util.transport.TransportException
java.net.SocketException: Permission denied
at org.apache.harmony.luni.platform.OSNetworkSystem.socket(Native Method)
at dalvik.system.BlockGuard$WrappedNetworkSystem.socket(BlockGuard.java:335)
at org.apache.harmony.luni.net.PlainSocketImpl.create(PlainSocketImpl.java:216)
at java.net.Socket.checkOpenAndCreate(Socket.java:802)
at java.net.Socket.connect(Socket.java:948)
at jcifs.smb.SmbTransport.negotiate(SmbTransport.java:309)
at jcifs.smb.SmbTransport.doConnect(SmbTransport.java:364)
at jcifs.util.transport.Transport.run(Transport.java:241)
at java.lang.Thread.run(Thread.java:1019)
at jcifs.util.transport.Transport.run(Transport.java:258)
at java.lang.Thread.run(Thread.java:1019)
What does this means Failed to connect: 0.0.0.0<00>/10.67.0.10
?
In a normal Java appication this runs.