2

I noticed there are new class in the android.net.http package. Some of them are added in API 34, also in the S Extensions 7. I encountered the HttpEngine class in the package, the summary says that

An engine to process UrlRequests, which uses the best HTTP stack available on the current platform. An instance of this class can be created using HttpEngine.Builder.

Is this class noteworthy? What is meant by "best HTTP stack", would it perform better than typical HTTP client we use like OkHttp?

1 Answer 1

3

HttpEngine is an Android SDK version of Cronet: https://developer.android.com/develop/connectivity/cronet

It is essentially the same networking client that powers Google Chrome and other Chromium-based browsers. It offers HTTP/3, and performs very well when connection is low quality, or a phone is on the move and switching between different networks.

Cronet has been around for many years, but its now introduced into the SDK and much easier to link with. There isn't a ton of documentation specific for it yet, because API 34 is <15% of the market - but everything written for Cronet should work with HttpEngine, and there are more updates coming as more devices are getting the relevant update.

Sign up to request clarification or add additional context in comments.

1 Comment

API 34 is <15% of the market —it's actually supported from API 31 with play services (extension 7), which has a bit more than 15%.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.