Android native使用gRPC通信的一种实现方式

目标是在Android上使用gRPC进行通信,当然是在Android的Native层的需求,应用层要使用gRPC会方便的多,搜一下资源,build.gradle配置一下依赖就能用了。下面在Ubuntu系统中来编译在Android Native运行的gRPC的库,分为:
1 下载gRPC源码
2 使用Android源码自带的编译工具编译gRPC
3 使用gRPC

下载gRPC源码

在github下载gRPC项目,然后更新子模块:

git clone https://gitee.com/githubplus/grpc.git
cd grpc
git tag
git checkout v1.20.0

更新submodule:

git submodule update --init

直接更新速度特别慢,甚至n次的中断,不知道什么岁月才能更新完,因此请修改.gitmodules文件,替换其中的github源为gitee源

vim .gitmodules

// replace content in .gitmodules
[submodule "third_party/zlib"]
	path = third_party/zlib
	url = https://gitee.com/githubplus/zlib
	# When using CMake to build, the zlib submodule ends up with a
	# generated file that makes Git consider the submodule dirty. This
	# state can be ignored for day-to-day development on gRPC.
	ignore = dirty
[submodule "third_party/protobuf"]
	path = third_party/protobuf
	url = https://gitee.com/githubplus/protobuf.git
	branch = 3.0.x
[submodule "third_party/gflags"]
	path = third_party/gflags
	url = https://gitee.com/githubplus/gflags.git
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值