0

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?

  • http://stackoverflow.com/a/4457526/2191256 take a look at this, you need to take the response with `HttpResponse` – vilpe89 Jan 15 '14 at 12:20

1 Answers1

0

use a var_dump($_POST); in your php script. And check the logcat for the output.