Google/Firebase android SDK是否使用GRPC? [英] Does Google/Firebase android SDKs use GRPC?

查看:305
本文介绍了Google/Firebase android SDK是否使用GRPC?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

最近,我一直在将GRPC API集成到大小敏感的Android应用中.该API仅进行了两次Unary调用.我注意到生成的APK的io.grpc(613KB)& io.opencensus(178.9KB),使用Proguard分别进一步减小到387.2KB和39.4KB.我注意到Proguard能够从APK中删除许多与流媒体通话相关的类/方法.但是,我注意到该应用程序已经具有com.google.protobuf软件包,我怀疑该软件包来自Firebase SDK之类的东西.

Recently I've been working on integrating a GRPC API in a size sensitive android app. The API only had a couple of Unary calls. I noticed that the resulting APK had io.grpc (613KB) & io.opencensus (178.9KB) which was further reduced to 387.2KB and 39.4KB respectively using Proguard. I noticed that Proguard was able to remove many streaming call related classes/methods from the APK. However, I noticed that the app already had com.google.protobuf package, which I suspect is from something like Firebase SDK.

如果Firebase SDK导入了com.google.protobuf,为什么它不需要io.grpc进行运输?它还会使用其他东西吗?

If Firebase SDK imported com.google.protobuf, why didn't it need io.grpc for transport? Does it use something else?

推荐答案

某些Firebase SDK将protobuf协议用作其内部通信的一部分.首先想到的是Firebase Analytics,但还有其他一些.

The protobuf protocol is used by some Firebase SDKs as part of their internal communications. The first one that comes to mind is Firebase Analytics, but there are others too.

Firebase中的Cloud Firestore SDK使用grpc作为其传输协议的一部分.如果您不使用Cloud Firestore,那么据我所知,不会包含grpc库.

The Cloud Firestore SDK in Firebase uses grpc as part of its transport protocol. If you're not using Cloud Firestore then the grpc library will not be included as far as I know.

为确保删除未使用的方法,请确保在发布版本中使用ProGuard.

To ensure that unused methods are removed, be sure to use ProGuard as part of your release build.

这篇关于Google/Firebase android SDK是否使用GRPC?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