作者:原野之狼
From:HW
关于GMS,我稍微展开说一下,这里面有些概念比较绕,对于有关术语我使用底色标明出来了。
官方是这样定义GMS的:
Google Mobile Services (GMS) is a collection of Google applications and APIs that help support functionality across devices. These apps work together seamlessly to ensure your device provides a great user experience right out of the box.
简单来说,GMS包含:
我们平时能看得见的那些google系的应用,比如
Google Search,Google Chrome,YouTube,Google Play Store(android的官方应用市场)等等应用。Google Play Services, 也就是GMS定义里讲的API部分,这东西和Google Play Store是两码事,官方是这样讲的:With Google Play services, your app can take advantage of the latest, Google-powered features such as Maps, Google+, and more, with automatic platform updates distributed as an APK through the Google Play store. This makes it faster for your users to receive updates and easier for you to integrate the newest that Google has to offer.
Google Play Services体现为一个APK,如果这东西有安装的话我们在手机的应用列表里就可以看到,和其它应用没有本质区别。另外可以看下其在Google Play Store的描述:Google Play services is used to update Google apps and apps from Google Play. This component provides core functionality like authentication to your Google services, synchronised contacts, access to all the latest user privacy settings and higher quality, lower-powered location based services. Google Play services also enhances your app experience. It speeds up offline searches, provides more immersive maps and improves gaming experiences. Apps may not work if you uninstall Google Play services.
在国外(比如欧洲)销售的手机,以上两部分内容在手机出厂时会内置在手机里,这样手机开机后用户使用
google账号就可以享受到一系列的服务。就像我们在国内使用华为账号就可以享受到一些列服务一样。在国内销售的手机,由于法律的原因,以上第一部分google系的那些应用是没有内置的;第二部分的内容在个别高端机器上有内置,但是由于没有
Google Play Store, 也就下载不了相关应用,同时由于网络管制,对于一般用户也无法从Google Play Store之外的渠道下载那些应用,因此其内置的意义并不大。Client Library,当我们要使用Google Play Services的时候就需要使用这个,从广义上讲,这个也属于GMS的范畴,不过呢,在实体上,这个东西会作为Android Studio开发环境的一部分,然后在构建Application的时候经implementation依赖打包进APK中的Dex文件。google云端服务,比如
Google账号的云端服务,Google Play Store的云端,Google Drive的云端,只是云端服务的东西,在实体上没有体现在手机上。
现在A国禁令,实际上是禁止以上第一、第二、甚至第三部分在手机里内置,这东西对于新发布的手机是有影响的,因为整个生态都破坏了,这事怎么办想必公司有专门团队在研究,在此不做其它猜测。
那么对于已有的手机,有什么影响呢?由于禁令的影响,在新升级的系统里是不能带有GMS的,但是我们原有发布的手机又不能不升级,一升级就得把GMS移除,这就难办了!于是目前有关部门的方案就是,在过渡期升级时把已属于用户的GMS相关内容给搬移到一个新的分区,以后华为不再维护GMS相关的内容。当然我们自己的系统会做相应的适配,会把这个分区的内容映射到系统里并进行加载,具体来讲就是加载Google Play Services这个应用。
现在说一下Client Library的事,严格来讲,这东西也不能带在我们自己开发的APK里,所以我们只能使用compileOnly的方式来构建APK,然后在运行时由系统加载GMS分区的对应Client Library,剥离了Client Library也有潜在风险,这样我们的APK在其它手机上可能会运行不了,因为其它手机不一定会提供Client Library。






































苏公安网备 32011402010933号