Android中来自apache的HttpClient?

编程入门 行业动态 更新时间:2024-10-27 13:31:10
本文介绍了Android中来自apache的HttpClient?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

限时送ChatGPT账号..

我已经使用 Java 开发了一个桌面应用程序,现在我需要为 Android 开发相同的应用程序.在我的 java 应用程序中,我使用 apache 中的 httpclient 库来进行所有 http 事务,我的问题是:我可以在我的新 Android 应用程序中使用我在 java 应用程序中使用的相同类 HttpUtil 和 HttpClient ???

I already have developed an desktop application using Java and now I need to develop the same application to Android. In my java application I've used the httpclient library from apache to make all http transactions, my question is: Can I use the same class HttpUtil that I've used in my java application with HttpClient in my new Android app ???

推荐答案

是的.您的大部分、大部分或全部代码都可以在 Android 中运行.只需确保继续使用 Apache 导入,而不是 Google 的(几乎)等效项.

Yes. Much, most, or all of your code can work in Android. Just make sure to continue using the Apache imports and not Google's (near) equivalents.

例如,代替:

import com.google.api.client.http.HttpResponse;

确保您继续使用它:

import org.apache.http.HttpResponse;

这篇关于Android中来自apache的HttpClient?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

更多推荐

[db:关键词]

本文发布于:2023-04-19 14:30:38,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/963800.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:Android   apache   HttpClient

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!