title: Android - Default user agent for URLConnection?
body: <p>I am creating a regular HTTP connection using this code:</p>
  
  <pre><code>URLConnection cn = new URL( "http://...." ).openConnection();
  cn.connect();
  </code></pre>
  
  <p>How do I find out the default user agent for my HTTP connection? I tried using the following codes but they all return null:</p>
  
  <pre><code>Log.d("My app", "User agent = " + cn.getRequestProperties().get("User-Agent"));
  Log.d("My app", "User agent = " + cn.getHeaderField("User-Agent"));
  </code></pre>