Import package to use this class.

Instrumenting OkHttpClient (Beta)

Apteligent Android SDK offers users the ability to instrument OkHttpClients to collect network insights.

Enables OkHttpClient instrumentation to collect network insights. It must be called on the main UI thread after the OkHttpClient is set. Once the method is invoked, Apteligent will automatically log network calls made with the returned instrumented client to the Network Insights page of the Web Portal.

Here’s an example of how to instrument a client:

OkHttpClient uninstrumentedClient = new OkHttpClient();
OkHttpClient instrumentedClient = Crittercism.getNetworkInstrumentation().instrumentOkHttpClient(uninstrumentedClient);
// now you can use the instrumented client for network calls (on a different thread)
public OkHttpClient instrumentOkHttpClient(OkHttpClient client)
Introduced in Android SDK 5.8.11-beta11. Requires OkHttp 3.3.0 and above.