eclipse导入第三方jar包HttpClient 编译不过问题

我新手,在学着写android应用,想使用HTTPClient客户端开源项目来访问网页。
导入了两个httpclient包:commons-codec-1.6.jar和commons-httpclient-3.1.jar
然后在我的代码中
import org.apache.commons.httpclient.HttpClient;
import org.apache.commons.httpclient.methods.GetMethod;

在访问网络线程中
HttpClient httpclient = new HttpClient();
GetMethod getMethod = new GetMethod("http://www.csdn.net");
int statusCode = httpclient.executeMethod(getMethod);
System.out.println("response=" + getMethod.getResponseBodyAsString());
getMethod.releaseConnection();

问题:
没想到第一句就不能执行,查看log是说找不到HttpClient这个类。
我在网上查了资料说是HttpClient这个库在ADT升级后本身就包含在google源码中,所以产生了冲突……
我不知道如何解决。
具体出错LOG如下:

Could not find class 'org.apache.commons.httpclient.HttpClient', referenced from method com.example.webspider.MainActivity$2.run
VFY: unable to resolve new-instance 553 (Lorg/apache/commons/httpclient/HttpClient;) in Lcom/example/webspider/MainActivity$2;

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值