Locating Longitude and Latitude 的 gradle compile dependency 是什么?

What is the gradle compile dependency for Locating Longitude and Latitude?

我只想将来自 GoogleApi 的依赖项导入到我的项目中,以使用位置获取经度和纬度。

我试图遵循这个 tutorial which they recommend to use the FusedLocationProviderApi,但他们使用 eclipse,所以我使用 android studio,我只想添加该库的依赖项。

我知道如果我在我的 build.gradle 中包含 compile 'com.google.android.gms:play-services:7.5.0' 它将包含我只需要定位经度和纬度的所有服务,我不想使用 compile 'com.google.android.gms:play-services:7.5.0'因为我想让我的方法数量少。

更新:

尝试包含时:

compile 'com.google.android.gms:play-services-location:8.0.0'
compile 'com.google.android.gms:play-services-maps:8.0.0'

我明白了

更新 2

得到它的工作:compile 'com.google.android.gms:play-services-location:8.1.0'

使用 play-services-location 而不是 play-services

但请注意,由于无法解释的原因,play-services-location 取决于 play-services-maps,至少对于 8.1.0 版而言。因此,您也将引入 Maps V2 代码。