G Suite APIs for Android

Although it is recommended that G Suite APIs are called from a server using server-side authentication, these APIs can also be called using the Android SDK.

Follow the following guides to setup an Android project with the Google API Client Library for Java.


Prepare the Project

In your Android project, include a build.gradle file with dependencies such as these:

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'com.android.support:appcompat-v7:25.0.1'
    compile 'com.google.android.gms:play-services-auth:15.0.1'
    compile 'pub.devrel:easypermissions:0.3.0'
    compile('com.google.api-client:google-api-client-android:1.23.0') {
        exclude group: 'org.apache.httpcomponents'
    compile('com.google.apis:google-api-services-<API>-<VERSION>') {
        exclude group: 'org.apache.httpcomponents'

Be sure to replace the API and VERSION with the G Suite API and version. For example, the Google Slides API would have the target compile 'com.google.apis:google-api-services-slides:v1-rev294-1.23.0'.

Once the service is authenticated, executing the API call is the same as shown in any of the G Suite Java quickstarts.

Further Reading