实施 MobileIron SDK。使用哪个HttpClient?

Implementing MobileIron SDK. Which HttpClient use?

我需要在 Android 应用程序中集成 MobileIron SDK。 该应用程序使用 Retrofit 库。 但是 MobileIron 文档说:

HTTP Redirect for HTTP Tunneling is not supported for the following classes (which do support HTTP Tunnel)

  1. java.net.HttpURLConnection
  2. java.net.ssl.HttpsURLConnection
  3. AndroidHttpClient

HTTP Tunneling when using non-standard libraries such as the following:

  1. com.squareup.okhttp.HttpClient
  2. Apache HttpClient library that has been repackaged under the ch.boye.httpclientandroidlib package

如果文档说我不能使用 HttpURLConnection,我该如何替换应用程序中的 Retrofit?

我认为您可以将 MobileIron AppConnect 7.5.4 用于您的 Retrofit 库,因为 Retrofit 库依赖于 OkHttp API。

Supported APIs

An AppConnect app can use HTTP/HTTPS tunneling only if the app accesses the enterprise server using one of the following APIs:

  • java.net.HttpURLConnection
  • java.net.ssl.HttpsURLConnection
  • Android HttpClient
  • DefaultHTTPClient, using the standard Apache HttpClient library with the org.apache.http.package name

    Note: HTTP/S tunneling is not supported with non-standard libraries such as the Apache HttpClient library repackaged under the ch.boye.httpclientandroidlib package.

  • OkHttpClient

  • ModernHTTPClient in apps built with the Xamarin development platform.