OpenIM Android ๐Ÿ’ฌ๐Ÿ’ป

March 14, 2025 ยท View on GitHub

OpenIM Android ๐Ÿ’ฌ๐Ÿ’ป

OpenIM Docs โ€ข OpenIM Server โ€ข openim-sdk-android โ€ข openim-sdk-core

OpenIM provides an open-source Instant Messaging (IM) SDK for developers, serving as an alternative solution to cloud services like Twilio and Sendbird. With OpenIM, developers can build secure and reliable IM applications similar to WeChat.

This repository is based on the open source version of OpenIM SDK. You can use this Demo as a reference implementation of OpenIM SDK. @openim/android-client-sdk and @openim/core-sdk are referenced to create native Android applications.

Preview Preview

## License ๐Ÿ“„:

This repository adopts the GNU Affero General Public License v3 (AGPL-3.0) with additional terms. Commercial use is not permitted. For more details, please refer to here.

Development Environment

Before you start developing, please ensure that your system has the following software installed:

  • Operating System: Windows 11 22H2
  • Android Studio: Android Studio Koala | 2024.1.1
  • Gradle: 7.5.1
  • AGP: 7.4.2
  • Java Runtime: 17.0.10

You also need to have the latest version of the OpenIM Server deployed. After that, you can compile this project and connect it to your own server for testing.

Runtime Environment

This application supports the following browsers and operating system versions:

OSVersionStatus
Android7.0-14.0โœ…

Note

  • Gradle&AGP: We recommend that you keep the version consistent with the version in the above instructions. If you need to upgrade, you need to adapt it yourself.

Quick Start

Follow these steps to set up your local development environment:

  1. Clone the repository

    git clone https://github.com/openimsdk/open-im-android-demo.git
    cd open-im-android-demo
    
  2. Open and Sync the dependencies

    • Use Android Studio to open the Demo folder in the project root directory as the App directory of the Android project

      Please note that you should open the Demo folder instead of directly opening the project root directory. We recommend that you first read the official doc to understand the composition of the Android project and the functions of different files in the project.

  3. Modify the configuration

    • In the Constants.java file:

      After deployed OpenIM Server, you need to modified this file to ensure it works properly.

      public static final String DEFAULT_HOST = "your-server-ip or your-domain"
      
  4. If you changed server's port, you need to modify the following code. If not, keep it for default.

    private static final String APP_AUTH = "http://" + DEFAULT_HOST + ":10008/";
    private static final String IM_API = "http://" + DEFAULT_HOST + ":10002";
    private static final String IM_WS = "ws://" + DEFAULT_HOST + ":10001";
    
  5. Start developing and testing! ๐ŸŽ‰

Audio/Video Calls

The open-source version supports one-to-one audio and video calls. You need to first deploy and configure the server. For multi-party audio/video calls or video conferencing, please contact us at contact@openim.io.

Build ๐Ÿš€

This project allows separate builds for the native android application.

  1. Run assemble to build a test apk
gradlew assemble
  1. The apk will be located in the build/output directory.

Features

Description

Feature ModuleFeatureStatus
Account FeaturesPhone number registration \ Email registration \ Verification code loginโœ…
View \ Edit personal informationโœ…
Multi-language settingsโœ…
Change password \ Forgot passwordโœ…
Friend FeaturesFind \ Apply \ Search \ Add \ Delete friendsโœ…
Accept \ Reject friend requestsโœ…
Friend notesโœ…
Allow friend requests or notโœ…
Friend list \ Friend data real-time syncingโœ…
BlocklistRestrict messagesโœ…
Real-time syncing of blocklistโœ…
Add \ Remove from blocklistโœ…
Group FeaturesCreate \ Dismiss groupsโœ…
Apply to join \ Invite to join \ Leave group \ Remove membersโœ…
Group name / Avatar changes / Group data updates (notifications, real-time sync)โœ…
Invite members to groupโœ…
Transfer group ownershipโœ…
Group owner or admin approve join requestsโœ…
Search group membersโœ…
Message FeaturesOffline messagesโœ…
Roaming messagesโœ…
Multi-end messagesโœ…
Message historyโœ…
Message deletionโœ…
Clear messagesโœ…
Copy messagesโœ…
Typing indicator in single chatโœ…
Do Not Disturb for new messagesโœ…
Clear chat historyโœ…
New members can view group chat historyโœ…
New message remindersโœ…
Text messagesโœ…
Image messagesโœ…
Video messagesโœ…
Emoji messagesโœ…
File messagesโœ…
Voice messagesโœ…
Contact card messagesโœ…
Location messagesโœ…
Custom messagesโœ…
ConversationPin conversationโœ…
Mark conversation as readโœ…
Mute conversationโœ…
REST APIAuthentication managementโœ…
User managementโœ…
Relationship chain managementโœ…
Group managementโœ…
Conversation managementโœ…
Message managementโœ…
WebhookGroup callbacksโœ…
Message callbacksโœ…
Push callbacksโœ…
Relationship callbacksโœ…
User callbacksโœ…
Capacity & Performance10,000 friendsโœ…
100,000-member supergroupโœ…
Second-level syncingโœ…
Cluster deploymentโœ…
Multi-device kick-out strategyโœ…
Online StatusNo mutual kick-out across all platformsโœ…
Each platform can only log in with one deviceโœ…
PC, Mobile, Pad, Web, Mini Program each can log in with one deviceโœ…
PC not mutually kicked, only one device total for other platformsโœ…
Audio/Video CallOne-to-one audio and video callsโœ…
File StorageSupports private Minio deploymentโœ…
Supports public cloud services COS, OSS, Kodo, S3โœ…
PushReal-time online message pushโœ…
Offline message push, supports Getui, Firebaseโœ…

For more advanced features, audio/video calls, or video conferences, please contact us at contact@openim.io.

Join Our Community :busts_in_silhouette:

FAQ

  1. How to switch SDK about offline push in the project?

    A: Modified the variants to switch used SDK variant FCMDebug/Release used FCM SDK, others used Getuiใ€‚

  2. Why did the binding file show error when switched variants?

    A: After switching variants, re-run sync to make Android Studio re-index the automatically generated binding files.

  3. How to solve the error like "Unsupported Class flie" and "Class file has wrong version"?

    A: Please make sure that the JRE version in the Android Studio project settings is 17.0.10.