Cloud Connected

"The only difference between Cloud CMS and your current on-premise document repository is that you don't have to worry about software or hardware installation and upgrades any longer."
Jeff Potts, Founder
Metaversant Group

Cloud CMS - Mobile CMS for Android Developers

Android is one of the world’s most popular mobile platforms for creating apps, games, and other digital content. If you are an Android developer and looking for a CMS to empower your app, take a look at Cloud CMS, an ideal cloud based content platform for Mobile development.

This blog provides details about how you can easily plug Cloud CMS into your new or existing Android applications.

To build a Android application that uses Cloud CMS as its content platform, all you need to do is to take a few simple steps:

Step 1 : Sign up with Cloud CMS

Cloud CMS offers a free sandbox account that you can use to play around with Cloud CMS at no cost. For the purposes of this guide, we’ll use this free sandbox account to connect and work with the APIs.

On the other hand, for your own private projects, you’ll want to first sign up with Cloud CMS for a free trial or a subscription account. If you have already signed up, then you can just substitute your own account details in the appropriate places.

Since Cloud CMS supports OAuth2 for platform authorization, you will need both client credential and user credential for your application.

To locate your client credential, sign in your Cloud CMS console and browse to Clients page and then select a client for authentication. From client dashboard page, you will find its key/secret pair.

For user credential, you can either use its username/password pair or any authentication grant that you have setup for that user.

Step 2 : Download Cloud CMS Java driver

Cloud CMS Java driver handles all HTTP/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 Java Driver for Cloud CMS page.

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.

Step 3 : Build Cloud CMS powered Android applications

Let us first build a simple Hello World application (click here to download the full project).

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.

All source code of this HelloWorld example and other examples can be downloaded from

GitHub Project for Cloud CMS Android Examples

To learn more about using Cloud CMS Java driver, you can also check out our documentation site.

Share this post

comments powered by Disqus