Integrate live blog, analytics and real time data services into your Android client applications with speed and efficiency. Our Android SDK helps you focus on the client's implementation of booting, configuring live blog and sending events.
- Minimum Android SDK: Arena Sdk requires a minimum API level of 21.
- Compile Android SDK: Arena Sdk requires you to compile against API 29 or later.
A sample application is available that showcases the majority of the features offered by the Arena SDK.
Integrate the live blog in real time into your Android client applications with speed and efficiency. Our SDK helps you focus on the client's implementation of initializing, configuring and displaying the live blog. Displays all card types in live blog format. We currently support the following cards:
Ask your account manager for your publisher slug
Installing the Live Blog SDK is simple if you’re familiar with using external libraries or SDKs. To install the Live Blog SDK using Gradle, add the following lines to a build.gradle file at the app level.
repositories {
mavenCentral()
}
dependencies {
implementation 'im.arena:liveblog:1.30.0'
}When you build your APK with minifyEnabled true, add the following line to the module's ProGuard rules file.
-keep class im.arena.liveblog.** { *; }
-keep class im.arena.analytics.** { *; }
-keep class im.arena.commons.** { *; }
-keep class im.arena.realtimedata.** { *; }Initialization links the SDK to the Android context, allowing you to respond to connection and status changes. The LiveBlog.setup() method must be called once across your Android client app. It is recommended to initialize the in the onCreate() method of the Application instance.
LiveBlog.configure(APPLICATION)APPLICATION: Base class for maintaining global application state.
To initialize the sdk it is necessary to add the LiveBlog in the xml:
<im.arena.liveblog.LiveBlog
android:id="@+id/live_blog"
android:layout_width="match_parent"
android:layout_height="match_parent" />And start the event watcher by passing the following parameters:
live_blog.start(PUBLISH_SLUG, EVENT_SLUG, LIFECYCLE_OWNER, CLICK_LISTENER)PUBLISH: The publisher slug will be provided by Arena.EVENT_SLUG: Live blog identifierLIFECYCLE_OWNER: A class that has an Android lifecycle. These events can be used by custom components to handle lifecycle changes without implementing any code inside the Activity or the Fragment.CLICK_LISTENER: Interface definition for a callback to be invoked when a view is clicked.
Arena provides a ready-to-use live group chat activity that doesn't require
any development effort and it can power many of the common scenarios.
For more complex use-cases we made available the Kotlin SDK that
provides the infra-structure necessary to build your own chat experience
and at the same time leverage the powerful moderation and backoffice
tools available at the Arena Dashboard.
Installing the Chat SDK is simple if you’re familiar with using external libraries or SDKs. To install the Chat SDK using Gradle, add the following lines to a build.gradle file at the app level.
repositories {
mavenCentral()
}
dependencies {
implementation 'im.arena:chat:1.0.0'
}When you build your APK with minifyEnabled true, add the following line to the module's ProGuard rules file.
-keep class im.arena.chat.** { *; }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 and ROOM_ID, you need to call ArenaChat(SITE_ID, ROOM_ID). This method should be called once in your Android client application. It's recommended to initialize the Activity's onCreate() method.
setContent {
ArenaChat(SITE_ID, ROOM_ID)
}The chat has additional settings that allow clients to view event logs in the terminal, as well as change the running environment:
setContent {
ArenaChat(SITE_ID, ROOM_ID, Environment.DEVELOPMENT)
}The chat internally uses Android's Compose, which allows customers to add and customize the screen where the chat will be embedded. To do this, you need to add the chat to a view in your app, for example:
setContent {
// In here, we can call composables!
MaterialTheme {
Greeting(name = "compose")
}
}After these steps, the chat will be up and running in your app.
Analytics helps you measure your users, product, and business. It unlocks insights into your app's funnel, core business metrics, and whether you have product-market fit.
Installing the Analytics SDK is simple if you’re familiar with using external libraries or SDKs. To install the Analytics SDK using Gradle, add the following lines to a build.gradle file at the app level.
repositories {
mavenCentral()
}
dependencies {
implementation 'im.arena:analytics:1.21.1'
}When you build your APK with minifyEnabled true, add the following line to the module's ProGuard rules file.
-keep class im.arena.analytics.** { *; }
-keep class im.arena.commons.** { *; }
-keep class com.google.firebase.iid.** { *; }The Analytics.configure() method must be called once across your Android client app. It is recommended to initialize the in the onCreate() method of the Application instance.
Analytics
.environment(Environment.PRODUCTION)
.logLevel(LogLevel.NONE)
.configure(CONTEXT, WRITE_KEY)CONTEXT: Base class for maintaining global application state.WRITE_KEY: The write key is the one used to initialize the SDK and will be provided by Arena team
The analysis service offers some types of metrics:
The track() call is how you record any actions your users perform, along with any properties that describe the action.
Each action is known as an event. Each event has a name, like Subscribed, and properties, for example a Subscribed event might have properties like plan or couponCode
Analytics.instance().track("Post Reacted",
hashMapOf<String, String>().apply {
put("postId", "WOR06DvfpcRaylQJoZe")
put("reaction", "thumbs_up")
})EVENT: The name of the eventPROPERTIES: Additional properties that can be sent together with the event
The page() call is how you register the screens that your users see, along with the properties that describe the action.
Analytics.instance().page("Home",
hashMapOf<String, String>().apply {
put("postId", "WOR06DvfpcRaylQJoZeu")
put("reaction", "thumbs_up")
})SCREEN: The name of the screen that was viewedPROPERTIES: Additional properties that can be sent together with the event
identify() lets you tie a user to their actions and record traits about them. It includes a unique User ID and any optional traits you know about them like their email, name, etc.
We recommend to call identify in these situations:
- After a user registers or log in
- When a user updates their info
- After loading a page that is accessible by a logged in user
Analytics.instance().identify("43564gfdrtysdg34234",
hashMapOf<String, String>().apply {
put("name", "John Doe")
put("email", "john@nocompany.com")
put("plan", "business")
})USER_ID: Unique User IDTRAITS: Optional traits you know about them like their email, name, etc.
Using this mode you're controlling how the date will be displayed entirely on your side, we will provide a data stream with all information.
Installing the RealTimeData SDK is simple if you’re familiar with using external libraries or SDKs. To install the RealTimeData SDK using Gradle, add the following lines to a build.gradle file at the app level.
repositories {
mavenCentral()
}
dependencies {
implementation 'im.arena:realtimedata:1.40.0'
}When you build your APK with minifyEnabled true, add the following line to the module's ProGuard rules file.
-keep class im.arena.realtimedata.** { *; }Initialization links the SDK to the Android context, allowing you to respond to connection and status changes. The RealTimeData.setup() method must be called once across your Android client app. It is recommended to initialize the in the onCreate() method of the Application instance.
RealTimeData
.environment(Environment.PRODUCTION)
.logLevel(LogLevel.NONE)
.configure(CONTEXT)CONTEXT: Base class for maintaining global application state.
The real time data service offers some alternatives for customers to consume data:
Real time data listener
RealTimeData
.playByPlay
.realtime(QUERY,
{ success->
},
{ error->
})QUERY: Query to request the information provided through the methodRealTimeData.playByPlay.query(EVENT_KEY)PER_PAGE: Number of items per page
The return of this call is the ListenerRegistration which can be used later to cancel the real time data stream by calling listenerRegistration.remove()
Build the query to retrieve the data.
RealTimeData.playByPlay.query(EVENT_KEY, PRIORITY, ORDER_BY, PER_PAGE, QUERY_INFO)EVENT_KEY: Event identifierPRIORITY: The priority in which elements should be returned:ASCENDINGorDESCENDINGORDER_BY: The order in which elements should be returned:NEWESTorOLDESTPER_PAGE: Number of items per pageQUERY_INFO: The type of query to be performed. We currently only offerPLAY_BY_PLAY
Returns a Query object containing the information needed to perform a real-time or just a single query
We use GitHub Issues as our bug and feature tracker both for code and for other aspects of the library (documentation, the wiki, etc.).
Labels on issues are managed by contributors, you don't have to worry about them. Here's a list of what they mean:
- bug: feature that should work, but doesn't
- enhancement: minor tweak/addition to existing behavior
- feature: new behavior, bigger than enhancement, it gives more bang
- question: no need to modify sdk to fix the issue, usually a usage problem
- duplicate: there's another issue which already covers/tracks this
- wontfix: working as intended, or won't be fixed due to compatibility or other reasons
- non-library: issue is not in the core library code, but rather in documentation, samples, build process, releases
Arena Android SDK is proprietary software, all rights reserved. See the LICENSE file for more info.
Copyright (c) 2022 Arena Im.










