Mecid
Mecid

Reputation: 4551

How to add google maps v2 sdk to maven project as dependency?

How to add google maps v2 sdk to maven project as dependency? I am using jar file but project need resource. How i can add them?

Upvotes: 0

Views: 3046

Answers (2)

thom_nic
thom_nic

Reputation: 8143

It looks like the Maps v2 API is part of Google Play Services. So from the SDK manager, you need to make sure it's installed (under the 'Extras' category.) Then use the maven-android-sdk-deployer (as Manfred pointed out) to install the extras/google-play-services package. Then use this in your POM:

<dependency>
    <groupId>com.google.android.gms</groupId>
    <artifactId>google-play-services</artifactId>
    <version>7</version>
    <type>apklib</type>
</dependency>
<dependency>
    <groupId>com.google.android.gms</groupId>
    <artifactId>google-play-services</artifactId>
    <version>7</version>
    <type>jar</type>
</dependency>

I noticed this when the maps JAR I was using has the package name com.google.android.maps but the v2 API uses com.google.android.gms.maps

Upvotes: 0

Manfred Moser
Manfred Moser

Reputation: 29912

You should be able to use my Maven Android SDK Deployer to get the the Play services install into your local Maven repository or deployed to your repository manager and then add a apklib dependency to the Google Play Services, which contains the maps stuff.

More at https://github.com/mosabua/maven-android-sdk-deployer

Upvotes: 3

Related Questions