Talk to us
Talk to us
menu

Blog Post

start building
Developer

How To Do A Video Call

How To Do A Video Call

Convenient video call

More and more apps can provide video call functions, such as FaceTime, WhatsApp, Duo, Messenger, Zoom, etc. With these applications, How to do video call is getting easier.

Video calling brings you face-to-face with your family and friends, whether you’re in the same city or thousands of miles away. We want to make it even easier to start a video call from your Android device, so we’re making video calling an integrated part of your phone. You can now start a video call directly from where you call or text message your friends, through your Phone, Contacts, and Android Messages apps.

Difference between video calling and video conference

Video calling and video conferencing are two terms that are often used interchangeably. Sure, they’re similar. But there are slight distinctions between them in terms of usage and origin:

  • Video calling is a more casual call that can be initiated anytime, anywhere, usually a 1v1 call, for the purpose of direct communication between two people.
  • Video conference is a formal occasion that needs to be booked in advance. It is usually a multi-person call. The purpose is to discuss things. Therefore, functions such as screen sharing and file sharing are needed to assist the conference.

There are many video calling and video conference applications on the market.

If we want to integrate the video calling function in our application, We should How To Do Video Calls?

How to implement a video call

The video calling industry chain is becoming more and more perfect now, and it is more and more convenient to implement the Video calling function.

With the help of a third-party SDK, we can implement the video calling function within 30 minutes.

To implement video calling, we need to implement several basic functions:

  • Call notification
  • Call state management
  • Audio and video communication

The video calling SDK will help us implement these basic functions. We only need to define and call the corresponding API according to the requirements.

Let’s take ZEGOCLOUD CallKit as an example.

1)Integrate the SDK

  1. 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.
   }
}
  1. Modify your app-level build.gradle file:
dependencies {
    ...
    implementation 'com.github.ZEGOCLOUD:zego_uikit_prebuilt_call_android:1.0.1'    // add this line in your module-level build.gradle file's dependencies, usually named [app].
}

2)Show the ZegoUIKitPrebuiltCallFragment in your project

  • Go to ZEGOCLOUD Admin Console, get the appID and appSign of your project.
  • Specify the userID and userName for connecting the Call Kit service.
  • Create a callID that represents the call you want to make.
public class CallActivity extends AppCompatActivity {

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

        addCallFragment();
    }

    public void addCallFragment() {
        long appID = yourAppID;
        String appSign = yourAppSign;

        String callID = callID;
        String userID = userID;
        String userName = userName;

        // You can also use GroupVideo/GroupVoice/OneOnOneVoice to make more types of calls.
        ZegoUIKitPrebuiltCallConfig config = ZegoUIKitPrebuiltCallConfig.oneOnOneVideoCall();

        ZegoUIKitPrebuiltCallFragment fragment = ZegoUIKitPrebuiltCallFragment.newInstance(
            appID, appSign, callID, userID, userName,config);

        getSupportFragmentManager().beginTransaction()
            .replace(R.id.fragment_container, fragment)
            .commitNow();
    }
}

3)Modify the auto-created activity_call.xml file:

<?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>

Run the Demo

Through the above three steps, the SDK integration can be completed and the Video Calling function can be realized.

If you want to realize a more personalized UI interface, ZEGOCLOUD Call Kit provides a rich UI custom interface and supports user configuration, for specific usage, please refer to Call Kit Custom prebuilt UI Documentation.

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