// Create a default client HTTP
DefaultHttpClient cliente = new DefaultHttpClient();

// Set post or get method and set the URL
HttpPost post = new HttpPost("URL");

// Here you can set a parameter,
post.addHeader("Name", "Value");

// When you receive a response, you need to get this in a TRY/CATCH
try{
response = cliente.execute(post);
        HttpEntity entity = response.getEntity();
Out = EntityUtils.toString(entity);
}catch (Exception e) {
        // Do something with your exception
}

One more thing, if want to receive a JSON object, just use ( object =
(JSONObject) new JSONTokener(Out).nextValue(); ).. Cutting extra caracters
that isn't a JSON.

I hope can you enjoy this.. see you.

-- 
Atenciosamente;
Diogo Bonoto Salaberri
Bacharel em Ciência da Computação - UFPel

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to