将 Cronet 和其他库一起使用
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
Cronet 是一款功能强大且灵活的工具,可与其他库结合使用,集实用性、简易性和性能于一身。
ExoPlayer
ExoPlayer 通过其 Cronet 扩展程序原生支持 Cronet。全球一些最大的在线媒体应用(包括 YouTube)都在使用 Cronet。
如需了解详情,请访问 ExoPlayer 网站。
gRPC
Cronet 可用作 Android 上的 gRPC 的传输层。这样一来,您的 Android 应用便可以使用 Chrome 浏览器中使用的同一网络堆栈来创建 RPC。
如需了解详情,请访问 gRPC 代码库。
OkHttp
Cronet 团队提供了一个库,使 OkHttp 用户可以使用 Cronet 作为传输层,从而受益于 QUIC/HTTP3 支持或连接迁移等功能。该库也可以与其他基于 OkHttp 的库(例如 Retrofit、Coil 和 others)结合使用。
如需了解详情,请访问 Cronet Transport for OkHttp 代码库。
Glide
Cronet 是 Glide 的不错默认选择,与 Glide 与标准 Android 网络堆栈的默认集成相比,Cronet 的性能更高。
如需了解详情,请访问 Glide 网站。
Dart
Cronet 可在 Dart 中直接替代 dart:io
软件包。
如需了解详情,请访问 Cronet Dart 绑定代码库,并阅读博文,了解它是如何诞生的!
本页面上的内容和代码示例受内容许可部分所述许可的限制。Java 和 OpenJDK 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-07-27。
[null,null,["最后更新时间 (UTC):2025-07-27。"],[],[],null,["# Use Cronet with other libraries\n\nCronet is a powerful and flexible tool that can be used in combination with\nother libraries, providing the best of utility, simplicity, and performance.\n\nExoPlayer\n---------\n\nExoPlayer natively supports Cronet through its Cronet extension. Cronet is used\nby some of the world's biggest streaming applications, including YouTube.\n\nFor more details, visit the [ExoPlayer site](https://exoplayer.dev/network-stacks.html#cronet).\n\ngRPC\n----\n\nCronet can be used as the transport layer for gRPC on Android. This lets your\nAndroid app make RPCs using the same networking stack as used in the Chrome\nbrowser.\n\nFor more details, visit the [gRPC repository](https://android.googlesource.com/platform/external/grpc-grpc-java/+/refs/heads/master/cronet/).\n\nOkHttp\n------\n\nThe Cronet team provides a library that enables\n[OkHttp](https://square.github.io/okhttp/) users to use Cronet as their\ntransport layer, benefiting from features like QUIC/HTTP3 support or connection\nmigration. The library can also be used with other OkHttp-based libraries\nsuch as [Retrofit](https://square.github.io/retrofit/),\n[Coil](https://coil-kt.github.io/coil/),\nand [others](https://square.github.io/okhttp/works_with_okhttp/).\n\nFor more details, visit the\n[Cronet Transport for OkHttp repository](https://github.com/google/cronet-transport-for-okhttp).\n\nGlide\n-----\n\nCronet is a good default choice with Glide and will provide better performance\nthan Glide's default integration with the standard Android networking stack.\n\nFor more details, visit the [Glide site](https://bumptech.github.io/glide/int/cronet.html).\n\nDart\n----\n\nCronet can be used in Dart as a drop-in replacement for the `dart:io` package.\n\nFor more details, visit the\n[Cronet Dart bindings repository](https://github.com/google/cronet.dart)\nand [read a blogpost](https://unsuitable001.medium.com/package-cronet-an-http-dart-flutter-package-with-dart-ffi-84f9b69c8a24)\nabout how it came to existence!"]]