Mobile CMS Guide for Android

JSON fueled, delivered by Cloud CMS

It's easy to plug Cloud CMS to provide backend services for your applications running on Google Android devices. This page provides details about how Android developers can plug Cloud CMS into their new or existing mobile applications to quickly spin up apps using their preferred Java IDE and SDK.

Getting Started

Download the Cloud CMS Java driver

The Cloud CMS Java driver handles all of the HTTPS calls, data conversions, OAuth2 authorization handshakes and any and all interaction with the Cloud CMS platform in a secure manner.

To get the latest version of the driver, please visit the

Android CMS Hello World

Grab a simple Hello World application using our baseline code at

NOTE: You can either grab a copy of the standalone driver (which is larger but bundles all dependencies into a single JAR file) or utilize Maven (or an equivalent dependency manager) to pull in all of the individual JAR dependencies as you see fit.

Build Process

1) Open your IDE for Android and create a new Android application project with an empty activity. In this guide, we will use Intellij as our IDE. If you prefer to use Eclipse, please follow instructions in the Android’s Building Your First App Guide.

2) Copy the Cloud CMS Java Driver into the libs directory and make sure the libs directory is included in the project libraries.

3) Edit AndroidManifest.xml (which is under project root directory) and add the user permission for android.permission.INTERNET.

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android=""
android:anyDensity="true" />
<uses-permission android:name="android.permission.INTERNET" />
<application android:label="@string/app_name"
<activity android:name="HelloWorldActivity"
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />

4) Edit the activity java class ( ) and add the code for making connection to the Cloud CMS platform.Once the connection is made using the provided credentials, it will then print out a welcome message with the name of the authenticated user.


import android.os.Bundle;
import android.widget.TextView;
import org.gitana.platform.client.AuthInfo;
import org.gitana.platform.client.Gitana;
public class HelloWorldActivity extends Activity {
* Called when the activity is first created.
public void onCreate(Bundle savedInstanceState) {
try {
Gitana gitana = new Gitana("...","...");
// authenticate
gitana.authenticate("demo", "demo");
// check driver properties
AuthInfo authInfo = DriverContext.getDriver().getAuthInfo();
// print out some things about the principal
TextView text = new TextView(this);
text.setText("Hello " + authInfo.getPrincipalName() + ", Welcome to Cloud CMS!");
} catch (Exception e) {

5) Run the project in an Android emulator and we should have a screen which looks like this.

If you haven't already visited the Google Android Developer site, we recommend that you do so to become familiar with Android, the Java SDK and the tools required to build Android applications.

Sign up for Cloud CMS

If you already have a Cloud CMS subscription, you can skip ahead.
Otherwise, be sure to sign up for a trial account first, in order to use Cloud CMS.

API Keys

Every mobile app or web site that you build will need to have a set of API Keys that it will use to connect to your Cloud CMS platform on behalf of your code. These API keys consist of client and user key/secret pairs.

  1. Log in to your Cloud CMS tenant at https://<yourdomain>
  2. From Manage Platform -> API Keys

You will now see your API Keys for all of your platform's Application instances.
You can create as many Application instances as you'd like and each will have their own set of API Keys.

For more information, visit Configuring your API Keys.