HTTP Integration (Android Only)#
Platform-only: Android.
This page covers HttpURLConnectionProvider timeouts at the Driver Layer. Cookie management is also required for any Android HAAPI integration — regardless of which layer you choose — and is documented under Android Platform Notes .
HttpURLConnectionProvider Timeouts#
When you implement your own HttpURLConnectionProvider to return HttpURLConnection instances, explicitly set connectTimeout and readTimeout. The driver applies sensible defaults when you do not (connectTimeout = 5s, readTimeout = 10s), but the defaults are not appropriate for every deployment.
class MyHttpURLConnectionProvider : HttpURLConnectionProvider {
override fun open(url: URL): HttpURLConnection {
return (url.openConnection() as HttpURLConnection).apply {
connectTimeout = 10_000 // 10 seconds
readTimeout = 30_000 // 30 seconds
// other transport-specific configuration
}
}
}
Explicit timeouts protect against indefinite hangs and let you tune behavior to your network profile — slower mobile networks may need higher read timeouts; high-volume backends may need lower ones.
Related: Android Driver · Android Platform Notes