/ Published in: Java
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
// DOWNLOAD THE PROJECT JSON FILE HttpClient httpclient = new DefaultHttpClient(); try { HttpGet httpget = new HttpGet(url); Log.d(TAG, "executing request " + httpget.getURI()); // Create a response handler ResponseHandler<String> responseHandler = new BasicResponseHandler(); // Log.i(TAG, "DOWNLOADED " + responseBody); } catch (ClientProtocolException e) { e.printStackTrace(); e.printStackTrace(); } finally { // When HttpClient instance is no longer needed, // shut down the connection manager to ensure // immediate deallocation of all system resources httpclient.getConnectionManager().shutdown(); }