Skip Navigation

Using the OkHttp HTTP framework

BlackBerry Dynamics SDK for Android
supports the OkHttp API to provide efficient HTTP request handling. The SDK provides the following classes for OkHttp support:
  • BBCustomInterceptor: This class provides support for the OkHttp HTTP framework by using an interceptor that you can add when creating an OkHttpClient object. This interceptor directs HTTP request through the
    BlackBerry Dynamics
    secure communications system. For more information, see the BBCustomInterceptor Class Reference.
  • BBCookieJar: This class provides cookie support for the OkHttp HTTP framework with the BBCustomInterceptor class. With this class, your apps can access cookies that are managed by the
    BlackBerry Dynamics
    Runtime through the BBCookieJar API. Cookies are always stored in the secure container. For more information, see the BBCookieJar Class Reference.
BlackBerry Dynamics
uses OkHttp version 4.9.1.
The following table outlines limitations for OkHttp as of this release:
Caching is not supported in this release.
Proxy servers are supported, but there is no API to set a proxy. It will work if proxies are set in
, either using a PAC file or manually. If proxy authentication is required, this will be done automatically as is the case for the existing HttpClient API. Per-user credentials for a
configured proxy are not currently supported as the 407 responses from the proxy will not be returned.
For more information, see Sending BlackBerry Dynamics app data through an HTTP proxy in the
BlackBerry UEM
administration guide.
  • Third-party authentication interceptors might support NTLM authentication.
  • Kerberos
    authentication using PKINIT or KCD is supported.
  • Kerberos
    and NTLM authentication using user-supplied credentials is supported through BBCustomAuthenticator.
  • SPNEGO is not supported.
Timeouts in OkHttp are separated into connection timeouts, read timeouts, and write timeouts.
BlackBerry Dynamics
OkHttp only supports connection timeouts, and it is not currently possible to change the timeout value.
It is not currently possible to disable HTTPS host/peer certificate verification, or to enforce pinned certificates.