I send a message over sockets from an android app to a java program. This message is sent with a printwriter.

here is how I send my message from android to java program:

```
out.println("Hello there");
out.flush();

```

This is how I receive the message:

```
while(true){
String msg = in.readLine();

System.out.println("MSG: " + msg);

...some if-statements...
}

```

The output of the System.out.println is:
**MSG: Hello there**
\**MSG: null*\*

How come I get null there? I'm only sending "hello there"..

Help would be appreciated, thanks!

**EDIT:** Actual code of the java program.

```
while (run) {
            String msg = in.readLine();
            String[] parts;  
            String username;
            String password = null;

            System.out.println("MSG: " + msg);

            parts = msg.split("\\*");
            username = parts[0];
            password = parts[1];

            boolean validUser = false;

            validUser = db.authenticate(username, password);

            if (validUser) {
                        db.updateIP(username,                     socket.getInetAddress().getHostAddress());
                        out.println("done");
                        out.flush();
            } else {
                        out.println("loginfail");
                        out.flush();
                        closeSocketConnection();
                }
            }
        }

    private void closeSocketConnection() throws IOException {
        in.close();
        out.close();
        socket.close();
        run = false;
    }

```