DEV Community

Cover image for How to Make a Video Call App with ZEGOCLOUD
Stephen568hub
Stephen568hub

Posted on

How to Make a Video Call App with ZEGOCLOUD

Want to create your own video call app? It's easier than you might think, thanks to ZEGOCLOUD. This guide will show you how to build a video calling app step by step. ZEGOCLOUD offers tools that make the process simple, even if you're new to app development.

You'll learn how to set up your project, add video call features, and get your app running smoothly. We'll cover the basics you need to know, from getting started with ZEGOCLOUD to testing your finished app. By the end, you'll have a working video call app that you built yourself.

Whether you're a beginner or have some coding experience, this guide will help you create a video call app quickly and easily with ZEGOCLOUD.

How Long Does It Take to Make an App?

Creating an app takes time, and the exact duration depends on the app's complexity and features. Simple apps with basic functions can take about 2-3 months to develop. These apps typically have minimal features, such as a few screens and standard functionality.

On the other hand, more complex apps that include features like user authentication, database integration, or real-time updates may take 4-6 months or longer. These apps require more detailed planning, design, and testing to ensure everything runs smoothly.

Another factor that influences the development time is the size of the team working on the project. A larger, experienced team may complete the app faster than a smaller group. The quality of communication and project management also plays a role in how quickly the app can be completed.

It’s also important to note that app development doesn't end after the launch. Regular updates and maintenance are needed to fix bugs and keep the app running smoothly.

Overall, building an app can take anywhere from a few months to over a year, depending on the scope of the project. Good planning and a clear understanding of the app's requirements can help speed up the process.

iOS App Development vs. Android App Development: What’s The Difference?

When making a mobile app, you can choose between iOS for Apple devices or Android for many other phones. Both are popular, but they have some key differences. Let's compare them:

Criteria

iOS App Development

Android App Development

Programming Language Swift and Objective-C Kotlin and Java
Development Environment Xcode Android Studio
Device Fragmentation Less device variety, easier to test Wide range of devices, harder to test
App Store Approval Strict review process Less strict, faster approval
Market Share Popular in North America and Europe Dominates in Asia, Africa, and more
Development Cost Usually higher due to stricter guidelines Can be lower, but depends on the complexity
Revenue Potential Higher app revenue per user Larger audience, but lower revenue per user

Key Differences:

  • Programming Languages: iOS apps are built with Swift or Objective-C, while Android apps use Kotlin or Java. Swift is newer and easier to learn, whereas Kotlin is more versatile across Android devices.
  • Device Fragmentation: iOS developers deal with fewer device models, making testing simpler. Android developers, however, need to account for many different devices and screen sizes.
  • Revenue Potential: iOS apps often generate higher revenue, especially from in-app purchases. Android apps reach a larger audience but may earn less per user.

Overall, both platforms offer unique benefits, and the choice depends on your target audience and goals.

How to Create a Video Call App for Android and iOS

Creating a video call app for Android and iOS might seem tricky, but with the right tools, it’s easier than you think. In this section, we’ll show you how to do it using the ZEGOCLOUD Express SDK.

ZEGOCLOUD is a powerful platform that makes it simple to add real-time video and audio features to your apps. It takes care of the complicated parts, so you can focus on giving your users a smooth experience. With ZEGOCLOUD, building a video call app for both Android and iOS is quick and straightforward.

Prerequisites

Before we start, let's make sure you have everything you need:

  • Sign up for a ZEGOCLOUD developer account.
  • Get your AppID and AppSign from the ZEGOCLOUD admin dashboard.
  • Have Android Studio 2020.3.1 above installed or Xcode 13.0 for iOS app.
  • Use a device running Android 4.4 or iOS 9.0 or later that supports audio and video.
  • Knowledge of Android or iOS app development.
  • Make sure your device is connected to the internet.

Android Video Call App

1. Adding the SDK Dependencies

