I am working on a samba client for Android. Given an IP address it should connect to it and browse the shared folders.

For this I use [JCIFS](http://jcifs.samba.org/). I dropped the jar in my Android project and added following code to connect to PC and get the list of files:

```
private void connectToPC() throws IOException {
    String ip = "x.x.x.x";
    String user = Constants.username + ":" + Constants.password;
    String url = "smb://" + ip;

    NtlmPasswordAuthentication auth = new NtlmPasswordAuthentication(user);
    SmbFile root= new SmbFile(url, auth);

    String[] files = root.list();
    for (String fileName : files) {
        Log.d("GREC", "File: " + fileName);
    }
}

```

And I get in return: **jcifs.smb.SmbAuthException: Logon failure: unknown user name or bad password.**

But the credentials are correct. I also tried with another samba client from the android market that uses JCIFS and it successfully connected to that ip, so obviously I am doing something wrong here but don't know what especially.

Any help is highly appreciated.