public void Connect() {
JSch jsch = new JSch();
try {
jsch.setConfig("StrictHostKeyChecking", "no");
//open a new session
session = jsch.getSession(user, host, port); // pi, 192.168.43.213, 22
session.setConfig("StrictHostKeyChecking", "no");
session.setPassword(password); //passwrord : raspberry
tv.setText("Connecting");
session.connect(1000);//connect session
tv.setText("Connected");
} catch (JSchException e) {
tv.setText("JSchException");
Toast t = Toast.makeText(ClientSSH.this, "Failed to Create Session or Timed Out", 1000);
t.setGravity(Gravity.CENTER, 0, 0);
t.show();
}
}