I have a problem creating a new instance of the OkHttpClient class. It takes between 500-600 ms.
import okhttp3.OkHttpClient;
OkHttpClient client = new OkHttpClient();
I have a problem only on Motorola TC55 with Android api 16. I use the OkHttp library in version 3.8.1. The other devices I've tried worked normally and created the instance immediately.
I also tried the OkHttp library in version 2.4.0 on device Motorola TC55 and the creation of instance was immediately.
From the tracer is obvious that it slows down the loading of the keystore.
It's most likely initializing the SSL socket factory, trust manager and certificate chain cleaner that is slow. Cleaning the certificate chain is new since OkHttp 2.7.5. This code works around a potential security problem.
Your best mitigation is to reuse the same OkHttp client instance for all requests. Or try to find a way to optimize the certificate chain cleaner in API 16.