unfortunately android application is stoped : I want to make a login program in android. I write a code for login program. In this program username and password is send to server for authentication. But when i open the app and enter username and password and click on LoiIn button my application unfortunately stopped. But username and password will sent to server.Than means my application will stopped when i click on Login button.Here is my code.

    public class LogIn extends Activity implements View.OnClickListener{

    private Socket socket;
    private DataOutputStream out;
    private DataInputStream in;

    private String username,password,s;

    EditText eT_username,eT_password;
    Button b_login,b_signup,b_connect;
    TextView t;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_log_in);

        eT_username = (EditText)findViewById(R.id.eT_username);
        eT_password = (EditText)findViewById(R.id.eT_password);

        b_login = (Button)findViewById(R.id.b_login);
        b_signup = (Button)findViewById(R.id.b_signup);
        b_connect = (Button)findViewById(R.id.b_connect);

        t = (TextView)findViewById(R.id.tV);

        b_login.setOnClickListener(this);
    }

    @Override
    public void onClick(View v) {
        String toast_msg;
        try {
            out = new DataOutputStream(socket.getOutputStream());
            in = new DataInputStream(socket.getInputStream());

            out.writeUTF("1");

            username = eT_username.getText().toString();
            password = eT_password.getText().toString();

            out.writeUTF(username);
            //        out.flush();
            out.writeUTF(password);
            //        out.flush();

            t.setText("hi");

            s = in.readUTF();


            if (s.equals("ok")) {
                toast_msg = "Login is successfull";
                t.setText(toast_msg);
            } else {
                toast_msg = "username or password is incorrect";
                t.setText(toast_msg);
            }

        } catch (IOException e) {
            t.setText(e.toString());
        }
    }



    public void connect(View v)
    {
        new Thread(new Runnable() {
            @Override
            public void run() {
                try
                {
                    socket = new Socket("192.168.0.101",5000);

                }
                catch(Exception e)
                {
                    TextView t = (TextView)findViewById(R.id.textView);
                    t.setText(e.toString());
                    //   Toast.makeText(LogIn.this,"Make sure that you are connected to Internet",Toast.LENGTH_LONG).show();
                }
            }
        }).start();
    }
    public void openSignUp(View v)
    {
        if (v.getId()== R.id.b_signup)
        {
            Intent i =  new Intent(LogIn.this,SignUp.class);
            startActivity(i);
        }
        new SignUp(socket);
    }
}