Here’s my HTTP Get method to connect to the URL:
public void executeHttpGet() throws Exception {
try {
HttpClient client = new DefaultHttpClient();
HttpGet request = new HttpGet("http://test.mobibon.com.tw/MovieGoTest/GetMovies.js");
HttpResponse response = client.execute(request);
String retSrc = EntityUtils.toString(response.getEntity());
Log.i("bird",retSrc);
} finally {
}
}
And here’s how I call it:
try {
executeHttpGet();
} catch (Exception e) {
Log.i("bird","nothing");
e.printStackTrace();
}
http://test.mobibon.com.tw/MovieGoTest/GetMovies.js <—–this url works fine in my browser
But the Exception message is: UnknownHostException
Why?
Hello Check This Function
Refer This Link For JSON Parse in Android Click Here