Join Meeting - Android
Overview
After meeting initialization by initMeeting()
it returns a new instance of Meeting
. If you have not initialized a meeting yet, you can follow the guide here. However, by default, it will not automatically join the meeting. Hence, to join the meeting you have to call join()
.
join()
- To join the meeting you can call the
join()
method ofMeeting
class. - This method can be called after the meeting is initialized using
VideoSDK
class.
- Kotlin
- Java
class MainActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)
// initialize the meeting
...
// join meeting
meeting!!.join()
}
}
public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
// initialize the meeting
...
// join meeting
meeting.join();
}
}
Events associated with Join
Following callbacks are received when a participant is successfully joined.
- Local Participant will receive a
onMeetingJoined
event, when successfully joined. - Remote Participant will receive a
onParticipantJoined
event with the newly joinedParticipant
object from the event callback.
- Kotlin
- Java
class MainActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)
// initialize the meeting
...
// join meeting
meeting!!.join()
// Add event listener for listening upcoming events of meeting
meeting!!.addEventListener(meetingEventListener)
}
private val meetingEventListener: MeetingEventListener = object : MeetingEventListener(){
// Event to know meeting is joined
fun onMeetingJoined() {
Log.d("VideoSDK", "onMeetingJoined")
}
// Event to know some other participant joined
fun onParticipantJoined(participant: Participant) {
Log.d("#VideoSDK", participant.displayName + " joined");
}
}
}
public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
// initialize the meeting
...
// join meeting
meeting.join();
// Add event listener for listening upcoming events of meeting
meeting.addEventListener(meetingEventListener);
}
private final MeetingEventListener meetingEventListener=new MeetingEventListener() {
// Event to know meeting is joined
@Override
public void onMeetingJoined() {
Log.d("VideoSDK", "onMeetingJoined");
}
// Event to know some other participant joined
@Override
public void onParticipantJoined(Participant participant) {
Log.d("#VideoSDK", participant.getDisplayName() + " joined");
}
};
}
API Reference
The API references for all the methods and events utilised in this guide are provided below.
Got a Question? Ask us on discord