1.1 Setting Up Gradle

To use the Zego SDK, you must add the ZegoExpress SDK to your Android project via Gradle. Follow the steps below to do so:

  • For Android Studio version 7.1.0 or later, open your project's settings.gradle file. Add the following code inside the dependencyResolutionManagement block:
dependencyResolutionManagement {
    repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
    repositories {
        maven { url 'https://storage.zego.im/maven' }
        google()
        mavenCentral()
    }
}
Enter fullscreen mode Exit fullscreen mode
  • For older versions of Android Studio, open the build.gradle file in the root directory of your project. Add the following code inside the allprojects block:

    allprojects {
    repositories {
        maven { url 'https://storage.zego.im/maven' }
        google()
        mavenCentral()
    }
    }
    

1.2 Adding the SDK Dependency

Open the app/build.gradle file. Add the following line inside the dependencies block (replace x.y.z with the latest SDK version):

dependencies {
    implementation 'im.zego:express-video:x.y.z'
}
Enter fullscreen mode Exit fullscreen mode

Save the file and sync the project. This will add the ZegoExpress SDK, enabling video call functionalities.

2. Importing the SDK

Once the dependencies are synced, import the Zego SDK into your main activity so you can start implementing video call features.

Open your MainActivity.java or MainActivity.kt file. Add the following import statement:

import im.zego.zegoexpress.ZegoExpressEngine;
Enter fullscreen mode Exit fullscreen mode

This import allows you to use the Zego SDK's core functionality.

3. Implementing Video Call Functionality

3.1 Define App Credentials

You need to define your AppID and AppSign, which you obtained from your ZEGOCLOUD dashboard.

In your main activity file, add the following variables:

String appID = "<Your App ID>";  // Replace with your actual AppID
String appSign = "<Your App Sign>";  // Replace with your actual AppSign
Enter fullscreen mode Exit fullscreen mode

3.2 Define User and Room Information

Now, define the userID, userName, and roomID to identify the user and the video call room. Define the variables:

String userID = "<Your UserID>";   // Replace with your actual user ID
String userName = "<Your UserName>"; // Replace with your actual user name
String roomID = "<Your RoomID>";   // Replace with your actual room ID
Enter fullscreen mode Exit fullscreen mode

3.3 Initializing the Zego Engine

Before starting the call, you must initialize the Zego engine. This engine will handle all the video call operations. Add the following method to initialize the engine:

void createEngine() {
    ZegoEngineProfile profile = new ZegoEngineProfile();
    profile.appID = Long.parseLong(appID);
    profile.appSign = appSign;
    profile.application = getApplication();
    profile.scenario = ZegoScenario.DEFAULT; // Set the appropriate scenario
    ZegoExpressEngine.createEngine(profile, null);
}
Enter fullscreen mode Exit fullscreen mode

This method initializes the ZegoExpressEngine with the appID and appSign. The scenario is set to DEFAULT, which is fine for general use cases.

3.4 Starting and Joining a Video Call

Now, implement methods to start and join video calls.

Starting a Video Call:

void startVideoCall() {
    ZegoExpressEngine.getEngine().startPublishingStream(roomID);
}
Enter fullscreen mode Exit fullscreen mode

Joining a Video Call:

void joinVideoCall() {
    ZegoExpressEngine.getEngine().startPlayingStream(roomID);
}
Enter fullscreen mode Exit fullscreen mode

4. Configuring Device Permissions

For the video call to access your camera and microphone, you need to request permissions in the AndroidManifest.xml file. Open the AndroidManifest.xml file and add the following permissions:

<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-permission android:name="android.permission.INTERNET" />
Enter fullscreen mode Exit fullscreen mode

For Android 6.0 and above, you will also need to request runtime permissions:

String[] permissions = {"android.permission.CAMERA", "android.permission.RECORD_AUDIO"};
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
    requestPermissions(permissions, 101);
}
Enter fullscreen mode Exit fullscreen mode

