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

HttpClient configuration with modules - #12449

Closed
tobrun wants to merge 1 commit into
masterfrom
tvn-http-module
Closed

tobrun wants to merge 1 commit into
masterfrom
tvn-http-module

Conversation

@tobrun

@tobrun tobrun commented Jul 20, 2018 •

Copy link
Copy Markdown
Member

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
tobrun force-pushed the tvn-http-module branch from 3a496b8 to f400615 Compare July 23, 2018 15:58
@tobrun

tobrun commented Jul 24, 2018

Copy link
Copy Markdown
Member Author

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