我是Android应用程序开发的初学者。我正在尝试数据库连接,我的代码中出现以下包的错误。请告诉我在哪里可以下载这些软件包,如何使用它们?
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;
答案 0 :(得分:8)
如果您正在使用,
<强> 1。 Android Studio:
然后在应用程序级别的build.gradle中添加此依赖项:
compile 'org.apache.httpcomponents:httpcore:4.4.1'
compile 'org.apache.httpcomponents:httpclient:4.5'
<强> 2。 Eclipse:
将此库下载为jar并将其放入libs文件夹
HttpCore:http://mvnrepository.com/artifact/org.apache.httpcomponents/httpcore/4.4.1
HttpClient: http://mvnrepository.com/artifact/org.apache.httpcomponents/httpclient/4.5
答案 1 :(得分:0)
您可以从此处下载:Apache HttpComponents