Add Android SDK to your app
Add the SDK
Using Gradle
- Open your application level 'build.gradle'
- Add the 'Comment System' gradle dependency
implementation 'im.arena:commentsystem:1.0.0'- Sync your project
Using Maven
<dependency>
<groupId>im.arena</groupId>
<artifactId>commentsystem</artifactId>
<version>1.0.0</version>
</dependency>Install the Comment System SDK
Installing the Comment System SDK is simple if you’re familiar with using external libraries or SDKs. To install the Comment System SDK using Gradle, add the following lines to a build.gradle file at the app level.
repositories {
mavenCentral()
}
dependencies {
implementation 'im.arena:commentsystem:1.0.0'
}Configure ProGuard to shrink code and resources
When you build your APK with minifyEnabled true, add the following line to the module's ProGuard rules file.
-keep class im.arena.commentsystem.** { *; }
Setup SDK
To initialize the SDK, you'll need the SITE_ID and ROOM_ID, both available in the Arena Dashboard or using the Platform API.
You can find your site's slug in the dashboard settings: https://dashboard.arena.im/settings/site.
After retrieving the:
- SITE_ID,
- THREAD_ID
- THREAD_PROFILE_ID
- URL
- PAGE_TITLE
You need to call ArenaCommentSystem(SITE_ID URL, PAGE_TITLE, THREAD_ID). This method should be called once in your Android client application. It's recommended to initialize the Activity's onCreate() method. The comment system has additional settings that allow clients to view event logs in the terminal, as well as change the running environment:
setContent {
ArenaCommentSystem(SITE_ID, URL,PAGE_TITLE,THREAD_ID,THREAD_PROFILE_ID)
}The comment system internally uses Android's Compose, which allows customers to add and customize the screen where the comment system will be embedded. After these steps, the chat will be up and running in your app.
Updated 12 days ago