title: Java ftpclient application doesn't connect
body: <p>I am new to android and java programing. I write following code to connect to ftp server</p>
  
  <pre><code>public class NewMainActivity extends Activity {
  TextView Display;
  //declare a public FTP client object.
  public FTPClient mFTPClient = null;
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_new_main);
      final TextView Display = (TextView) findViewById(R.id.tvResults);
  
      try {
           mFTPClient = new FTPClient();
  
            // connecting to the host
           mFTPClient.connect("www.filegenie.com",21); 
  
            // now check the reply code, if positive mean connection success
            if (FTPReply.isPositiveCompletion(mFTPClient.getReplyCode())) {
                // login using username &amp; password
                boolean status = mFTPClient.login("user", "MyPassword");
  
                // Set File Transfer Mode
  
                mFTPClient.setFileType(FTP.BINARY_FILE_TYPE);
                mFTPClient.enterLocalPassiveMode();
  
                Display.setText("Correct"+ String.valueOf(status)); //return status;
            }
  
          }catch(Exception e) {
               Display.setText(" Exception message is = "+e.getMessage()+" Reply code = "+mFTPClient.getReplyCode());
  
          }
  
  }
  </code></pre>
  
  <p>When I run this code I get no specific error but the program didn't execute mFTPClient.connect method and jumps to the 'Exception' part and I get "null" as exception getMessage and "0" as ReplyCode.
  I have import all the required files such as</p>
  
  <pre><code>import org.apache.commons.net.ftp.FTP;
  import org.apache.commons.net.ftp.FTPClient;
  import org.apache.commons.net.ftp.FTPReply;
  </code></pre>
  
  <p>I am using eclipse and ADT Build v22.0.1-685705.
  I have also included commons-net-3.3, commons-net-3.3-sources and commons-net-examples-3.3 files in the android project's lib, and also included the java files and folders from 
  commons-net-3.3-src | src | main | java | org | apache | commons | net folder to the  Android project's src folder by creating the folders org | apache | commons | net.
  I could not figured out what is the problem.
  Can any one help me in this regard. </p>
  
  <p>The same server can be accessed with a comercial ftp client. </p>
  
  <p>Thanks in advance.</p>