title: How can I connect to an IPv6 address on Android?
body: <p>On Android, I'm using <a href="http://developer.android.com/reference/org/apache/http/client/HttpClient.html" rel="nofollow">HttpClient</a> to connect to a web address like so:</p>
  
  <pre><code>String url = "http://[fe80::1cef:49e7:2661:ffda]:7001/a.MOV";
  HttpParams httpParameters = new BasicHttpParams();
  HttpClient client = new DefaultHttpClient(httpParameters);
  HttpGet httpGet = new HttpGet(url);
  HttpResponse response = client.execute(httpGet);
  </code></pre>
  
  <p>The code works fine when inputting a standard URL, or one with a v4 IP address. However, when I use a v6 address, the last line of the above code will fail with a <code>java.net.SocketException: Invalid argument</code> being thrown.</p>
  
  <p>To illustrate, while this address:</p>
  
  <pre>http://192.168.1.2:7001/a.MOV</pre>
  
  <p>will work without a problem, this one:</p>
  
  <pre>http://[fe80::1cef:49e7:2661:ffda]:7001/a.MOV</pre>
  
  <p>won't work at all.</p>
  
  <p>To be sure, I also tried using the newer <a href="http://developer.android.com/reference/java/net/HttpURLConnection.html" rel="nofollow">HttpURLConnection</a> to make the connection, and it still results in the same exception being thrown.</p>
  
  <p>I'm currently performing my testing on a Google TV device running Android version 3.2.</p>
  
  <p>So is there something I'm doing wrong? And if not, is there any way to work around this apparent limitation of Android?</p>