Monday 3 September 2018
Subscribe to:
Post Comments (Atom)
<?php
header('Content-type: application/json');
echo json_encode("error_101");
?>
HttpParams httpParams = new BasicHttpParams();
HttpConnectionParams.setConnectionTimeout(httpParams, 10000);
HttpConnectionParams.setSoTimeout(httpParams, 10000);
HttpClient client = new DefaultHttpClient(httpParams);
String url = "http://192.168.254.19/android/register.php";
HttpPost request = new HttpPost(url);
request.setEntity(new ByteArrayEntity(json.toString().getBytes("UTF8")));
request.setHeader("json", json.toString());
HttpResponse response = client.execute(request);
HttpEntity entity = response.getEntity();
String result = null;
if (entity != null) {
InputStream instream = entity.getContent();
InputStreamReader is_reader = new InputStreamReader(instream);
BufferedReader br = new BufferedReader(is_reader);
result = br.readLine();
Log.i("Read from server", result);
Toast.makeText(this, result, Toast.LENGTH_LONG).show();
}
<br />
"echo $TesttVar1 . '<br />';
Hello Friends! I am Ramana a part time blogger from Hyderabad.
0 comments:
Post a Comment