There is an FTP connection method
public boolean ftpConnect(String host, String username, String password, int port) { boolean status = false; Log.d("myLog", "host " + host + " username " + username + " password " + password + " port "+ port); try { mFTPClient = new FTPClient(); mFTPClient.connect(host, port); Log.d("myLog", "Код ответа" + mFTPClient.getReplyCode()); if (FTPReply.isPositiveCompletion(mFTPClient.getReplyCode())) { status = mFTPClient.login(username, password); mFTPClient.setFileType(FTP.BINARY_FILE_TYPE); mFTPClient.enterLocalPassiveMode(); } Log.d("myLog", "Все прошло успешно"); } catch (Exception e) { Log.d("myLog", "Error: could not connect to host " + host + " " + e); } return status; }
I try to connect, but it does not appear, why without a clue, I thought that I’m entering the login and password data incorrectly, made a debug output and everything is correct. everything works fine in FTP clients.