Daily’s Android Starter Kit is a video conferencing app, which serves as a real-world example of how to integrate our Client SDK for Android into your own products.
We’re releasing the full source code for the starter kit, and you can use this as a base when building your own apps! The kit has been designed with production-readiness in mind. However, in this initial version we recommend adding more user-friendly error handling to suit your specific UX requirements.
For the sake of clarity, we’ve avoided using any third-party libraries (other than the standard layout libraries from Google). If you’re already familiar with Android development, the starter kit should serve as a clear and straightforward demo of how to use our Client SDK for Android.
Open the project in Android Studio using File > Open. Then, select the directory you just cloned. Once the project has finished loading, click the Run button to launch the app!
When the app starts, the Join fragment allows users to enter a meeting URL, change their username, and toggle their camera and microphone inputs.
After joining an empty meeting, WaitingForOthersFragment shows the user’s local camera view.
While in a call, buttons are displayed at the top and bottom of the screen to control input devices, list participants, and leave the call. The visibility of these buttons is toggled when the user taps the screen.
When other participants join the meeting, InCallFragment shows their video tiles in a grid layout.
Up to six participants are displayed at once. If a user’s tile is hidden, it will be shown if they start speaking, replacing one of the existing displayed participants.
The app uses an Android service to manage the call. This ensures that the call continues even if the main activity is closed or sent to the background.
In total there are two services in the app:
DemoCallService — this service owns and operates the CallClient instance, doing everything necessary to manage the call lifecycle, subscribe to participants, manage input settings, and so on.
DemoActiveCallService — this is a foreground service, which means it shows a notification and keeps the app alive while it’s active. This service doesn’t perform any actions by itself, but binds to the DemoCallService instance to ensure that it doesn’t get terminated by the Android system.
DemoCallService lets the various fragments know about the state of the call using the DemoState object, which contains a snapshot of all relevant information. This includes a list of remote participants, a list of available audio devices, and details about the local participant (such as input settings and username).
Because DemoState contains a snapshot of the entire call state, it’s easy for a newly-created activity or fragment to get all the context it needs to set itself up, even if a call is already in progress.
data class DemoState(
val status: CallState,
val localParticipant: ParticipantDetails,
val availableDevices: AvailableDevices,
val activeAudioDeviceId: String?,
val participantCount: Int,
val remoteParticipantsToShow: Map<ParticipantDetails.Id.Remote, ParticipantDetails>,
val activeSpeaker: ParticipantDetails.Id?
The interface consists of a single activity, MainActivity, which shows one of a selection of fragments depending on the current call state: