docs/doc/reference/com/google/android/exoplayer2/ext/cronet/CronetUtil.html
Package com.google.android.exoplayer2.ext.cronet
[@Deprecated](https://developer.android.com/reference/java/lang/Deprecated.html "class or interface in java.lang")public final classCronetUtilextends[Object](https://developer.android.com/reference/java/lang/Object.html "class or interface in java.lang")
Deprecated. com.google.android.exoplayer2 is deprecated. Please migrate to androidx.media3 (which contains the same ExoPlayer code). See the migration guide for more details, including a script to help with the migration.
Cronet utility methods.
All Methods Static Methods Concrete Methods Deprecated Methods | Modifier and Type | Method | Description |
| --- | --- | --- |
| static org.chromium.net.CronetEngine | buildCronetEngine(Context context) |
Deprecated.
Builds a CronetEngine suitable for use with CronetDataSource.
|
| static org.chromium.net.CronetEngine | buildCronetEngine(Context context, String userAgent, boolean preferGooglePlayServices) |
Deprecated.
Builds a CronetEngine suitable for use with CronetDataSource.
|
-
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
@Nullable
public static org.chromium.net.CronetEngine buildCronetEngine([Context](https://developer.android.com/reference/android/content/Context.html "class or interface in android.content")context)
Deprecated.
Builds a CronetEngine suitable for use with CronetDataSource. When choosing a Cronet provider to build the CronetEngine, disabled providers are not considered. Neither are fallback providers, since it's more efficient to use DefaultHttpDataSource than it is to use CronetDataSource with a fallback CronetEngine.
Note that it's recommended for applications to create only one instance of CronetEngine, so if your application already has an instance for performing other networking, then that instance should be used and calling this method is unnecessary. See the Android developer guide to learn more about using Cronet for network operations.
Parameters:context - A context.Returns:The CronetEngine, or null if no suitable engine could be built.
-
@Nullable
public static org.chromium.net.CronetEngine buildCronetEngine([Context](https://developer.android.com/reference/android/content/Context.html "class or interface in android.content")context,
@Nullable[String](https://developer.android.com/reference/java/lang/String.html "class or interface in java.lang")userAgent,
boolean preferGooglePlayServices)
Deprecated.
Builds a CronetEngine suitable for use with CronetDataSource. When choosing a Cronet provider to build the CronetEngine, disabled providers are not considered. Neither are fallback providers, since it's more efficient to use DefaultHttpDataSource than it is to use CronetDataSource with a fallback CronetEngine.
Note that it's recommended for applications to create only one instance of CronetEngine, so if your application already has an instance for performing other networking, then that instance should be used and calling this method is unnecessary. See the Android developer guide to learn more about using Cronet for network operations.
Parameters:context - A context.userAgent - A default user agent, or null to use a default user agent of the CronetEngine.preferGooglePlayServices - Whether Cronet from Google Play Services should be preferred over Cronet Embedded, if both are available.Returns:The CronetEngine, or null if no suitable engine could be built.