In building web service designed to to interact with mobile devices, I am not sure what the best approach is for implementing HTTP requests on Android.
I came across this post, which finishes by stating HttpURLConnection is the preferred method for making HTTP requests, and I have had success using the HttpsURLConnection.
When searching for answers or reading other sample code (even fairly recent posts), all seem to use DefaultHttpClient, which seems to go against the official word from Google.
I am trying to future proof my Android application as much as possible. With that in mind, is the HttpURLConnection the best choice?
DefaultHttpClientis at a higher level of abstraction thanHttpUrlConnection. Either one should be fine based on your needs. If you dont need the control ofHttpUrlConnection, stick with theDefaultHttpClient.