Can someone please show a sample of doing auth for the Google Speech v1beta1 gRPC API on Android?
I'm trying to run the sample code in https://github.com/GoogleCloudPlatform/java-docs-samples/tree/master/speech.
It runs fine on OSX and within Eclipse; when I try on Android I get different results.
Specifically, in the part:
private ManagedChannel createChannel(String host, int port) throws IOException {
try {
...
GoogleCredentials creds = ...
creds = creds.createScoped(OAUTH2_SCOPES);
ManagedChannel channel =
ManagedChannelBuilder.forAddress(host, port)
.intercept(new ClientAuthInterceptor(creds, Executors.newSingleThreadExecutor()))
.build();
I get the complaint that ClientAuthInterceptor is deprecated, and in javadoc for io.grpc.auth
it says "use GoogleAuthLibraryCallCredentials instead", which it appears is from https://github.com/grpc/grpc-java :any examples of success using that?
In OSX/Eclipse I'm using the sample code "as is" while on Android I'm reading the JSON Google credentials from a file, though the credentials returned seem similar.
Thanks!