Read the full tutorial here: >> How to Build a Voice & Video Chat App in Java
This example shows How to Build a Voice & Video Chat App in Java:
How to Build a Voice & Video Chat App in JavaThis demo uses:
- Android
- CometChat Android UI Kit
- Firebase
To run the demo, you need to have Android Studio installed on your computer and follow these steps:
- Head to CometChat Pro and create an account
- From the dashboard, add a new app called "voice-video-chat-app"
- Select this newly added app from the list.
- From the Quick Start copy the APP_ID, APP_REGION and AUTH_KEY. These will be used later.
- Also copy the REST_API_KEY from the API & Auth Key tab.
- Navigate to the Users tab, and delete all the default users and groups leaving it clean (very important).
- Download the repository here or by running
git clone https://github.com/hieptl/voice-video-chat-app.git
and open it in a code editor. - Head to Firebase and create a new project
- Create a file called Constants.java in the package folder of your project.
- Import and inject your secret keys in the .env file containing your CometChat and Firebase in this manner.
public interface Constants {
String COMETCHAT_APP_ID = xxx-xxx-xxx-xxx-xxx-xxx-xxx-xxx;
String COMETCHAT_REGION = xxx-xxx-xxx-xxx-xxx-xxx-xxx-xxx;
String COMETCHAT_AUTH_KEY = xxx-xxx-xxx-xxx-xxx-xxx-xxx-xxx;
String FIREBASE_REALTIME_DATABASE_URL = xxx-xxx-xxx-xxx-xxx-xxx-xxx-xxx;
String FIREBASE_EMAIL_KEY = "email"; // this is not a secret value, it is just a constant variable that will be accessed from different places of the application.
String FIREBASE_USERS = "users"; // this is not a secret value, it is just a constant variable that will be accessed from different places of the application.
}
- Make sure to include the Constants.java file in your gitIgnore file from being exposed online.
Questions about running the demo? Open an issue. We're here to help ✌️