I use this code in my android application to send data to web .On web side i use php Here is my code:
public void sendToweb()
{
Thread tSendToweb = new Thread(new Runnable()
{
@Override
public void run()
{
HttpClient hc = new DefaultHttpClient();
String message;
HttpPost p = new HttpPost("http://eservices.rondssolar.com/xbusiness.php");
JSONObject object = new JSONObject();
try
{
object.put("submit", "Save Tracker Data");
object.put("systemId","12345");
}
catch (Exception ex)
{
ex.printStackTrace();
}
message = object.toString();
try
{
p.setEntity(new StringEntity(message, "UTF8"));
p.setHeader("Content-type", "application/json");
hc.execute(p);
}
catch (Exception e)
{
e.printStackTrace();
}
}
});
tSendToweb.start();
}
I am not getting any error messages.But not getting any response.How can i know the above data reached in web? How can i retrieve this data using php?