My android app keeps on crashing. I'm trying to connect to a webservice via post call. But my app keeps on crashing every time it tries to call the webservice.
import android.app.Activity;
import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.impl.client.DefaultHttpClient;
import java.io.IOException;
public class PostActivity extends Activity {
//static String response = null;
public void loadPost() throws IOException {
DefaultHttpClient httpClient = new DefaultHttpClient();
HttpEntity httpEntity = null;
HttpResponse httpResponse = null;
String blogFeedUrl = "http://localhost/medapp/public/mobile/post";
HttpGet httpGet = new HttpGet(blogFeedUrl);
httpResponse = httpClient.execute(httpGet); // <-- this is where the application crashes
}
}