Talk to us
Talk to us
menu

Blog Post

start building
Developer

How To Build An Android Video Call App In 10 Minutes

How To Build An Android Video Call App In 10 Minutes

ZEGOCLOUD has launched a new UIKits SDK, which can complete the development of Video Call App in 10 minutes.

Learn about official website documentation, ZEGOCLOUD video calling API support 1 on 1 call, and group calls.

This article will show you how to use the UIKits SDK to implement Android Video Call functionality quickly. We will implement the following functions:

  • 1v1 video call
  • Camera switching
  • Microphone, speaker management

Introduction to UIKits SDK

UIKits SDK is a brand-new pre-built UIKits and UI Components by ZEGOCLOUD. Through it, We can complete the development of video calls, live streaming, video conference, and other scenarios within 10 minutes.

build android video call

As shown in the figure, UIKits SDK is responsible for processing audio and video calls and the logic related to text chat. Include:

  • UI and interaction of the calling module
  • call status management
  • Audio and video data transmission

You only need to implement business-related logic. For example:

  • User login registration
  • Friends List Management
  • Call billing recharge

Preparation

  • A ZEGOCLOUD developer account–Sign up
  • Android Studio 2020.3.1 or later
  • Devices with Android 5.0 or later
  • Basic understanding of Android development

Call Kit SDK integration

Add the jitpack configuration.

  • If your gradle version is later than 6.8, modify your settings.gradle file like this:
dependencyResolutionManagement {
   repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
   repositories {
      maven { url 'https://www.jitpack.io' } // <- Add this line.
   }
}
modify settings gradle
  • If not, modify your project-level build.gradle file instead:
allprojects {
    repositories {
        maven { url "https://jitpack.io" }  // <- Add this line.
    }
}
modify build gradle

Add ZEGOCLOUD Call Kit.

Modify your app-level build.gradle file:

dependencies {
    ...
    implementation 'com.github.ZEGOCLOUD:zego_uikit_prebuilt_call_android:latest.release'    // add this line in your module-level build.gradle file's dependencies, usually named [app].
}
add call kit

Implement Video Call

Create a new Activity

1 Create a new empty activity and name it CallActivity.

create call activity

2 modify it’s layout file ‘activity_call.xml’ in res/layout directory.

<?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>
config call activity

3 modify CallActivity to show Call Kit UI
When starting a video call, ZegoUIKitPrebuiltCallFragment needs to be displayed on the screen.

public void addFragment() {
    long appID = ;
    String appSign = ;
    String callID = "callID111";
    String userID = Build.MANUFACTURER + "_" + generateUserID();
    String userName = userID + "_Name";
    ZegoUIKitPrebuiltCallConfig config = ZegoUIKitPrebuiltCallConfig.oneOnOneVideoCall();
    ZegoUIKitPrebuiltCallFragment fragment = ZegoUIKitPrebuiltCallFragment.newInstance(appID,      appSign, userID, userName, callID, config);
    getSupportFragmentManager().beginTransaction().replace(R.id.fragment_container, fragment).commitNow();
}
add call kit ui

modify MainActivity to add a Call Button to start video call.

activity_main.xml:

   <?xml version="1.0" encoding="utf-8"?>
    <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <Button
        android:id="@+id/button"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_centerInParent="true"
        android:text="start video call" />
    </RelativeLayout>

MainActivity.java:

   public class MainActivity extends AppCompatActivity {

        @Override
        protected void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            setContentView(R.layout.activity_main);

            findViewById(R.id.button).setOnClickListener(v -> {
                Intent intent = new Intent(MainActivity.this, CallActivity.class);
                startActivity(intent);
            });
        }
    }

Run a Demo

Conclusion

ZEGOCLOUD UIKits SDK saves you a lot of time, allowing you to quickly build a Video Call App, verify market requirements, and seize market opportunities.

If you are interested in developing audio and video applications, you can download the sample demo source code of this article.

If you have deeper requirements, such as streaming mix, noise reduction, censorship, etc. you can use our Core SDK.

If you have any questions, you can always consult us 24h technical support

Read More

ZEGOCLOUD
ZEGOCLOUD With our fully customizable and easy-to-integrate Live SDK, you can quickly build reliable, scalable, and interactive live streaming into your mobile, web, and desktop apps.

Related posts

Contact us