-
Notifications
You must be signed in to change notification settings - Fork 1
Getting Started
This quick-start guide will get you up and running with the Khoros Community Android SDK.
- Prerequisites
- Getting app credentials
- Adding the SDK and dependencies to your project
- Building the Core SDK manually
- Initializing the SDK
- Next Steps
This guide assumes you have:
- Access to a Khoros Community instance running version 18.4 or later
- A Community user account with the Manage API Apps permission granted in Community Admin
- Android Studio
To communicate with a Community instance, your app needs to have a client ID and secret. Your app will pass these credentials to your Khoros Community when you initialize the SDK, along with a few other details including your Community URL and your Community tenant ID. You create and manage credentials in Community Admin > System > API Apps.
When creating app credentials in Community Admin, you can also configure:
- Which discussion styles to support when using the Community Android SDK Support UI
- The response limit for messages returned by LiQL queries used with the Support UI components
- Your notification provider and provider key, if using push notifications
Important: Credentials are environment-specific. We recommend generating app credentials in your stage site during development. To point your app at your production community, generate new credentials on your production Community instance, and then click the 'Download' option available next to each API app, a credentials.xml file will be downloaded add that file to
/res/values/
, (See Initializing the SDK for complete instructions.)
To generate app credentials:
-
Go to Community Admin > System > API Apps.
-
Click Create Android App.
-
Enter a Display Name for your app.
-
(Optional) If you want to disable either the Forum or Blog discussion styles, uncheck the associated Enabled Discussion Styles checkbox.
-
(Optional) If desired, change the default Response Limit of items returned from LiQL queries sent by Support UI components. The default is 30 per query. Note that this limit only is only reflected in the UI Support library components. This setting does not affect our core APIs.
-
(Optional) If using Firebase Cloud Messaging, select the Push Notification Adapter type you are using and add your Push Notification Server Key.
-
Click Save.
Your new app appears in the API Apps tab. Your credentials, tenant ID, API proxy host, and Community URL are listed next to the app entry. Click Edit to edit the app configuration. Click Delete to delete your app.

If you haven't already, clone this repository.
The easiest way to add the Community Android SDK to your project is to pull them from JCenter. Simply add jcenter
and google
to the repositories in the root level build.gradle
file, and then add the SDK as a dependency.
While adding jcenter
repository do mention the overloaded jcenter declaration with the url - 'https://dl.bintray.com/lithiumtech/lia-sdk-android' otherwise proper binaries will not be imported.
To add JCenter to the build script:
In Android Studio, open the build.gradle
file for your Android project (the is the top-level build file). The file should look similar to this:
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter{
url 'https://dl.bintray.com/lithiumtech/lia-sdk-android'
}
jcenter()
maven {
url 'https://maven.google.com/'
name 'Google'
}
// any other repositories required
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.3'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
classpath 'com.google.gms:google-services:3.2.0'
}
}
allprojects {
repositories {
jcenter{
url 'https://dl.bintray.com/lithiumtech/lia-sdk-android'
}
jcenter()
maven {
url 'https://maven.google.com/'
name 'Google'
}
// any other repositories required
}
}
In Android Studio, open the build.gradle
file for your module.
Add the following libraries as dependencies:
* `implementation 'com.lithium.community.android:lia-core:1.3.0'`
* `implementation 'com.lithium.community.android:lia-ui:1.3.0'` (Optional. Only required if you will use the UI Support library.)
The entry should look like this:
```gradle
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.lithium.community.android:lia-core:1.3.0' // add core SDK
implementation 'com.lithium.community.android:lia-ui:1.3.0' // add UI SDK
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:2.2.2'
androidTestImplementation 'com.android.support.test:runner:0.5'
}
```
Continue with Initializing the SDK.
In Getting app credentials, we generated a client ID and secret in Community Admin. We need to pass these credentials during app initialization to make the SDK available to your app. This is required to use our core features and our Support UI components.
Initialization steps include:
- Adding your credentials
- Adding initialization code
We describe these steps in Initializing the SDK. Follow the instructions there, and then return to this guide.
Click Run to build your project.
At this point, you're up and running with the Community Android SDK. Next:
- Check out the demo app bundled with the project to see the SDK and UI Support library in action.
- Reading about the Core SDK and Support UI features: