Skip to content

Commit 3bb3a26

Browse files
authored
Stop hardcoding Netty dependency so example works on Android
Using ManagedChannelBuilder allows GRPC to auto-detect the best transport for the runtime environment on which this code will run.
1 parent 29c223a commit 3bb3a26

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

speech/grpc/src/main/java/com/examples/cloud/speech/AsyncRecognizeClient.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ public static ManagedChannel createChannel(String host, int port) throws IOExcep
8888
GoogleCredentials creds = GoogleCredentials.getApplicationDefault();
8989
creds = creds.createScoped(OAUTH2_SCOPES);
9090
ManagedChannel channel =
91-
NettyChannelBuilder.forAddress(host, port)
91+
ManagedChannelBuilder.forAddress(host, port)
9292
.negotiationType(NegotiationType.TLS)
9393
.intercept(new ClientAuthInterceptor(creds, Executors.newSingleThreadExecutor()))
9494
.build();

0 commit comments

Comments
 (0)