I want to send a json message over http to a php server.I used the gson library as you can see.
Gson gson = new Gson();
String[] data = {"value1", "value2", "value3"};
String json = gson.toJson(data);
String message = "jdata"+json; //I did this because of the server implementation
String path= "http://localhost/joomla/index.php?option=com_up1";
I want to connect to send (POST) the string message to the server that is located on the path The server will retrieve the values, value1,value2,value3 from the message.
$jd = json_decode(JRequest::getVar( 'jdata'), true);
if (sizeof($jd)>0) {
$name = $jd[0];
$surname = $jd[1];
......
......
The server will return messages like
if ($db->query()) {
printf("OK");
that I want to display in my application.
How can I send the message to the server ? And how can I read the messages from the server to my app ?