Demo application
The demo application source code is available on GitHub: edna-ru/cc-android-demo.
tip
If the SDK doesn't work in your application, check the behavior in the demo. This helps tell whether the problem is in the SDK or in your project's settings.
What the demo contains
| Feature | File / resource in demo |
|---|---|
| SDK initialization | app/src/main/java/edna/chatcenter/demo/integrationCode/EdnaChatCenterApplication.kt |
| Server configuration loading from JSON | app/src/main/java/edna/chatcenter/demo/appCode/business/ServersProvider.kt |
| Server list and hosts | app/src/main/assets/servers_config.json |
| Start screen and chat entry point | app/src/main/java/edna/chatcenter/demo/appCode/fragments/StartChatFragment.kt |
| Chat container (Fragment with "Start / Chat / Log" tabs) | app/src/main/java/edna/chatcenter/demo/integrationCode/fragments/chatFragment/ChatAppFragment.kt |
| Push notifications (FCM) | app/src/main/java/edna/chatcenter/demo/appCode/push/CustomPushFcmIntentService.kt |
| Push notifications (HMS, Huawei) | app/src/main/java/edna/chatcenter/demo/appCode/push/CustomPushHcmIntentService.kt |
| Theme (light/dark) | EdnaChatCenterApplication.kt |
| Logging | EdnaChatCenterApplication.kt |
Running the demo
-
Clone the repository and check out the tag matching your SDK version:
git clone https://github.com/edna-ru/cc-android-demo.git
cd cc-android-demo
git checkout YOUR_SDK_VERSIONTag names match SDK versions. Full list: https://github.com/edna-ru/cc-android-demo/tags.
-
Open the project in Android Studio.
-
Set your
threadsGateProviderUidand server URLs inapp/src/main/assets/servers_config.json. Field format:name,threadsGateProviderUid,serverBaseUrl,datastoreUrl,threadsGateUrl, optionallytrustedSSLCertificates— an array of file names inres/rawwithout extension. -
Run the application on a device or emulator.