问题描述
限时送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:关键词]
发布评论