We now provide you along with the CometChat SDK, the source code for our UI. This source code can be found in the downloaded package under the
Android/CometChat UI Source folder in the downloaded package. This folder contains the source code for the UI.
Like mentioned in the previous sections, you are provided with the option to directly launch the existing UI that comes with the SDK. But now you can also modify the UI to suit your requirements. Feel free to dive into the codebase and play around with it. This will help you to get a clear understanding of how the application works and also in the process help you achieve the UI of your choice.
- Please import the Android project found under `Android/CometChat UI Source` in the downloaded package into Android Studio.
- Make the necessary changes in the CCUrlInitializerActivity.java. Here you will need to change the siteURL, License key, Apikey and the isCometOnDemand parameter based on your subscription. You can find more information regarding the parameters [here](https://docs.cometchat.com/android-sdk/initialization/).
- Run the app. Enter valid user credentials to log in to the chat.
- Go through the code and understand the codebase. Make the necessary changes to the UI as per your requirement.
- Open the gradle section in Android studio. In the CometChatUI folder under the Tasks/build section, double click the assemblerelease option.
- This will generate the CometChatUI.aar in the CometChatUI/CometChatUI/build/outputs/aar/CometChatUI-release.aar.
- Add this file to your Android project and sync gradle. Run the project and the UI changes should be reflected in your app.
You can add the CometChat.aar as a gradle dependency or a modular dependency.