我在项目中创建了一个http请求。我坐着但却没有工作 如此简化以测试它的部分:就是这样:
HttpClient cl = new DefaultHttpClient();
try {
HttpResponse httpResponse = cl.execute(new HttpGet("http://www.google.com"));
System.out.println(httpResponse.getEntity().getContentLength());
}
catch (Exception e)
{
System.out.println("didn't work!");
System.out.println(e.getMessage());
}
但是当我运行它时,我得到了这些:
07-21 15:57:36.203 26851-26851/com.akgradev.upbman W/﹕ Unable to open '/system/framework/qcom.fmradio.jar': No such file or directory
07-21 15:57:36.203 26851-26851/com.akgradev.upbman W/art﹕ Failed to open zip archive '/system/framework/qcom.fmradio.jar': I/O Error
当然,"没有工作!"和" null"用于打印!我很感激 你的提示Tnx
答案 0 :(得分:0)
您是否知道HttpClient
已被弃用?
您的例外可能是API不再受支持的结果。