In my Android app, it says: org.apache.http.client.httpclient is deprecated. After some research, I found out that Android refused this in API 22. I searched the forum and tried: "Application stopped", "Google Search": "Application stopped." So I have no idea what to do. Hope you guys can help me. Well here is my code:
try { HttpClient httpclient = new DefaultHttpClient(); HttpPost httppost = new HttpPost("http://www.URL.com"); HttpResponse response = httpclient.execute(httppost); HttpEntity entity = response.getEntity(); is = entity.getContent(); Log.e("log_tag", "connection success"); // Toast.makeText(getApplicationContext(), "pass", Toast.LENGTH_SHORT).show(); } catch (Exception e) { Log.e("log_tag", "Error in http connection" + e.toString()); Toast.makeText(getApplicationContext(), "Connection fail", Toast.LENGTH_LONG).show();
EDIT:
I am trying to get some data from my Mysql database. Do you know a good tutorial on how to do this? Please let me know.
source share