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

Exception after excuting HttpResponse

Dear Madam/Sir,

I have some codes section as below :

-----
{

HttpClient client = new DefaultHttpClient();
StringBuilder builder = new StringBuilder();
HttpGet myget = new HttpGet(http://test123abc.comoj.com/json_test.php);

try {
HttpResponse response = client.execute(myget);

.....

}

catch (Exception e) {
Log.v("url response", "false");
e.printStackTrace();
}

}
-----

Every time I run this codes with AVD under Eclipse, it will always drop into the catch function with exception.
I tried to debug, then found that the problem happened after executing the code "HttpResponse response = client.execute(myget)".
After I saw some suggestion on internet, I added the following code in the AndroidManifest.xml which is outside of the <application> section.
"
<uses-permission android:name="android.permission.INTERNET" />
"
But the same exception happens.

I want to know if there is any other reason to cause this problem.
I think this should be the simple question but I am just the beginner in Android development.
So please help me with any suggestion or checking point.
I will appreciate your any help. Thank you very much.
 
Back
Top Bottom