5. Running and Testing Your Android App

Once you have the permissions set, you can now run and test your Android app:

  • Build and run your app on a real Android device.
  • Test the video call by starting the call on one device and joining the call on another using the same roomID.

iOS Video Call App

1. Adding the SDK Dependencies

1.1 Setting Up Swift Package Manager

For iOS, you will use Swift Package Manager to add the ZegoUIKitPrebuiltLiveStreaming SDK. Follow the steps below:

  • Open Xcode, and go to File > Add Packages.
  • In the search box, enter the following URL:
https://github.com/zegolibrary/express-video-ios
Enter fullscreen mode Exit fullscreen mode

Select the latest version and add the package to your project.

2. Importing the SDK

Once the SDK is installed, you need to import it into your ViewController.swift file. In your ViewController.swift file, add the following import statements:

import ZegoUIKit
import ZegoUIKitPrebuiltLiveStreaming
Enter fullscreen mode Exit fullscreen mode

These import statements give you access to the Zego video call SDK.

3. Implementing Video Call Functionality

3.1 Define App Credentials

You need your AppID and AppSign to authenticate your app with ZEGOCLOUD. Add the following credentials at the top of your ViewController.swift file:

let appID: UInt32 = <Your AppID>  // Replace with your actual AppID
let appSign: String = "<Your AppSign>"  // Replace with your actual AppSign
Enter fullscreen mode Exit fullscreen mode

3.2 Define User and Room Information

Now, define the userID, userName, and roomID variables for identifying users and the room. Add these variables:

var userID: String = "<Your UserID>"   // Replace with actual user ID
var userName: String = "<Your UserName>" // Replace with actual user name
var roomID: String = "<Your RoomID>"   // Replace with actual room ID
Enter fullscreen mode Exit fullscreen mode

3.3 Initializing the Zego Engine

Like Android, you must initialize the Zego engine on iOS to handle video call functionality. Add the function below:

func createEngine() {
    let profile = ZegoEngineProfile()
    profile.appID = appID
    profile.appSign = appSign
    ZegoExpressEngine.createEngine(with: profile, eventHandler: self)
}
Enter fullscreen mode Exit fullscreen mode

This function initializes the Zego engine with your credentials.

3.4 Starting and Joining a Video Call

To start a video call as a host:

func startVideoCall() {
    ZegoExpressEngine.shared().startPublishingStream(roomID)
}
Enter fullscreen mode Exit fullscreen mode

To join an existing video call:

func joinVideoCall() {
    ZegoExpressEngine.shared().startPlayingStream(roomID)
}
Enter fullscreen mode Exit fullscreen mode

4. Configuring Device Permissions

In iOS, you need to request camera and microphone permissions in the Info.plist file. Open the Info.plist file and add the following keys:

<key>NSCameraUsageDescription</key>
<string>We need access to your camera for video calls.</string>
<key>NSMicrophoneUsageDescription</key>
<string>We need access to your microphone for video calls.</string>
Enter fullscreen mode Exit fullscreen mode

These entries will display permission prompts when the user first opens the app.

5. Running and Testing Your Video Call App

Once your permissions are set, you can now test your app:

  • Open the .xcworkspace file in Xcode, select your target device, and run the app.
  • Start a video call on one device, then join it from another device using the same room ID to test the feature.

These are just the basics. To add more features to your video call app, explore ZEGOCLOUD’s Express Video SDK documentation. You can also get started with our sample source code!

Conclusion

Building a video call app with ZEGOCLOUD is a straightforward process, whether you're developing for Android or iOS. By following this guide, you can set up your project, integrate essential video calling features, and test the app on real devices. ZEGOCLOUD’s powerful SDK simplifies the implementation, allowing you to focus on user experience rather than complex backend processes.

Start building your custom video call app today and create seamless communication experiences for your users.

Top comments (0)