问题
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 ???
回答1:
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.
For example, instead of:
import com.google.api.client.http.HttpResponse;
Make sure you continue to use this:
import org.apache.http.HttpResponse;
来源:https://stackoverflow.com/questions/15537731/httpclient-from-apache-in-android