Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Add Google Analytics Library to a Maven Project

Where I can find the Google Analytics Android lib groupId and archetype for my projects pom?

I've been searching for it for a couple of hours, and I can't find any clue...(

P.S. I found something on GitHub, but it seam like it uses an third-party repository (when I try to run mnv install or compile it gives me an error):

<dependency>
  <groupId>com.google.android.analytics</groupId>
  <artifactId>analytics</artifactId>
  <version>2</version>
</dependency>
like image 768
Serj Lotutovici Avatar asked Oct 31 '12 13:10

Serj Lotutovici


2 Answers

You can install all missing android libs using maven-android-sdk-deployer. It installs all extras in local maven repository from android sdk folder. Usage is quite simply: download and run mvn install. Deployer itself doesn't support optional dependencies other than sdk version. You must install all jars via SDK Manager at first.

Update: Upon writing this answer Google has landed updates to SDK Manager and included 2 maven repositories in it: Google Repository and Android Support Repository. All you have to do is add them to repositories list in pom.xml. It provides following artifacts:

  • support library (v4, v13)
  • gridlayout (v7)
  • google play services (3.1.36)

As you can see it doesn't have analytics artifacts, so you still need maven-android-sdk-deployer

like image 106
mente Avatar answered Oct 13 '22 04:10

mente


Starting with Google Analytics SDK v4, Google Analytics is part of Google Play Services. There's no need for a separate dependency anymore.

https://developers.google.com/analytics/devguides/collection/android/changelog

like image 36
Guno Heitman Avatar answered Oct 13 '22 05:10

Guno Heitman