candrews
Feb 20th, 2012, 08:34 PM
Google recommends that all new projects use HttpUrlConnection for Http(s) communication: http://android-developers.blogspot.com/2011/09/androids-http-clients.html - at least, unless you're targeting Froyo and earlier, then things get murky. I see that Spring Android, after the M4 release, started detecting the version of Android and choosing to use HttpClient or HttpUrlConnection as appropriate to avoid that problem.
I notice that the bug tracker also has a few issues about disable connection reuse on certain versions of Android, problems with inefficient gzip, etc
I noticed these problems, so I decided to separate out the HttpUrlConnection support from AOSP's ICS release and make it into a library (https://github.com/candrews/HttpResponseCache) (which is already in Maven Central, BTW). If you use this library, you not only get caching (which was my primary original intent), but also the entire ICS HttpUrlConnection stack, including transparent gzip, functional connection pooling/reuse, etc regardless of what version of Android is being run.
Jesse Wilson, developer on the Android/Dalvik project, helped me with this project and recommends it: https://plus.google.com/106557483623231970995/posts/8yMMcvJgSwJ
I think using this library would eliminate a lot of problems, reduce the number of areas Spring Android has to concern itself with, and provide a better developer experience. You could say something like, "if you're targeting Android before ICS, include and use the library, otherwise, you can, but don't have to do so."
I notice that the bug tracker also has a few issues about disable connection reuse on certain versions of Android, problems with inefficient gzip, etc
I noticed these problems, so I decided to separate out the HttpUrlConnection support from AOSP's ICS release and make it into a library (https://github.com/candrews/HttpResponseCache) (which is already in Maven Central, BTW). If you use this library, you not only get caching (which was my primary original intent), but also the entire ICS HttpUrlConnection stack, including transparent gzip, functional connection pooling/reuse, etc regardless of what version of Android is being run.
Jesse Wilson, developer on the Android/Dalvik project, helped me with this project and recommends it: https://plus.google.com/106557483623231970995/posts/8yMMcvJgSwJ
I think using this library would eliminate a lot of problems, reduce the number of areas Spring Android has to concern itself with, and provide a better developer experience. You could say something like, "if you're targeting Android before ICS, include and use the library, otherwise, you can, but don't have to do so."