Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

HttpClient configuration with modules #12449

Closed
wants to merge 1 commit into from
Closed

HttpClient configuration with modules #12449

wants to merge 1 commit into from

Conversation

tobrun
Copy link
Member

@tobrun tobrun commented Jul 20, 2018

WIP, alternative approach to #12423. This PR differs from #12423 as it doesn't expose a runtime configuration anymore. Providing an alternative httpclient is done at compile time. To support this kind of functionality, two new modules had to be introduced:

  • MapboxGLAndroidHTTPBase
    • contains the definition of a HttpRequest + interface definition to communicate back to the sdk
  • MapboxGLAndroidHTTP
    • depends on MapboxGLAndroidHTTPBase
    • contains an implementation of the HttpRequest using OkHttp.

How does providing an alternative http client look like for an user:

  • user adds exclude module: 'MapboxGLAndroidHTTP' to their Mapbox SDK dependency declaration
  • user provides an own implementation of HttpRequestImpl in a com.mapbox.mapboxsdk.http package (as example this is now done in the testapp using ion)

Benefits over #12423:

  • we do not need to expose a static configuration, this results in not having to do additional bookkeeping of requests.
  • we can use this integration in combination with current telemetry, we exclude the module that contains the okhttp libary but do not the exclude the okhttp library itself.

cc @mapbox/maps-android

@tobrun tobrun added the Android Mapbox Maps SDK for Android label Jul 20, 2018
@tobrun tobrun added this to the android-v6.4.0 milestone Jul 20, 2018
@tobrun tobrun self-assigned this Jul 20, 2018
@tobrun tobrun mentioned this pull request Jul 20, 2018
5 tasks
@tobrun
Copy link
Member Author

tobrun commented Jul 24, 2018

continuing this in #12468

@tobrun tobrun closed this Jul 24, 2018
@tobrun tobrun deleted the tvn-http-module branch July 24, 2018 14:27
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Android Mapbox Maps SDK for Android
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant