logo
On this page

Quick start


Prepare the environment

Before you attempt to integrate the SDK, make sure that the development environment meets the following requirements:

  • Android Studio 2020.3.1 or a higher version.
  • Android SDK 25, Android SDK Build-Tools 25.0.2, and Android SDK Platform-Tools 25.x.x or higher versions.
  • An Android device running Android 4.4 or higher that supports audio and video.
  • The Android device is connected to the Internet.

Integrate the SDK

  1. Add ZegoUIKitPrebuiltVideoConference as dependencies

    a. Add the jitpack configuration.

    If your Android Gradle Plugin is 7.1.0 or later: enter your project's root directory, open the settings.gradle file to add the jitpack to dependencyResolutionManagement > repositories like this:

    settings.gradle
    dependencyResolutionManagement {
       repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
       repositories {
          google()
          mavenCentral()
          maven { url 'https://storage.zego.im/maven' }   // <- Add this line.
          maven { url 'https://www.jitpack.io' } // <- Add this line.
       }
    }
    
    1
    Copied!
    Warning

    If you can't find the above fields in settings.gradle, it's probably because your Android Gradle Plugin version is lower than v7.1.0.

    For more details, see Android Gradle Plugin Release Note v7.1.0.

    If your Android Gradle Plugin is earlier than 7.1.0: enter your project's root directory, open the build.gradle file to add the jitpack to allprojects->repositories like this:

    build.gradle
    allprojects {
        repositories {
            google()
            mavenCentral()
            maven { url 'https://storage.zego.im/maven' }   // <- Add this line.
            maven { url "https://jitpack.io" }  // <- Add this line.
        }
    }
    
    1
    Copied!

    b. Modify your app-level build.gradle file:

    build.gradle
    dependencies {
        ...
        implementation 'com.github.ZEGOCLOUD:zego_uikit_prebuilt_video_conference_android:+'    // Add this line in your module-level build.gradle file's dependencies, usually named [app].
    }
    
    1
    Copied!
  2. Using the ZegoUIKitPrebuiltVideoConferenceFragment in your project

    1. Go to ZEGOCLOUD Admin Console, get the appID and appSign of your project.
    2. Specify the userID and userName for connecting the Video Conference Kit service.
    3. Create a conferenceID that represents the conference you want to start.
    Note
    • userID and conferenceID can only contain numbers, letters, and underlines (_).
    • Using the same conferenceID will enter the same video conference.
    Untitled
    public class ConferenceActivity extends AppCompatActivity {
    
        @Override
        protected void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            setContentView(R.layout.activity_conference);
    
            addFragment();
        }
    
        public void addFragment() {
            long appID = yourAppID;
            String appSign = yourAppSign;
    
            String conferenceID = conferenceID;
            String userID = userID;
            String userName = userName;
    
            ZegoUIKitPrebuiltVideoConferenceConfig config = new ZegoUIKitPrebuiltVideoConferenceConfig();
            ZegoUIKitPrebuiltVideoConferenceFragment fragment = ZegoUIKitPrebuiltVideoConferenceFragment.newInstance(appID, appSign, userID, userName,conferenceID,config);
    
            getSupportFragmentManager().beginTransaction()
                .replace(R.id.fragment_container, fragment)
                .commitNow();
        }
    }
    
    1
    Copied!

    Modify the auto-created activity_conference.xml file:

    activity_conference.xml
    <?xml version="1.0" encoding="utf-8"?>
    <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
      android:id="@+id/fragment_container"
      android:layout_width="match_parent"
      android:layout_height="match_parent">
    
    </androidx.constraintlayout.widget.ConstraintLayout>
    
    1
    Copied!

Now, you can start a video conference by starting your ConferenceActivity.

Run & Test

Now you have finished all the steps!

You can simply click the Run on Android Studio to run and test your App on your device.

Custom prebuilt UI

Resources

Sample Code

Click here to get the complete sample code.