title: Android DownloadManager: Download fails, but COLUMN_REASON only returns "placeholder"
body: <p>DownloadManager appears to be the right choice for an app with lots of background downloads on a flaky mobile internet connection.</p>
  
  <p>Using tutorial code found on the web, the app is able to request a download from the system's DM like so:</p>
  
  <pre><code>// in onCreate()
  dm = (DownloadManager) getSystemService(DOWNLOAD_SERVICE);
  
  // in requestData()
  Uri u = Uri.parse("http://server:8000/feed/data");
  Request dreq = new Request(u);
  dreq.setNotificationVisibility(Request.VISIBILITY_HIDDEN);
  downloadID = dm.enqueue(dreq);
  </code></pre>
  
  <p>The URL in that code is a test server on a local computer. The URL works, the browser in Android emulator can retrieve the page and the server returns HTTP code 200 when my app requests that page via DownloadManager and the code quoted above.</p>
  
  <p>This is the relevant code in the ACTION_DOWNLOAD_COMPLETE BroadcastReceiver which gets called when DM has retrieved the file.</p>
  
  <pre><code>Query q = new Query();
  q.setFilterById(downloadID);
  Log.i("handleData()", "Handling data");
  Cursor c = dm.query(q);
  if (c.moveToFirst()) {
    Log.i("handleData()", "Download ID: " + downloadID + " / " + c.getInt(c.getColumnIndex(DownloadManager.COLUMN_ID)));
    Log.i("handleData()", "Download Status: " + c.getInt(c.getColumnIndex(DownloadManager.COLUMN_STATUS)));
    if (c.getInt(c.getColumnIndex(DownloadManager.COLUMN_STATUS)) == DownloadManager.STATUS_SUCCESSFUL) {
      String uriString = c.getString(c.getColumnIndex(DownloadManager.COLUMN_LOCAL_URI));
      Log.i("handleData()", "Download URI: " + uriString);
    } else if (c.getInt(c.getColumnIndex(DownloadManager.COLUMN_STATUS)) == DownloadManager.STATUS_FAILED) {
      Log.i("handleData()", "Reason: " + c.getString(c.getColumnIndex(DownloadManager.COLUMN_REASON)));
    }
  }
  </code></pre>
  
  <p>The strange result is this:</p>
  
  <p>The DOWNLOAD_STATUS is 16 (or STATUS_FAILED), but the reason is "placeholder". </p>
  
  <p>Why is that? Why does it fail when the server returned a 200 status code? And why is there no reason given by DownloadManager?</p>