settings.gradle
file.build.gradle
file.If your project has set , then set in the file to migrate your project to AndroidX and avoid duplicate class conflict.
/app/Manifests/AndroidManifest.xml
, add the following permissions after </application>
.Joining screen
that allows users to create/join the meeting, and another one is Meeting screen
that will show participants like WhatsApp view.You have to set as Launcher activity.
JoinActivity
meetingId
provided./app/res/layout/activity_join.xml
file, replace the content with the following.sampleToken
in JoinActivity
that holds the generated token from the Video SDK dashboard. This token will be used in the Video SDK config as well as generating meetingId.onClick
the event, it will navigate to MeetingActivity
with token and meetingId.createMeeting
method we will generate meetingId by calling API and navigating to MeetingActivity
with token and generated meetingId.RECORD_AUDIO
and CAMERA
. So, we will implement permission logic on JoinActivity
.You'll get error, but don't worry. It will be solved automatically once you create .
MeetingActivity
./app/res/layout/activity_meeting.xml
file, replace the content with the following.Copy required icons from and paste in your project's folder.
JoinActivity
, we need to...meetingId
, participantName
, micEnabled
, webcamEnabled
,participantId
and map of CustomStreamTrack
.meeting.join()
method.Views
:ParticipantEventListener
Abstract Class and add the listener to Participant
class using the addEventListener()
method of Participant
Class. ParticipantEventListener
class has two methods :onStreamEnabled
- Whenever a participant enables mic/webcam in the meeting, This event will be triggered and return Stream
.onStreamDisabled
- Whenever a participant disables mic/webcam in the meeting, This event will be triggered and return Stream
.MeetingEventListener
for listening events such as Meeting Join/Left and Participant Join/Left.changeLocalParticipantView(isMiniView: Boolean)
function first checks whether the video of a local participant is displayed as a MiniView or a LargeView.changeLocalParticipantView(true)
is called. As a result, the local participant is shown as MiniView, while the other participant is shown as LargeView.onDestroy
with the following code:This app only supports 2 participants, it does not manage more than 2 participants. If you want to handle more than 2 participant then checkout our Group call example .
Posted Nov 6, 2023
In this article, I wrote about how to build a 1-on-1 video Android app with Java using the Video SDK with proper SEO and meta tags.