Skip to content

Commit 7222e37

Browse files
authored
cronet: update README for using published grpc-cronet with play service Cronet implementation (#6178) (#6185)
* cronet: update README for using published grpc-cronet with play service Cronet implementation. * doc: Added cronet/README.md version update to RELEASING.md.
1 parent 45f5008 commit 7222e37

File tree

2 files changed

+22
-9
lines changed

2 files changed

+22
-9
lines changed

RELEASING.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,7 @@ Tagging the Release
119119
# Bump documented versions. Don't forget protobuf version
120120
$ ${EDITOR:-nano -w} README.md
121121
$ ${EDITOR:-nano -w} documentation/android-channel-builder.md
122+
$ ${EDITOR:-nano -w} cronet/README.md
122123
$ git commit -a -m "Update README etc to reference $MAJOR.$MINOR.$PATCH"
123124
```
124125
3. Change root build files to remove "-SNAPSHOT" for the next release version

cronet/README.md

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
gRPC Cronet Transport
22
========================
33

4-
**EXPERIMENTAL:** *gRPC's Cronet transport is an experimental API, and is not
5-
yet integrated with our build system. Using Cronet with gRPC requires manually
6-
integrating the gRPC code in this directory into your Android application.*
4+
**EXPERIMENTAL:** *gRPC's Cronet transport is an experimental API, its stability
5+
depends on upstream Cronet's implementation, which involves some experimental features.*
76

87
This code enables using the [Chromium networking stack
98
(Cronet)](https://chromium.googlesource.com/chromium/src/+/master/components/cronet)
@@ -17,13 +16,26 @@ Some advantages of using Cronet with gRPC:
1716
* Robust to Android network connectivity changes
1817
* Support for [QUIC](https://www.chromium.org/quic)
1918

20-
Cronet jars are available on Google's Maven repository. See the example app at
21-
https://github.com/GoogleChrome/cronet-sample/blob/master/README.md. To use
22-
Cronet with gRPC, you will need to copy the gRPC source files contained in this
23-
directory into your application's code, as we do not currently provide a
24-
`grpc-cronet` dependency.
19+
Since gRPC's 1.24 release, the `grpc-cronet` package provides access to the
20+
`CronetChannelBuilder` class. Cronet jars are available on Google's Maven repository.
21+
See the example app at https://github.com/GoogleChrome/cronet-sample/blob/master/README.md.
2522

26-
To use Cronet, you must have the `ACCESS_NETWORK_STATE` permission set in
23+
## Example usage:
24+
25+
In your app module's `build.gradle` file, include a dependency on both `grpc-cronet` and the
26+
Google Play Services Client Library for Cronet
27+
28+
```
29+
implementation 'io.grpc:grpc-cronet:1.24.0'
30+
implementation 'com.google.android.gms:play-services-cronet:16.0.0'
31+
```
32+
33+
In cases where Cronet cannot be loaded from Google Play services, there is a less performant
34+
implementation of Cronet's API that can be used. Depend on `org.chromium.net:cronet-fallback`
35+
to use this fall-back implementation.
36+
37+
38+
You will also need permission to access the device's network state in your
2739
`AndroidManifest.xml`:
2840

2941
```

0 commit comments

Comments
 (0)