Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Sendbird Calls for Android sample, guiding you to build a real-time voice and video calls quickly and easily.

NotificationsYou must be signed in to change notification settings

sendbird/quickstart-calls-directcall-android

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

58 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PlatformLanguages

Download: Google Play

Introduction

Sendbird Calls SDK for Android is used to initialize, configure, and build voice and video calling functionality into your Android client app. In this repository, you will find the steps you need to take before implementing the Calls SDK into a project, and a sample app which contains the code for implementing voice and video call.

More about Sendbird Calls for Android

Find out more about Sendbird Calls for Android onCalls for Android doc. If you need any help in resolving any issues or have questions, visitour community.


Before getting started

This section shows you the prerequisites you need for testing Sendbird Calls for Android sample app.

Requirements

The minimum requirements for Calls SDK for Android sample are:

  • Android 4.1 (API level 16) or higher
  • Java 8 or higher
  • Gradle 3.4.0 or higher
  • Calls SDK for Android 1.5.1 or higher

For more details oninstalling and configuring the Calls SDK for Android, refer toCalls for Android doc.


Getting started

If you would like to try the sample app specifically fit to your usage, you can do so by following the steps below.

Create a Sendbird application

  1. Login or Sign-up for an account onSendbird Dashboard.
  2. Create or select a calls-enabled application on the dashboard.
  3. Note your Sendbird application ID for future reference.

Create test users

  1. On the Sendbird dashboard, navigate to theUsers menu.
  2. Create at least two new users: one as acaller, and the other as acallee.
  3. Note theuser_id of each user for future reference.

Specify the Application ID

To run the sample Android app on the Sendbird application specified earlier, your Sendbird application ID must be specified. On the sample client app’s source code, replaceSAMPLE_APP_ID withAPP_ID which you can find on your Sendbird application information.

publicclassBaseApplicationextendsApplication {    ...privatestaticfinalStringAPP_ID ="SAMPLE_APP_ID";    ...    }

Build and run the sample app

  1. Build and run the sample app on your Android device.
  2. Install the application onto at least two separate devices for each test user you created earlier.
  3. If there are no two devices available, you can use an emulator to run the application instead.

For more detail on how to build and run an Android application, refer toAndroid Documentation.


Making your first call

How to make a call

  1. Log in to the sample app on the primary device with the user ID set as thecaller.
  2. Log in to the sample app on the secondary device using the ID of the user set as thecallee. Alternatively, you can also use the Calls widget found on the Calls dashboard to log in as thecallee.
  3. On the primary device, specify the user ID of thecallee and initiate a call.
  4. If all steps are followed correctly, an incoming call notification will appear on the device of thecallee.
  5. Reverse the roles. Initiate a call from the other device.
  6. If the two testing devices are near each other, use headphones to make a call to prevent audio feedback.

Advanced

Create a local video view before accepting an incoming call

You can create how the current user’s local video view will show on the screen before accepting an incoming call. Follow the steps below to customize the current user’s local video view:

  1. Start your call activity with an incoming call ID in theonRinging() method within the class where you implement code for receiving a call.
  2. Get theDirectCall object with the incoming call ID within theonCreate() method of the call activity class.
  3. Get theSendBirdVideoView object from thexml file of your call activity to add a local video view.
  4. Call theDirectCall.setLocalVideoView() method by using theSendBirdVideoView object within the call activity class.
// {YourApplication}.ktSendBirdCall.addListener("${UUID.randomUUID()}",object:SendBirdCallListener() {overridefunonInvitationReceived(invitation:RoomInvitation) {}overridefunonRinging(call:DirectCall) {...val intent=Intent(applicationContext,YourCallActivity::class.java)                    intent.putExtra("EXTRA_INCOMING_CALL_ID", call.getCallId())...                    applicationContext.startActivity(intent)                }            })// {YourCallActivity}.ktoverridefunonCreate(savedInstanceState:Bundle?) {super.onCreate(savedInstanceState)...val callId= intent.getStringExtra("EXTRA_INCOMING_CALL_ID")val call=SendBirdCall.getCall(callId)...val localVideoView= findViewById(R.id.video_view_fullscreen)    call.setLocalVideoView(localVideoView)}
// {activity_your_call}.xml<?xml version="1.0" encoding="utf-8"?><RelativeLayoutxmlns:android="http://schemas.android.com/apk/res/android"android:layout_width="match_parent"android:layout_height="match_parent">                ...                <com.sendbird.calls.SendBirdVideoViewandroid:id="@+id/video_view_fullscreen"android:layout_width="match_parent"android:layout_height="match_parent" />                ...</RelativeLayout>

Sound Effects

You can use different sound effects to enhance the user experience for events that take place while using Sendbird Calls.

To add sound effects, use theSendBirdCall.Options.addDirectCallSound(SendBirdCall.SoundType soundType, int resId) method for the following events: dialing, ringing, reconnecting, and reconnected. Remember to set sound effects before the mentioned events occur. To remove sound effects, use theSendBirdCall.Options.removeDirectCallSound(SendBirdCall.SoundType soundType) method.

// Play on a caller’s side when making a call.SendBirdCall.Options.addDirectCallSound(SendBirdCall.SoundType.DIALING,R.raw.dialing)// Play on a callee’s side when receiving a call.SendBirdCall.Options.addDirectCallSound(SendBirdCall.SoundType.RINGING,R.raw.ringing)// Play when a connection is lost, but the SDK immediately attempts to reconnect.SendBirdCall.Options.addDirectCallSound(SendBirdCall.SoundType.RECONNECTING,R.raw.reconnecting)// Play when the connection is re-established.SendBirdCall.Options.addDirectCallSound(SendBirdCall.SoundType.RECONNECTED,R.raw.reconnected)

To make the dialing sound play when the device is on silent or vibrate mode, use the method below.

SendBirdCall.Options.setDirectCallDialingSoundOnWhenSilentOrVibrateMode(true)

Reference

For further detail on Sendbird Calls for Android, refer toSendbird Calls SDK for Android README.

About

Sendbird Calls for Android sample, guiding you to build a real-time voice and video calls quickly and easily.

Topics

Resources

Stars

Watchers

Forks

Contributors7


[8]ページ先頭

©2009-2025 Movatter.jp