Install a Client Library

If you don't want to write your own code to send HTTP requests and parse the responses, then you need to download a client library.

How to set up a client library varies by programming language. In the following section, select the language you're using for development.

If you want to use a language that isn't available, check the list of client libraries to see if there's a library for your language.

Note: One of the main tasks of the client libraries is converting between JSON and native objects. In the Java library, this is done by a set of classes provided by a jar file. In Python, JSON is converted directly into a dictionary or hash.

Java

Using the Google APIs Client Library for Java requires that you download the core Java client library and the Google Drive Activity API Java library.

This page contains information about getting started with the Drive Activity API using the Google API Client Library for Java. In addition, you may be interested in the following documentation:

Add Library to Your Project

Select your build environment (Maven or Gradle) from the following tabs, or download a zip file containing all of the jars you need:

Download

Download the Drive Activity API v1 Client Library for Java.

See the appsactivity/readme.html file for details on:

  • What the zip file contains.
  • Which dependent jars are needed for each application type (web, installed, or Android application).

The libs folder contains all the of the globally applicable dependencies you might need across all application types.

Python

Using the Google APIs Client Library for Python currently requires that you download and install the Python source.

This page contains information about getting started with the Drive Activity API using the Google API Client Library for Python. In addition, you may be interested in the following documentation:

System requirements

Installing the client library

You can either use a package manager or download and install the Python client library manually:

Managed installation

Use pip or setuptools to manage your installation (you might need to run sudo first):

  • pip (preferred):
    $ pip install --upgrade google-api-python-client
          
  • Setuptools: Use the easy_install tool included in the setuptools package:
    $ easy_install --upgrade google-api-python-client
    

Manual installation

Download the latest client library for Python, unpack the code, and run python setup.py install

App Engine

Because the Python client libraries are not installed in the App Engine Python runtime environment, they must be vendored into your application just like third-party libraries.

To do that, run the following commands:

$ hg clone https://google-api-python-client.googlecode.com/hg/ google-api-python-client
$ cd google-api-python-client
$ sudo python setup.py install

You can now import the classes you will need using the following statements:

from apiclient.discovery import build
from apiclient.oauth import OAuthCredentials

import httplib2
import oauth2 as oauth

PHP

Using the Google APIs Client Library for PHP currently requires that you download and install the PHP source.

To do that, run the following commands:

$ svn checkout http://google-api-php-client.googlecode.com/svn/trunk/ google-api-php-client-read-only
$ cd google-api-php-read-only
$ # Copy the src directory to your working directory.

You can now import the classes you will need using the following statements:

require_once "../src/apiClient.php";

.NET

Using the Google APIs Client Library for .NET requires that you download the core .NET client library and the Google Drive Activity API .NET library. Download the files and add them as references to your project:

You can now import the classes you will need using the following statements:

using Google.Apis.Authentication;
using Google.Apis.Authentication.OAuth2;

Send feedback about...

Google Drive Activity
Need help? Visit our support page.