I\'m facing problem with passing the value to the php script from android.
I want the questionid
to pass into php script url_get_ansurl
but I c
You can use this by POST or GET
List params = new ArrayList();
params.add(new BasicNameValuePair("questionid", questionid));
try {
HttpParams httpParameters = new BasicHttpParams();
HttpConnectionParams.setConnectionTimeout(httpParameters, 10000);
HttpConnectionParams.setSoTimeout(httpParameters, 10000);
HttpClient httpClientpost = new DefaultHttpClient(httpParameters);
//HttpGet post = new HttpGet(url_request);
HttpPost post = new HttpPost(url_request);
UrlEncodedFormEntity ent = new UrlEncodedFormEntity(params,
HTTP.UTF_8);
post.setEntity(ent);
HttpResponse responsePOST = httpClientpost.execute(post);
HttpEntity resEntity = responsePOST.getEntity();
String getresponse = EntityUtils.toString(resEntity); //Response from the server
} catch (IOException e) {
e.printStackTrace();
} catch (JSONException e) {
e.printStackTrace();
}