KapoorVashisht / osmdroid

Automatically exported from code.google.com/p/osmdroid
0 stars 0 forks source link

Use factory to create http connection #432

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Use factory to create http connection instead of hard-coded Apache 
DefaultClient.

Provide a way of allowing users to provide a different implementation, eg 
OkHttp (http://square.github.io/okhttp).

Original issue reported on code.google.com by neilboyd on 23 May 2013 at 5:15

GoogleCodeExporter commented 8 years ago
With Maven, perhaps it's even easy to use this by default instead of Apache's 
DefaultClient? Maybe we can even drop the apache stuff altogether - I seem to 
recall that taking a big chunk of memory.

Original comment by kurtzm...@gmail.com on 23 May 2013 at 2:35

GoogleCodeExporter commented 8 years ago
I think that's going a bit far, especially as a lot of people don't use Maven.
Let's see how it goes and it will always be easy to change it later.

Original comment by neilboyd on 23 May 2013 at 7:28

GoogleCodeExporter commented 8 years ago
I've finished this and pushed a snapshot to Maven Central

Original comment by neilboyd on 28 May 2013 at 5:01

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
Perhaps it would have been easier to just use URL.setURLStreamHandlerFactory

https://developer.android.com/reference/java/net/URL.html#setURLStreamHandlerFac
tory(java.net.URLStreamHandlerFactory)

https://twitter.com/jessewilson/status/346291677377486850

Although that also requires to use URL.openConnection instead of Apache, which 
is probably not a bad idea anyway.

Original comment by neilboyd on 17 Jun 2013 at 7:44