Advertisement
vitareinforce

Android FTP

Jan 20th, 2019
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. private class FtpTask extends AsyncTask<Void, Void, FTPClient> {
  2. protected FTPClient doInBackground(Void... args) {
  3. serverconnection ftpconnect =new serverconnection();
  4. FTPClient ftp=ftpconnect.connectftp();
  5. return ftp;
  6. }
  7.  
  8. protected void onPostExecute(FTPClient result) {
  9. Log.v("FTPTask","FTP connection complete");
  10. ftpClient = result;
  11. //Where ftpClient is a instance variable in the main activity
  12. }
  13. }
  14.  
  15. //makenya
  16. new FtpTask().execute();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement