{"id":26657085,"url":"https://github.com/chat21/chat21-android-sdk","last_synced_at":"2025-04-09T13:03:47.636Z","repository":{"id":43042496,"uuid":"112217713","full_name":"chat21/chat21-android-sdk","owner":"chat21","description":"Android Chat SDK built on Firebase","archived":false,"fork":false,"pushed_at":"2023-03-08T13:53:55.000Z","size":3847,"stargazers_count":233,"open_issues_count":33,"forks_count":92,"subscribers_count":18,"default_branch":"master","last_synced_at":"2025-04-02T12:13:27.829Z","etag":null,"topics":["android","chat","chat-application","firebase","messaging","sdk"],"latest_commit_sha":null,"homepage":"http://www.chat21.org","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/chat21.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-11-27T16:04:01.000Z","updated_at":"2024-05-20T23:04:26.000Z","dependencies_parsed_at":"2022-08-12T10:11:29.277Z","dependency_job_id":null,"html_url":"https://github.com/chat21/chat21-android-sdk","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chat21%2Fchat21-android-sdk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chat21%2Fchat21-android-sdk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chat21%2Fchat21-android-sdk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chat21%2Fchat21-android-sdk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chat21","download_url":"https://codeload.github.com/chat21/chat21-android-sdk/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248045230,"owners_count":21038553,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["android","chat","chat-application","firebase","messaging","sdk"],"created_at":"2025-03-25T08:17:04.565Z","updated_at":"2025-04-09T13:03:47.618Z","avatar_url":"https://github.com/chat21.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"Chat21 is the core of the open source live chat platform [Tiledesk.com](http://www.tiledesk.com).\n\n# Chat21 SDK Documentation \n \n## Features\n\nWith Chat21 Android SDK you can:\n\n- Send a direct message to a user (one to one message)\n- Emoji support\n- Attach pictures support\n- Create group chat \n- View the messages history\n- View the group list \n- The read receipts feature allows your users to see when a message has been sent, delivered and read\n- Conversations list view with the last messages sent (like Whatsapp)\n- With the Presense Manager you can view when a user is online or offline and the inactivity period\n- View the user profile with fullname and email\n- Login with email and password (Use firebase email and password authentication method )\n- Signup with fullname, email, password and profile picture\n- Contacts list view with fulltext search for fullname field\n\n## Sample\n\n### Screenshots\n\u003cimg src=\"https://image.ibb.co/i8zfJS/68747470733a2f2f6c68332e676f6f676c6575736572636f6e74656e742e636f6d2f7832497653466674336f7176733532706d44654f316b504841696e5642435732587a737947555730415a4c53644c687175762d5973464e574c5f482d4a677439576f73323d683930302d7277.png\" width=\"250\"\u003e| \u003cimg src=\"https://image.ibb.co/ndYwsn/68747470733a2f2f6c68332e676f6f676c6575736572636f6e74656e742e636f6d2f346a6a6b4d3476397553447a613234742d41355f6a5a77316a54747542716d4b6e595870723559706e625f5f67706361586b794e62787a5032756b45306e52663475303d683930302d7277.png\" width=\"250\"\u003e | \u003cimg src=\"https://image.ibb.co/jih0JS/68747470733a2f2f6c68332e676f6f676c6575736572636f6e74656e742e636f6d2f30564855496f524f566f6d6d744c4e5465454154626c3862776c6144347338734b3847325a764f78314d516a674a703639364f723638304133665551597944364659493d683930302d7277.png\" width=\"250\"\u003e\n\n\u003cimg src=\"https://image.ibb.co/ce5LJS/68747470733a2f2f6c68332e676f6f676c6575736572636f6e74656e742e636f6d2f435956554639542d6437464d79326430486f48716f633378624c566e63444464336930516556655a5a6a37704d314b62524367795f4967656a636e3654503948585f673d683930302d7277.png\" width=\"250\"\u003e | \u003cimg src=\"https://image.ibb.co/hm7d57/68747470733a2f2f6c68332e676f6f676c6575736572636f6e74656e742e636f6d2f6b2d455257784343484f4d7a4f6d6972414f78596a63724a625044684d6773594443562d386c6c6264713030594d72644b637749546e655f31465a574b426b5042413d683930302d7277.png\" width=\"250\"\u003e\n\n### Google Play Demo\n[![get_it](http://evolvex.it/mobyx/images/nav/gplay-blk.png)](https://play.google.com/store/apps/details?id=chat21.android.demo)\n\n### Demo\n\nDemo app source code is available [here](https://github.com/chat21/chat21-android-demo) \n\nYo can build your own chat following our [official tutorial](http://www.chat21.org/docs/android/get-started/)\n\n## Pre requisites\n\nBefore you begin, you need a few things to set up in your environment:\n\n* a Firebase project correctly configured  \n* Chat21 Firebase cloud functions installed. See detailed [instructions](https://github.com/chat21/chat21-cloud-functions)\n* google-services.json for you app. See official [documentation](https://developers.google.com/android/guides/google-services-plugin)\n\n## Firebase libs\n\n### /project/build.gradle\n\nFirst, include the google-services plugin and the Google’s Maven repository to your root-level build.gradle file:\n\n```\nbuildscript {\n    // ...\n    dependencies {\n        // ...\n        classpath 'com.google.gms:google-services:3.1.1'\n    }\n}\n\nallprojects {\n    // ...\n    repositories {\n        // ...\n        google()\n    }\n}\n\n```\n\n\u003cdiv style=\"text-align:right;\"\u003e\n    \u003ca target=\"_top\" href=\"https://github.com/chat21/chat21-android-demo/blob/development_v2/build.gradle\"\u003ebuild.gradle\n        \u003cspan\u003e\n            \u003cimg style=\"vertical-align:middle;color:#0566D6;\" src=\"https://github.com/chat21/chat21-android-sdk/blob/master/resources/ic_open_in_new_white_24px.svg\" alt=\"open\"\u003e\n        \u003c/span\u003e\n    \u003c/a\u003e\n\u003c/div\u003e\n\n\n### /project/app/build.gradle\nThen, in your module Gradle file (usually the app/build.gradle), add the apply plugin line at the bottom of the file to enable the Gradle plugin:\n\n```\napply plugin: 'com.android.application'\n// ...\ndependencies {\n    // ...\n    implementation \"com.google.android.gms:play-services:11.8.0\"\n}\n// ... \napply plugin: 'com.google.gms.google-services'\n\n```\n\n\u003cdiv style=\"text-align:right;\"\u003e\n    \u003ca target=\"_top\" href=\"https://github.com/chat21/chat21-android-demo/blob/master/build.gradle\"\u003ebuild.gradle\n        \u003cspan\u003e\n            \u003cimg style=\"vertical-align:middle;color:#0566D6;\" src=\"https://github.com/chat21/chat21-android-sdk/blob/master/resources/ic_open_in_new_white_24px.svg\" alt=\"open\"\u003e\n        \u003c/span\u003e\n    \u003c/a\u003e\n\u003c/div\u003e\n\n## Install Chat21 libraries\nSet:\n* minimun SDK at least at ***API 19*** \n* targetSdkVersion at ***API 22*** \n\nAdd the following to your app/build.gradle file:\n\n```\ndefaultConfig {\n// ...\nmultiDexEnabled true\n}\ndependencies {\n// ...\ncompile 'com.android.support:multidex:1.0.1'\ncompile \"com.google.android.gms:play-services:11.8.0\"\ncompile 'com.android.support:design:26.1.0'\n\ncompile 'org.chat21.android:chat21:1.0.10'\ncompile 'com.vanniktech:emoji-ios:0.5.1'\n}\n// ...\nconfigurations.all {\n    resolutionStrategy.eachDependency { DependencyResolveDetails details -\u003e\n        def requested = details.requested\n        if (requested.group == 'com.android.support') {\n            if (!requested.name.startsWith(\"multidex\")) {\n                details.useVersion '26.1.0'\n            }\n        }\n    }\n}\n```\n\u003cdiv style=\"text-align:right;\"\u003e\n    \u003ca target=\"_top\" href=\"https://github.com/chat21/chat21-android-demo/blob/master/app/build.gradle\"\u003ebuild.gradle\n        \u003cspan\u003e\n            \u003cimg style=\"vertical-align:middle;color:#0566D6;\" src=\"https://github.com/chat21/chat21-android-sdk/blob/master/resources/ic_open_in_new_white_24px.svg\" alt=\"open\"\u003e\n        \u003c/span\u003e\n    \u003c/a\u003e\n\u003c/div\u003e\n\n### Google Play Services plugin\n\nFinally, as described in the [documentation](https://firebase.google.com/docs/android/setup#manually_add_firebase), paste this statement as the last line of the file:\n\n`apply plugin: 'com.google.gms.google-services'`\n\nAt the end, you'll download a `google-services.json` file. For more informations refer to the relative [documentation](https://support.google.com/firebase/answer/7015592)\n\n\n### Application\n\nCreate a custom Application class\n\n```\npublic class AppContext extends Application {\n\n@Override\nprotected void attachBaseContext(Context base) {\n    super.attachBaseContext(base);\n           MultiDex.install(this); // add this\n    }\n}\n```\n\n\u003cdiv style=\"text-align:right;\"\u003e\n    \u003ca target=\"_top\" href=\"https://github.com/chat21/chat21-android-demo/blob/master/app/src/main/java/chat21/android/demo/AppContext.java\"\u003eAppContext.java\n        \u003cspan\u003e\n            \u003cimg style=\"vertical-align:middle;color:#0566D6;\" src=\"https://github.com/chat21/chat21-android-sdk/blob/master/resources/ic_open_in_new_white_24px.svg\" alt=\"open\"\u003e\n        \u003c/span\u003e\n    \u003c/a\u003e\n\u003c/div\u003e\n\nand add it to the Manifest.xml\n\n```\n \u003capplication\n             android:name=\".AppContext\"\n             android:icon=\"@mipmap/ic_launcher\"\n             android:label=\"@string/app_name\"\n             android:theme=\"@style/AppTheme\"\n             ...\n\u003c/application\u003e \n\n```\n\n\u003cdiv style=\"text-align:right;\"\u003e\n    \u003ca target=\"_top\" href=\"https://github.com/chat21/chat21-android-demo/blob/master/app/src/main/AndroidManifest.xml\"\u003eAndroidManifest.xml\n        \u003cspan\u003e\n            \u003cimg style=\"vertical-align:middle;color:#0566D6;\" src=\"https://github.com/chat21/chat21-android-sdk/blob/master/resources/ic_open_in_new_white_24px.svg\" alt=\"open\"\u003e\n        \u003c/span\u003e\n    \u003c/a\u003e\n\u003c/div\u003e\n\n### Style\n\nReplace the default parent theme in your styles.xml\n\n```\n\u003cstyle name=\"AppTheme\" parent=\"Theme.AppCompat.Light.DarkActionBar\"\u003e\n\n```\n\nto \n\n```\n\u003cstyle name=\"AppTheme\" parent=\"Theme.AppCompat.Light.NoActionBar\"\u003e\n\n```\n \nyou will obtain something like :\n\n```\n  \u003cstyle name=\"AppTheme\" parent=\"Theme.AppCompat.Light.NoActionBar\"\u003e\n   \u003c!-- Customize your theme here. --\u003e\n   \u003citem name=\"colorPrimary\"\u003e@color/colorPrimary\u003c/item\u003e\n   \u003citem name=\"colorPrimaryDark\"\u003e@color/colorPrimaryDark\u003c/item\u003e\n   \u003citem name=\"colorAccent\"\u003e@color/colorAccent\u003c/item\u003e\n\u003c/style\u003e \n\n```\n\n\u003cdiv style=\"text-align:right;\"\u003e\n    \u003ca target=\"_top\" href=\"https://github.com/chat21/chat21-android-demo/blob/master/app/src/main/res/values/styles.xml\"\u003estyles.xml\n        \u003cspan\u003e\n            \u003cimg style=\"vertical-align:middle;color:#0566D6;\" src=\"https://github.com/chat21/chat21-android-sdk/blob/master/resources/ic_open_in_new_white_24px.svg\" alt=\"open\"\u003e\n        \u003c/span\u003e\n    \u003c/a\u003e\n\u003c/div\u003e\n\n### Chat21 SDK initialization\n\n#### ChatManager\n\nThe Chat21 SDK provide a ***Chat.Configuration*** object which allows to set some custom behaviour \nand settings for your chat.\n\nTo create a new instance of Chat21 SDK you have to create your own configuration (using the\nChat21 SDK Chat.Configuration.Builder) and use it as paramater for the method `Chat.initialize(configuration);` \n\n```\n    // optional\n    //enable persistence must be made before any other usage of FirebaseDatabase instance.\n    FirebaseDatabase.getInstance().setPersistenceEnabled(true);\n\n    // mandatory\n    // it creates the chat configurations\n    ChatManager.Configuration mChatConfiguration =\n            new ChatManager.Configuration.Builder(\u003cAPP_ID\u003e)\n                    .firebaseUrl(\u003cFIREBASE_DATABASE_URL\u003e)\n                    .storageBucket(\u003cSTORAGE_BUCKET\u003e)\n                    .build();\n            \n    ChatManager.start(\u003cCONTEXT\u003e, mChatConfiguration, \u003cLOGGED_USER\u003e);\n\n```\n\nReplace:\n\n- `\u003cAPP_ID\u003e` with your appId;\n- `\u003cFIREBASE_URL\u003e` with your Firebae Database URL of your Firebase App;\n- `\u003cSTORAGE_BUCKET\u003e` with your Firebae Storage Bucket URL of your Firebase App;\n- `\u003cCONTEXT\u003e` with your Context;\n- `\u003cLOGGED_USER\u003e` with your current logged user, assuming it is an instance of IChatUser\n\n\u003cdiv style=\"text-align:right;\"\u003e\n    \u003ca target=\"_top\" href=\"https://github.com/chat21/chat21-android-demo/blob/development_v2/app/src/main/java/chat21/android/demo/AppContext.java\"\u003eAppContext.java\n        \u003cspan\u003e\n            \u003cimg style=\"vertical-align:middle;color:#0566D6;\" src=\"https://github.com/chat21/chat21-android-sdk/blob/master/resources/ic_open_in_new_white_24px.svg\" alt=\"open\"\u003e\n        \u003c/span\u003e\n    \u003c/a\u003e\n\u003c/div\u003e\n\n#### ChatUI\n\nChatUI allows you to quickly connect common UI elements to Chat21 SDK APIs.\n\nChatUI lets you start your chat with both an activity and a inside a fragment.\n\nInitialize the ChatUI component with the following instruction\n\n```\nChatUI.getInstance().setContext(this);\n ```\n\n##### Launch with an activity\n\nIt starts a new activity that contains the list of conversations.\n\n```\n ChatUI.getInstance().showConversationsListActivity();\n\n```\n\n\u003cdiv style=\"text-align:right;\"\u003e\n    \u003ca target=\"_top\" href=\"https://github.com/chat21/chat21-android-demo/blob/master/app/src/main/java/chat21/android/demo/HomeFragment.java\"\u003eExample.java\n        \u003cspan\u003e\n            \u003cimg style=\"vertical-align:middle;color:#0566D6;\" src=\"https://github.com/chat21/chat21-android-sdk/blob/master/resources/ic_open_in_new_white_24px.svg\" alt=\"open\"\u003e\n        \u003c/span\u003e\n    \u003c/a\u003e\n\u003c/div\u003e\n\n##### Launch with a fragment\n\nYou have to create a fragment with a container inside.\n\nThe chat will start inside this container where the list of conversations is shown.\n\n\n```\n\u003candroid.support.design.widget.CoordinatorLayout \n    android:layout_width=\"match_parent\"\n    android:layout_height=\"match_parent\"\u003e\n    \n    \u003cFrameLayout\n        android:id=\"@+id/container\"\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"match_parent\" /\u003e\n\n\u003c/android.support.design.widget.CoordinatorLayout\u003e\n```\n\nNow you can show your chat with the following method:\n\n```\n  ChatUI.getInstance().openConversationsListFragment(getChildFragmentManager(), R.id.container);\n\n```\n\n\u003cdiv style=\"text-align:right;\"\u003e\n    \u003ca target=\"_top\" href=\"https://github.com/chat21/chat21-android-demo/blob/master/app/src/main/java/chat21/android/demo/ChatFragment.java\"\u003eChatFragment.java\n        \u003cspan\u003e\n            \u003cimg style=\"vertical-align:middle;color:#0566D6;\" src=\"https://github.com/chat21/chat21-android-sdk/blob/master/resources/ic_open_in_new_white_24px.svg\" alt=\"open\"\u003e\n        \u003c/span\u003e\n    \u003c/a\u003e\n\u003c/div\u003e\n\n### Common Issues\n\n- Conflicts within `com.android.support`\n\n    Error:\n    ```\n    * What went wrong:\n    Execution failed for task ':app:processDebugResources'.\n    \u003e Failed to execute aapt\n    ```\n    Solution:\n    Copy this block at the bottom of your file **/project/app/build.gradle**\n    ```\n    configurations.all {\n        resolutionStrategy.eachDependency { DependencyResolveDetails details -\u003e\n            def requested = details.requested\n            if (requested.group == 'com.android.support') {\n                if (!requested.name.startsWith(\"multidex\")) {\n                    details.useVersion '26.1.0'\n                }\n            }\n        }\n    }\n    ```\n\n- MultiDex\n\n    Error:\n    ```\n    Error:Execution failed for task ':app:transformDexArchiveWithExternalLibsDexMergerForDebug'.\n    \u003e java.lang.RuntimeException: java.lang.RuntimeException: com.android.builder.dexing.DexArchiveMergerException: Unable to merge dex\n    ```\n    Solution:\n    Make sure you have added `multiDexEnabled true ` inside of **/project/app/build.gradle**\n\n    Copy this block inside of your custom Application class\n     ```\n      @Override\n      protected void attachBaseContext(Context base) {\n        super.attachBaseContext(base);\n        MultiDex.install(this);\n      }\n     ```\n\n- Theme\n\n    Error:\n    ```\n        RuntimeException: Unable to start activity ComponentInfo{my.sample.package.myapplication/chat21.android.ui.conversations.activities.ConversationListActivity}: java.lang.IllegalStateException:\n        This Activity already has an action bar supplied by the window decor. Do not request Window.FEATURE_SUPPORT_ACTION_BAR and set windowActionBar to false in your theme to use a Toolbar instead.\n    ```\n\n    Solution:\n    See the Style section\n\n- Application name exceptions:\n\n    Error:\n\n    ```\n        /android/MyApp/app/src/main/AndroidManifest.xml:30:9 Error:\n        Attribute application@label value=(@string/application_name) from AndroidManifest.xml:30:9\n        is also present at {Library Name} value=(@string/app_name)\n        Suggestion: add 'tools:replace=\"android:label\"' to \u003capplication\u003e element at AndroidManifest.xml:26:5 to override\n    ```\n\n    Solution:\n    Add the ` tools:replace=\"android:label\"` to override the Chat21 SDK app name and default icon:\n\n        ```\n        \u003capplication\n            android:name=\".AppContext\"\n            android:allowBackup=\"true\"\n            android:icon=\"@mipmap/ic_launcher\"\n            android:label=\"@string/app_name\"\n            android:roundIcon=\"@mipmap/ic_launcher_round\"\n            android:supportsRtl=\"true\"\n            android:theme=\"@style/AppTheme\"\n            tools:replace=\"android:label, android:icon\"\u003e \u003c!-- add this --\u003e\n\n            . . .\n\n        \u003c/application\u003e\n        ```\n\n\u003cdiv style=\"text-align:right;\"\u003e\n    \u003ca target=\"_top\" href=\"https://github.com/chat21/chat21-android-demo/blob/master/app/src/main/AndroidManifest.xml\"\u003eAndroidManifest.xml\n        \u003cspan\u003e\n            \u003cimg style=\"vertical-align:middle;color:#0566D6;\" src=\"https://github.com/chat21/chat21-android-sdk/blob/master/resources/ic_open_in_new_white_24px.svg\" alt=\"open\"\u003e\n        \u003c/span\u003e\n    \u003c/a\u003e\n\u003c/div\u003e\n\n\n## Deploy JCenter\n\nFollow this [guide](https://github.com/chat21/chat21-android-sdk/wiki/JCenter-Deploy) to deploy your own library to JCenter\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchat21%2Fchat21-android-sdk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchat21%2Fchat21-android-sdk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchat21%2Fchat21-android-sdk/lists"}