I tried multiple HTTP classes (HttpURLConnection, HTTPClient and others) but they don\'t work in emulator. Then I decided to test that on my phone
You disable the strict mode using following code:
if (android.os.Build.VERSION.SDK_INT > 9) {
StrictMode.ThreadPolicy policy =
new StrictMode.ThreadPolicy.Builder().permitAll().build();
StrictMode.setThreadPolicy(policy);
}
This is not recommended: use the AsyncTask interface.
Link of AsyncTask
Link of another reference