Google地图仍需要READ_GSERVICES权限吗? [英] Is READ_GSERVICES permission still required for Google Maps?

查看:675
本文介绍了Google地图仍需要READ_GSERVICES权限吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

要将Google地图添加到您的Android应用程序中,您需要包含一些权限:

 <! - 必需 - > 
< uses-permission android:name =android.permission.ACCESS_NETWORK_STATE/>
< uses-permission android:name =android.permission.INTERNET/>
< uses-permission android:name =android.permission.WRITE_EXTERNAL_STORAGE/>
<使用权限android:name =com.google.android.providers.gsf.permission.READ_GSERVICES/>
<! - 可选 - >
< uses-permission android:name =android.permission.ACCESS_COARSE_LOCATION/>
< uses-permission android:name =android.permission.ACCESS_FINE_LOCATION/>

但是,通过检查

 <$ c文档/ android / start#specify_permissionsrel =noreferrer> Google Maps Android API v2 文档$ c> com.google.android.providers.gsf.permission.READ_GSERVICES 

不再需要。我通过从 AndroidManifest.xml 中删除​​它进行测试,地图加载正常,没有任何问题。

所以,我的问题是...... READ_GSERVICES 权限的目的是什么?



注意:即使它已被删除从Google Maps Android API v2文档中,可以在 $ b上找到它$ b Google Maps API for Business 文档。

解决方案

您需要的所有权限 Google Google地图Android API 在文档中


您还必须请求android.permission.WRITE_EXTERNAL_STORAGE权限。


注意:如果您瞄准Android M SDK(23)和最新版本的Goo gle Play服务SDK(8.1),您不再需要WRITE_EXTERNAL_STORAGE。


在下一个Google Play服务SDK版本中,WRITE_EXTERNAL_STORAGE权限的要求将完全从Google地图中删除所以答案是否定的,如果您使用当前最新的GPS,即8.1.0,则不需要它。

To add Google Maps to your android application, you need to include a few permissions:

<!-- Required -->
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES"/>
<!-- Optional -->
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>

However, by checking Google Maps Android API v2 documentation again, I noticed that

com.google.android.providers.gsf.permission.READ_GSERVICES

is no longer required. I tested it by removing it from AndroidManifest.xml and the map is loading fine without any problems.

So, my question is.. what is/was the purpose of READ_GSERVICES permission?

Note: Even though it is removed from Google Maps Android API v2 documentation, it can be found on Google Maps API for Business documentation.

解决方案

All permissions you need for Google Maps Android API are in the docs:

You must also request the android.permission.WRITE_EXTERNAL_STORAGE permission.

Note: If you're targeting the Android M SDK (23) and the latest version of the Google Play services SDK (8.1), you no longer need the WRITE_EXTERNAL_STORAGE.

From the next release of the Google Play services SDK, the requirement for the WRITE_EXTERNAL_STORAGE permission will be completely dropped from the Google Maps Android API.

So the answer is NO, you don't need it if you use current latest GPS, i.e. 8.1.0.

这篇关于Google地图仍需要READ_GSERVICES权限吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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