我已经用Java开发的桌面应用程序,现在我需要开发相同的应用程序到Android。 在我的Java应用程序中,我用了HttpClient库来自Apache,使所有HTTP事务,我的问题是:我可以使用相同的类HttpUtil,我已经用我的Java应用程序与HttpClient的我的新Android应用???
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 ???
是的。许多,大多数或所有的code可以在Android的工作。只要确保继续使用Apache的进口,而不是谷歌的(近)当量。
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;
请确保您继续使用这样的:
Make sure you continue to use this:
import org.apache.http.HttpResponse;