Is there an example or implementation of GRPC server (Java/C++) running on
Android?
I am following grpc java server example to implement the server i
private class GrpcServerTask extends AsyncTask<Void, Void, String>{
@Override
protected void onPreExecute() {
}
@Override
protected String doInBackground(Void... params) {
int port = 50051;
Server server;
try {
server = ServerBuilder.forPort(port)
.addService(new GreeterImpl())
.build()
.start();
} catch (Exception e) {
e.printStackTrace();
}
return null;
}
}
private class GreeterImpl extends GreeterGrpc.GreeterImplBase {
@Override
public void sayHello(HelloRequest req, StreamObserver<HelloReply>
responseObserver) {
HelloReply reply = HelloReply.newBuilder().setMessage("Hello " +
req.getName()).build();
responseObserver.onNext(reply);
responseObserver.onCompleted();
}
}
I keep getting the error
*io.grpc.ManagedChannelProvider$ProviderNotFoundException:
No functional server found. Try adding a dependency on the grpc-netty
artifact*
on executing* new GrpcServerTask().execute();*
Thanks,
Anil
--
You received this message because you are subscribed to the Google Groups
"grpc.io" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/grpc-io.
To view this discussion on the web visit
https://groups.google.com/d/msgid/grpc-io/8640a3a0-7729-4124-83ea-9930da5c1dd8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.