i think you can use the Android Rest-Client for sending data to a webservice
take classes RequestMethod.java
and RestClient.java
from this link https://github.com/TylerSmithNet/RESTclient-Android/tree/master/RESTclient-example/src/com/tylersmith/restclient
and use those in your project like this
String webServiceUrl = "your-service-url";
RestClient client = new RestClient(webServiceUrl);
String serverResponse = "";
String inputJsonString = "{" +
" \"grant_type\" : \"password\"," +
" \"username\" : \"[email protected]\"," +
" \"password\" : \"password\"" +
"}";
client.setJSONString(inputJsonString);
client.addHeader("Content-Type", "appication/json"); // if required
try {
client.execute(RequestMethod.POST);
if (client.getResponseCode() != 200) {
// response error
}
else
{
// the response from server
serverResponse = client.getResponse();
}
} catch (Exception e) {
// handle error
}