title: Android Download Manager Doesn't Work on Private Network
body: <p>I use firewall on my network and this network has just one Ip that allowed access. I want to download my apk file from special Ip but Download Manager adds to list as STATUS_PENDING. <a href="https://stackoverflow.com/questions/53869817/android-download-manager-status-is-always-pending">How can I download this file without VPN?</a></p>
  
  <pre><code>        DownloadManager downloadManager = (DownloadManager) context.getSystemService(Context.DOWNLOAD_SERVICE);
          DownloadManager.Request downloadRequest = new DownloadManager.Request(Uri.parse(urlPath));
  
          downloadRequest.setAllowedNetworkTypes(DownloadManager.Request.NETWORK_MOBILE | DownloadManager.Request.NETWORK_WIFI);
          downloadRequest.setAllowedOverRoaming(true);
          downloadRequest.setAllowedOverMetered(true);
          downloadRequest.setTitle("NetworkApp");
          downloadRequest.setDescription("Downloading NetworkApp " + versionName);
          downloadRequest.setVisibleInDownloadsUi(true);
          downloadRequest.setDestinationInExternalFilesDir(context, null, "NetworkApp.apk");
          downloadRequest.setNotificationVisibility(DownloadManager.Request.VISIBILITY_VISIBLE);
  
          long downloadId = downloadManager.enqueue(downloadRequest);
  </code></pre>
  
  <p>Android Api:28</p>