Getting Started with Catalyst SDK for Android

Table of Contents:

  1. Overview
  2. Prerequisites
  3. Setup

Overview

The Catalyst SDK for Android is the easiest way to integrate your Android app with Catalyst. It enables accessing various Catalyst components in your Android app.

Prerequisites

  1. Android studio (3.1.1 or later)
  2. Virtual device in AVD manager() (or) any physical Android device.

Setup

Create a Catalyst Project

Before adding Catalyst SDK to your iOS app, you will need to create a Catalyst project.

  1. In the Catalyst Console, click Create New Project and enter a Project name in the pop-up window. Read and accept the terms and conditions, click Create.
  2. If you have an existing Catalyst project, you can access the same from the Catalyst home.
  3. Once your project has been created, click Access Project that redirects you to the home page of the project components.

Register your Android app with Catalyst

After creating a Catalyst project, you can add your Android app to it.

  1. From your Catalyst project home, click Settings located in the top right corner.
  2. In the Settings Page, select Developer Tools.
  3. Click the Android option from the above screen which opens an Android SDK pop-up window.
  4. Provide the Package Name , Redirect URL and click Download.
    Note:  Redirect URL must be in lower case alphabets. Particularly, special characters and numbers are not allowed.
  5. This will download a sample android project with all the required Catalyst dependencies.

Setup your Android Studio

  1. Unpack the downloaded android project.
  2. Import the project in Android Studio selecting the Open an existing Android Studio project option.
  3. Select the unpacked android project and open.
    Note:  Catalyst SDK is added to your project by default.

Initialize Catalyst in your App

To initialize Catalyst in your app,

  1. Open the MainActivity.java from your project.
  2. Paste the following code to Initialize Catalyst,
    ZCProjectConfig projectConfig = ZCProjectConfig.newBuilder().setProjectId(PROJECT_ID).setProjectKey(“PROJECT_KEY”).build();
    ZCProject.initProject(projectConfig);
  3. Enter the PROJECT_IDandPROJECT_KEYfrom your catalyst project. You can get your PROJECT_ID from General settings and ZAID (PROJECT_KEY) from Environments settings.
Note:
  1. When you are using Catalyst components in your app, define them asAsynchronous classes.
  2. All the catalyst components except the User Management APIs require Catalyst Authentication. Therefore it is mandatory to extend the Catalyst Base class in your Activity that will present the application Login/Logout where the authentication is achieved.