Prebuilt Quickstart

Overview

This guide will walk you through the steps to create a video conferencing app using Prebuilt component of the room-kit package.

Prerequisites

  • Android: A basic familiarity with Android is required to follow this guide.
  • 100ms account: You need to have a 100ms account to create a room and get a room-code. You can create a 100ms account here.
  • Room-code: Prebuilt components require a room-code to join a room. You can get a room-code for a room using the 100ms dashboard. Refer to this guide to learn more about room codes.

Start a New Android Project (or use an existing one)

Here's how to create a new Android project.

Install Roomkit

The room-kit library is available on Maven. Add it your app level build.gradle in the dependencies block.

Latest Version:

dependencies { .... implementation "live.100ms:room-kit:$GET_VERSION_FROM_ABOVE_BADGE" }

Add the Prebuilt Component

Look up how to get room code in this guide.

import live.hms.roomkit.ui.HMSRoomKit
import live.hms.roomkit.ui.HMSPrebuiltOptions
class MainActivity : AppCompatActivity() { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) val roomCode = "<room-code>" val userName = "<my-name>" val options = HMSPrebuiltOptions(userName)
HMSRoomKit.launchPrebuilt(roomCode, this, options)
} }

Launch the App

You will see a preview of your own video and can turn it on or off.

Preview

Join a Room

Here's what joining a room with another person looks like.

Join

Additional Parameters

Additional properties that can be specified in HMSPrebuiltOptions are userName and userId.

Username: The user's display name. UserId: An id that you may choose so that peers on 100ms can be associated with customers identifiers from your system.

class HMSPrebuiltOptions { val userName : String?, //Peer user name val userId: String?, // Optional Customer given User-id }

Sample Code

The sample project for the library is at https://github.com/100mslive/AndroidPrebuiltDemo#readme you can download the app for it here.


Have a suggestion? Recommend changes ->

Was this helpful?

1234