There are 3 samples. Browse Source of all of them. Or view the main file of each sample:
~/Downloads/client_secrets.json)
to src/main/resources/client_secrets.json.
If you skip this step, when trying to run the sample you will get a 400
INVALID_CLIENT error in the browser.
Prerequisites: install Java 6, Mercurial, and Maven. You may need to
set your
JAVA_HOME
.
cd [someDirectory] hg clone https://code.google.com/p/google-api-java-client.samples/ google-api-java-client-samples cd google-api-java-client-samples/analytics-cmdline-sample cp ~/Downloads/client_secrets.json src/main/resources/client_secrets.json mvn compile mvn -q exec:java
To enable logging of HTTP requests and responses (highly recommended when developing), please take a look at logging.properties.
Prerequisites: install Eclipse, the Mercurial plugin, and the Maven plugin.
analytics-cmdline-sample project
[someDirectory]/google-api-java-client-samples/analytics-cmdline-sample
and click "Next"
Note: The default for this project is to run the
HelloAnalyticsApiSample application. You can run the other samples by
updating the
pom.xml
mainClass
attribute for Maven or Right clicking the appropriate file in Eclipse.