How can i write this code into a Thread or an AsyncTask ?
JSch jsch = new JSch();
Session session = null;
session = jsch.getSession("******", "*********",22);
session.setConfig("StrictHostKeyChecking", "no");
session.setPassword("******");
session.connect();
Channel channel = session.openChannel("sftp");
channel.connect();
ChannelSftp sftpChannel = (ChannelSftp) channel;
sftpChannel.exit();
session.disconnect();
To write it in a thread, just create a new thread object containing a Runnable process.
This can then be run at anytime with
More information on Threads, ASyncTasks and other processes can be found here:
http://developer.android.com/guide/components/processes-and-threads.html