Using Cronet as Fresco network request library
implementation("io.github.limuyang2:fresco-cronet:1.0.2")
// Add your Cronet dependencies, for example:
implementation("org.chromium.net:cronet-api:141.7340.3")
implementation("org.chromium.net:cronet-common:141.7340.3")
implementation("org.chromium.net:cronet-embedded:141.7340.3")
// 1.Create CronetEngine
val cronetEngine = CronetEngine.Builder(applicationContext)
// ... other config
.build()
// 2.Create CronetNetworkFetcher.
val networkFetcher = CronetNetworkFetcher(cronetEngine)
// Fresco config
val config = ImagePipelineConfig.Builder(this)
.setNetworkFetcher(networkFetcher)
.build()
// 3.init Fresco
Fresco.initialize(this, config)