Quickstart
Get the roomName
for the meeting and the participant's authToken
from our backend APIs (read more about our server APIs here), and pass them to Dyte's client SDK.
There are 2 ways to launch a meeting:
- Activity
- View
The activity based setup is straightforward while using a view requires some additional boilerplate code.
Using Activity
This will launch a fullscreen view with your meeting.
- Kotlin
- Java
import com.dyteclientmobile.MeetingConfig
import com.dyteclientmobile.DyteMeeting
import com.dyteclientmobile.DyteMeetingActivity
// Configure meeting parameters
val config = MeetingConfig()
config.setRoomName("<roomName>")
.setAuthToken("<authToken>")
DyteMeeting.setup(config)
// Launch the activity
val meetingIntent = Intent(this, DyteMeetingActivity::class.java)
startActivity(meetingIntent)
import com.dyteclientmobile.MeetingConfig;
import com.dyteclientmobile.DyteMeeting;
import com.dyteclientmobile.DyteMeetingActivity;
// Configure meeting parameters
MeetingConfig config = new MeetingConfig();
config.setRoomName("<roomName>")
.setAuthToken("<authToken>");
DyteMeeting.setup(config);
// Launch the activity
Intent meetingIntent = new Intent(this, DyteMeetingActivity.class);
startActivity(meetingIntent);
Using View
Using a view allows you more control on how your meeting is rendered, but it comes with setup boilerplate code. The main reason anyone would use a View
based initialization is when they want the meeting to be rendered with custom dimensions and not occupy the full screen like the Activity
.
import com.dyteclientmobile.MeetingConfig;
import com.dyteclientmobile.DyteMeeting;
import com.dyteMobileSdk.DyteInstanceManager;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main_layout);
// Configure meeting parameters
MeetingConfig config = MeetingConfig();
config.setRoomName("<roomName>")
.setAuthToken("<authToken>");
DyteMeeting.setup(config);
View view = DyteMeeting.init(this,width, height);
// Example
ViewGroup viewgroup = findViewById(R.id.main_layout);
viewgroup.add(view);
}
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if (requestCode == OVERLAY_PERMISSION_REQ_CODE) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
if (!Settings.canDrawOverlays(this)) {
// SYSTEM_ALERT_WINDOW permission not granted
}
}
}
if (DyteInstanceManager.instance != null) {
DyteInstanceManager.instance.onActivityResult(this, requestCode, resultCode, data);
}
}
@Override
protected void onPause() {
super.onPause();
if (DyteInstanceManager.instance != null) {
DyteInstanceManager.instance.onHostPause(this);
}
}
@Override
protected void onResume() {
super.onResume();
if (DyteInstanceManager.instance != null) {
DyteInstanceManager.instance.onHostResume(this, this);
}
}
@Override
protected void onDestroy() {
super.onDestroy();
if (DyteInstanceManager.instance != null) {
DyteInstanceManager.instance.onHostDestroy(this);
}
if (DyteInstanceManager.instance != null) {
DyteInstanceManager.unmountApplication();
}
}
public void onRequestPermissionsResult(int requestCode, String[] permissions, int[] grantResults) {
if (DyteInstanceManager.permissionsHandler != null) {
DyteInstanceManager.permissionsHandler.onRequestPermissionsResult(requestCode, permissions, grantResults);
}
}