15 #include <android/log.h>
18 #include "examples/protos/helloworld.grpc.pb.h"
19 #include "examples/protos/helloworld.pb.h"
27 class GreeterService :
public helloworld::Greeter::Service {
32 __android_log_print(ANDROID_LOG_INFO,
"DemoServer",
"Line number %d",
34 __android_log_print(ANDROID_LOG_INFO,
"DemoServer",
"Got hello request: %s",
43 extern "C" JNIEXPORT
void JNICALL
48 setenv(
"GRPC_VERBOSITY",
"INFO",
true);
49 __android_log_print(ANDROID_LOG_INFO,
"DemoServer",
"Line number %d",
51 static std::unique_ptr<grpc::Server>
server =
nullptr;
58 if (grpc::experimental::InitializeBinderChannelJavaClass(
env)) {
59 __android_log_print(ANDROID_LOG_INFO,
"DemoServer",
60 "InitializeBinderChannelJavaClass succeed");
62 __android_log_print(ANDROID_LOG_INFO,
"DemoServer",
63 "InitializeBinderChannelJavaClass failed");
76 "binder:example.service",
79 grpc::experimental::binder::SameSignatureSecurityPolicy>(