Skip to content

Instantly share code, notes, and snippets.

@sethdaniel
sethdaniel / POST to server without the black magic, human sacrifices, or screaming incantations
Created April 11, 2013 22:09
Of all the different methods of getting Android to do a simple POST to server and receive the response, this is the method that makes me want to hang myself the least. It's really an inspiring achievement how Android manages to provide so many different ways to take something as simple as a POST and absolutely bury it in baffling amounts of comp…
private class PostVarToPhpAndGetResponseAsString extends
AsyncTask<Void, Void, Void> {
 
ProgressDialog progressDialog = new ProgressDialog(
ParentClassActivity.this);//<---the name of the outer class goes here!!!
 
@Override
protected void onPreExecute() {
super.onPreExecute();
progressDialog