7

I am beginner in android application development. I was trying database connection and I get error in my code for the following packages. Please tell me where can I download these packages , how to use them?

import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.NameValuePair;
import org.apache.http.client.HttpClient;
import org.apache.http.client.entity.UrlEncodedFormEntity;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.impl.client.DefaultHttpClient;
import org.apache.http.message.BasicNameValuePair;
Héctor
  • 24,444
  • 35
  • 132
  • 243
vahni
  • 75
  • 1
  • 1
  • 3

2 Answers2

13

If you are using,

1. Android Studio :

then add this dependancy in your build.gradle at application level :

compile 'org.apache.httpcomponents:httpcore:4.4.1' 
compile 'org.apache.httpcomponents:httpclient:4.5'

2. Eclipse :

Download this library as a jar and put it in your libs folder

HttpCore : http://mvnrepository.com/artifact/org.apache.httpcomponents/httpcore/4.4.1

HttpClient : http://mvnrepository.com/artifact/org.apache.httpcomponents/httpclient/4.5

AndiGeeky
  • 11,266
  • 6
  • 50
  • 66
1

You can download it from here: Apache HttpComponents

Francisco Romero
  • 12,787
  • 22
  • 92
  • 167
  • thanks .what exactly should i download in this httpClient and how to use? – vahni Aug 31 '15 at 11:28
  • You have to download the .jar file. After download it, you have to right click on your project and select build path. A window will be displayed so there you have to go to "libraries" and add a new user library. In that library you have to add your jar. – Francisco Romero Aug 31 '15 at 11:35