title: Errors when using the URI class to connect to a website
body: <p>I am trying to connect the url below. This works fine but the application crashes after execution, any ideas? Logcat complains about line 77 - <code>connection = (HttpURLConnection)url.getContent();</code> which I changed from <code>connection = (HttpURLConnection)url.openConnection();</code> as the url wasn't being executed. This code is executed within a button onClick Listener. Thanks in advance.</p>
  
  <pre><code>URL url = null;
  try {
      url = new URL("http://apps.smilemachine.com/smilefactory/api/v1.0/speedup");
  } catch (MalformedURLException e) {
      e.printStackTrace();
  }
  HttpURLConnection connection = null;
  try {
      connection = (HttpURLConnection)url.getContent();
  } catch (IOException e) {
      e.printStackTrace();
  }
  try {
      connection.setRequestMethod("GET");
  } catch (ProtocolException e) {
      e.printStackTrace();
  }
  try {
      connection.connect();
  } catch (IOException e) {
      e.printStackTrace();
  }
  </code></pre>
  
  <p>Log cat output:</p>
  
  <p>11-28 22:11:21.153: E/AndroidRuntime(2676): FATAL EXCEPTION: main
  11-28 22:11:21.153: E/AndroidRuntime(2676): java.lang.ClassCastException: java.util.zip.GZIPInputStream
  11-28 22:11:21.153: E/AndroidRuntime(2676):     at com.developer.machine.Screen1$1.onClick(Screen1.java:81)
  11-28 22:11:21.153: E/AndroidRuntime(2676):     at android.view.View.performClick(View.java:2485)
  11-28 22:11:21.153: E/AndroidRuntime(2676):     at android.view.View$PerformClick.run(View.java:9080)
  11-28 22:11:21.153: E/AndroidRuntime(2676):     at android.os.Handler.handleCallback(Handler.java:587)
  11-28 22:11:21.153: E/AndroidRuntime(2676):     at android.os.Handler.dispatchMessage(Handler.java:92)
  11-28 22:11:21.153: E/AndroidRuntime(2676):     at android.os.Looper.loop(Looper.java:123)
  11-28 22:11:21.153: E/AndroidRuntime(2676):     at android.app.ActivityThread.main(ActivityThread.java:3683)
  11-28 22:11:21.153: E/AndroidRuntime(2676):     at java.lang.reflect.Method.invokeNative(Native Method)
  11-28 22:11:21.153: E/AndroidRuntime(2676):     at java.lang.reflect.Method.invoke(Method.java:507)
  11-28 22:11:21.153: E/AndroidRuntime(2676):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
  11-28 22:11:21.153: E/AndroidRuntime(2676):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
  11-28 22:11:21.153: E/AndroidRuntime(2676):     at dalvik.system.NativeStart.main(Native Method)</p>