CommonSenseCode
CommonSenseCode

Reputation: 25420

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

I want to just import into my project the dependencies from GoogleApi to use location to get longitude and latitude.

I was trying to follow this tutorial which they recommend to use the FusedLocationProviderApi, but they use eclipse, so I'm using android studio and I just want to add the dependencies for that library.

I know that if I include compile 'com.google.android.gms:play-services:7.5.0' in my build.gradle it will include all services I only need those for locating long and latitude, I don't want to use compile 'com.google.android.gms:play-services:7.5.0' because I want to keep my methods count low.

UPDATE:

When trying to include:

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

I get

enter image description here

UPDATE 2

Got it working with: compile 'com.google.android.gms:play-services-location:8.1.0'

Upvotes: 0

Views: 517

Answers (1)

CommonsWare
CommonsWare

Reputation: 1007534

Use play-services-location instead of play-services.

Note, though, that for inexplicable reasons, play-services-location depends upon play-services-maps, at least for version 8.1.0. So, you will be pulling in the Maps V2 code as well.

Upvotes: 1

Related Questions