title: Android FTP with 4G
body: <p>I am trying to connect to an FTP server in an Android application and I believe that I fall in an infinite loop, but can't understand why. The library I am using is Apache Comomns net.</p>
  
  <p>I have the internet permission in manifest :</p>
  
  <pre><code>&lt;uses-permission android:name="android.permission.INTERNET"/&gt;
  </code></pre>
  
  <p>I am also connecting to the FTP in an AsyncTask.</p>
  
  <p>Here is a sample code which was supposed to work :</p>
  
  <pre><code>    // I have other values when I test it of course
      FTPClient ftpClient = new FTPClient();
      ftpClient.connect("111.111.111.111"); // It stops working here when in 4G
      ftpClient.login("user", "mdp");
      ftpClient.changeWorkingDirectory("directory");
      ftpClient.setFileType(FTP.BINARY_FILE_TYPE);
      ftpClient.enterLocalPassiveMode();
      ftpClient.logout();
      ftpClient.disconnect();
  </code></pre>
  
  <p>It works on Wifi (and my real application works too in wifi) but when I use my 4G (or 3G) it seems to loop at the line where I try to connect() forever.</p>
  
  <p>I have tryed to understand what there is behind this but it's not clear for me.</p>
  
  <p>How can I connect to my FTP using 4G?</p>
  
  <p>Any help would be appreciated.</p>