• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps Http Connection

Hi All,
I am new in android.
I written small program that will connect to server but, it my app getting connect can anybody tell me what is problem.

Code is :

public void http()
{
try
{
URI uri = new URI("http://localhost:8080/TestApp/");
Log.v(TAG,uri.toString());
HttpGet get = new HttpGet(uri);
HttpClient client = new DefaultHttpClient();
HttpResponse response = client.execute(get);
Log.v(TAG,response.toString());
}
catch (Exception e) {
// TODO: handle exception
}
 
Back
Top Bottom