If you are trying to connect to the internet using one of Android's HTTP Clients, but when you do so in your code you get java.net.UnknownHostException, it means your application doesn't have the permission to connect to the internet. To resolve it, add the INTERNET permission to your application's AndroidManifest.xml file. Follow these steps if you are using Eclipse:
- Open your AndroidManifest.xml
- Click on the Permission tab
- Click on Add... then choose "Uses Permission"
- From the list of permissions choose "android.permission.INTERNET"
- Save and re-run your application