Hi Dw. This is my first Android app, and what I'm trying to do is to post a POST/GET method to my webserver using Http in Android studio. I also have a Textview which suppose to display echoed data from server which will be a response to a request since the php file I'm posting to simply echo back the data. Here is what I have: try { URL url = new URL("http://myURLAddress/run.php"); JSONObject postDataParams = new JSONObject(); postDataParams.put("name", "Mr.M"); Log.e("params", postDataParams.toString()); HttpURLConnection conn = (HttpURLConnection) url.openConnection(); conn.setReadTimeout(15000 /* milliseconds */); conn.setConnectTimeout(15000 /* milliseconds */); conn.setRequestMethod("GET"); conn.setDoOutput(true); conn.setDoInput(true); OutputStream os …

Member Avatar
Member Avatar
+0 forum 3

The End.