️ Special reminder: If Github is slow to download, please go to: https://gitee.com/jackjiang/MobileIMSDK. The code is fully synchronized, so please feel free to download. ️
❤️Latest news: Hongmeng Next version of MobileIMSDK has been released❤️
1. Shortcut directory
1.1. Theoretical information
- Network programming theory classic "TCP/IP Detailed Explanation" (online reading version)
1.2. Related information
- MobileIMSDK version update log
- MobileIMSDK FAQ?
- MobileIMSDK performance test report
1.3. Product cases
- RainbowChat trial version?
- Screenshot preview of RainbowChat trial version
- Some non-sensitive operational data of a certain Chat
1.4. Demo installation
- Client Demo installation and usage help (Android)
- Client Demo installation and usage help (iOS)
- Client Demo installation and usage help (Java)
- Client Demo demonstration and description (H5)
- Client Demo demonstration and explanation (WeChat applet)
- Client Demo demonstration and instructions (Uniapp)
- Client Demo demonstration and explanation (Hongmeng Next)?
- Server-side Demo deployment and usage help
1.5. Development Guide
- Client Development Guide (Android)
- Client Development Guide (iOS)
- Client Development Guide (Java)
- Client Development Guide (H5)
- Client Development Guide (WeChat Mini Program)
- Client Development Guide (Uniapp)
- Client Development Guide (Hongmeng Next)
- Server Development Guide
1.6. API documentation
- Client SDK API documentation (Android): TCP version, UDP version
- Client SDK API documentation (iOS): TCP version, UDP version
- Client SDK API documentation (Java): TCP version, UDP version
- Client SDK API documentation (H5): Click here to enter
- Client SDK API documentation (WeChat applet): Click here to enter
- Client SDK API documentation (Uniapp): Click here to enter
- Client SDK API documentation (Hongmeng Next): complete manual, API documentation
- Server SDK API documentation
1.7. Package download
- MobileIMSDK latest version package download?
- Foreign address: Github address of MobileIMSDK
- Domestic address: MobileIMSDK’s code cloud gitee address (fast access!)
1.8. Learning and communication
- Technical exchange community: click here to enter
- FAQ Discussion: Click here to enter?
- Technical exchange Q group:
215477170
? - For technical support/cooperation/consultation, please contact the author QQ:
413980957
(About the author?) - Follow my official account: :point_down: :point_down:
2. Project Introduction
MobileIMSDK is an original IM communication layer framework developed specifically for mobile terminals:
- It has been tested for 10 years;
- Ultra lightweight and highly refined, the lib package is within 50KB;
- Carefully encapsulated, a set of APIs elegantly supports three protocols: UDP , TCP , and WebSocket (probably the only open source one on the entire network);
- The client supports iOS, Android, standard Java, H5 (not yet open source), mini program (not yet open source), Uniapp (not yet open source), Hongmeng Next (SDK not yet open source, Demo complete source code);
- The server is based on Netty, with excellent performance and easy expansion; :point_left:
- It can seamlessly interoperate with the sister project MobileIMSDK-Web to realize web chat or push, etc.; :point_left:
- It can be applied to various scenarios such as cross-device and cross-network chat apps, enterprise OA, and message push.
The MobileIMSDK project has been continuously upgraded since October 2013 (the latest version is v6.5, click here to view the version update log). After 10 years, it was initially used as the bottom layer of instant messaging for a self-use product and was developed completely from scratch.
At present, the latest Hongmeng Next version has been developed. I hope it can inspire and help those in need.
You may need: View more questions and answers about MobileIMSDK.
Another sister project: the lightweight Web-side instant messaging framework: MobileIMSDK-Web is also being continuously updated and is dedicated to web chat and message push on mobile phones or PCs.
3. Synchronous update of code hosting
code cloud gitee
- Code hosting: https://gitee.com/jackjiang/MobileIMSDK
- Technology Community: Click to view more information
GitHub.com
- Code hosting: https://github.com/JackJiang2011/MobileIMSDK
- Technology Community: Click to view more information
MobileIMSDK version update log: Click here to view?
4. Design Goals
Let developers focus on the development of application logic,复杂的即时通讯算法交由SDK开发人员
, thereby解偶即时通讯应用开发的复杂性
.
5. Framework composition
The entire MobileIMSDK framework consists of the following 7 parts:
- Android client SDK: used for Android version of instant messaging client, supports Android 4.0 and above, view API documentation;
- iOS client SDK: used to develop iOS instant messaging client, supports iOS 12.0 and above, view API documentation;
- Java client SDK: used to develop cross-platform PC instant messaging clients, supporting Java 1.6 and above, see API documentation;
- H5 client SDK: There is no open source version yet, please check the refined annotated version;
- WeChat Mini Program SDK: There is no open source version yet, please check the edited and annotated version;
- Uniapp SDK: There is no open source version yet, please check the edited and annotated version;
- Hongmeng Next SDK: There is currently no open source version of the SDK (see the refined annotated version), and the complete project source code of the Demo;
- Server SDK: used to develop instant messaging servers, supports Java 1.7 and above, please view the API documentation.
The architecture of the entire MobileIMSDK framework consists of:
MobileIMSDK has been continuously developed and upgraded, and Hongmeng Next client is the latest achievement of the MobileIMSDK project.
In addition: MobileIMSDK can seamlessly interoperate with its sister project MobileIMSDK-Web, thereby enabling chat or push on the Web page.
6. Technical characteristics
- Time-tested: After 10 years, it has been continuously upgraded from the Andriod 2.3 and iOS 5.0 era to the present (it is by no means unfinished);
- Super lightweight: highly refined, lib package within 50KB;
- Multiple protocols: It may be the only open source framework of its kind in the entire network that can support three protocols, UDP, TCP, and WebSocket, simultaneously with one set of APIs?;
- Multiple networks: Carefully optimized TCP, UDP, and WebSocket protocol implementations can be applied to satellite networks, mobile networks, embedded IoT and other scenarios;
- Multi-terminal coverage: The client supports iOS, Android, standard Java, H5, WeChat applet, Uniap, and Hongmeng Next;
- Efficient cost-effectiveness: Unique UDP protocol implementation, no connection characteristics, can achieve higher network load and throughput capabilities under the same conditions;
- Message direction: supports all possible directions of messages in instant messaging technology, a total of 3 types (i.e. C2C, C2S, S2C);
- Sticky and half-packet: elegantly solves the classic sticky and half-packet problems of TCP at each end. The bottom layer is encapsulated and the application layer is completely imperceptible;
- QoS mechanism: Complete message delivery guarantee mechanism (automatic retransmission, message deduplication, status feedback, etc.) to ensure that no message is missed;
- Robust and reliable: Practice has shown that it is very suitable for stable and reliable operation in high-latency, cross-continental, and different network standard environments;
- Network disconnection recovery: It has the ability to automatically detect network conditions and automatically heal network disconnections;
- Original algorithm: The core algorithm and implementation are all original, ensuring room for continuous improvement and improvement;
- Multiple modes: Preset multiple real-time sensitivity modes to control immediacy, traffic and client power consumption according to different scenarios;
- Data compression: Implemented with its own protocol, data compression can be customized in the future to flexibly control client traffic and server network throughput;
- Highly encapsulated: The highly encapsulated API interface ensures the simplicity of calling and also makes it applicable to more application scenarios;
- Web support: It can seamlessly interoperate with sister project MobileIMSDK-Web to realize web page chat or push, etc.; :point_left:
- Good scalability: The server is based on Netty and inherits Netty’s excellent high scalability;
- Excellent performance: The server inherits the high performance and high throughput features of Netty, and is suitable for high-performance server scenarios.
All three types of instant messaging message trends supported by MobileIMSDK are:
(1) Client to Client (C2C): It is initiated by a client and the recipient is another client;
(2) Client to Server (C2S): It is initiated by a client and the recipient is the server;
(3) Server to Client (S2C): It is initiated by the server and the recipient is a client.
You may need: View more questions and answers about MobileIMSDK.
7. Performance test
Stress testing shows that when MobileIMSDK is used in push scenarios, the theoretical single-machine load can approach tens of millions. When used in chat applications, the load on a single machine can reach hundreds of thousands.
Of course, each application has its own characteristics and differences. Please evaluate it based on specific scenarios. The test data is for reference only.
Performance test report: Click here to view.
8. Demonstration program
- Android client Demo: Click here to install and use;
- iOS client Demo: Click here to install and use;
- Java client Demo: Click here to install and use;
- H5 client Demo: Click here to view the introduction;
- WeChat Mini Program Demo: Click here to view the introduction;
- Uniapp Demo: Click here to view the introduction;
- Hongmeng Next Demo: Click here to view the introduction?;
- Server Demo: Click here to install and use.
9. Application cases
① Product-level chat APP based on MobileIMSDK:
Detailed introduction, download experience or view running screenshots.
② MobileIMSDK case under high network delay:
A certain commercial product based on MobileIMSDK once operated in a complex intercontinental network environment. The end-to-end communication delay can be as high as more than 600ms when the intercontinental network is busy (the one-way delay with the server is about 300ms, and usually when people visit domestic The latency of mainstream portals is about 20~50ms). Click here to view non-sensitive operational data for a certain period.
10. Package download (all in one)
? ① Latest release version (overseas address): Github package download
? ② Latest release version (domestic address): code cloud gitee package download (fast access! ?)
Note: The latest release package contains complete demo source code, sdk source code, api documentation, compiled distribution package, etc.
11. Typical application scenarios
Scenario 1: Chat APP
- Application description: It can be used to develop chat tools similar to WeChat, QQ, etc.
- Message direction: All types of C2C, C2S, and S2C need to be used.
- Special note: MobileIMSDK does not define the application layer logic and protocols of chat applications. Developers can define and implement them by themselves.
Scenario 2: Message push
- Application description: Can be used for various types of APPs that need to push information to clients in real time.
- Message direction: Only one message direction of S2C is used, which is the simplest application scenario of MobileIMSDK.
Scenario 3: Enterprise OA
- Application description: It can be used to push various messages such as instructions, official documents, and applications for enterprise OA in real time, greatly improving the user experience, and can be extended to mobile devices.
- Message direction: Only one message direction of S2C is used, which is the simplest application scenario of MobileIMSDK.
Scenario 4: Enhanced version of enterprise OA
- Application description: It can be used to realize real-time interaction of various system-level and user-level messages in enterprise OA, making full use of instant messaging technology to enhance the value of traditional OA.
- Message trend: All types of C2C, C2S, and S2C can be used. This is no different from chat APPs in many aspects. However, enterprise OA has its own user relationship management model and logic, which is much simpler than full-featured chat APPs.
12. Development Guide
- Android client development guide: Click here to view;
- iOS client development guide: Click here to view;
- Java Client Development Guide: Click here to view;
- H5 client development guide: Click here to view;
- WeChat Mini Program Development Guide: Click here to view;
- Uniapp development guide: Click here to view;
- Hongmeng Next development guide: Click here to view;
- Server-side development guide: Click here to view.
13. Authorization method
You can use MobileIMSDK for free and freely forever, for example, for research, study, and even commercial purposes. However, it is prohibited to use it for commercial purposes beyond the scope of the license. Please respect intellectual property rights. For more detailed authorization instructions, please see the "12. Authorization Methods" section in the MobileIMSDK community introduction post.
Supplementary note: If you need more technical support or technical cooperation, please contact the author, QQ: 413980957
(:point_right: About the author).
14. Contact information
- Discussion, learning and information area: :earth_americas: Click here to enter;
- Instant messaging technology exchange group:
185926912
(For more QQ groups, click here to enter); - Please send bugs and suggestions to: :love_letter:
[email protected]
; - For technical training/transfer/cooperation/consultation, please contact the author QQ: :penguin:
413980957
, WeChat: hellojackjiang
(:point_right: About the author).
15. Donate to the author
Excellent open source needs your support to go further. I sincerely thank you for your support and understanding, and I hope you can benefit from open source.
- Donation link: Click here to enter.
16. Follow the author
- About the author: Click to enter?
- Recommended attention: BeautyEye Engineering
- Blog address: click to enter
- Github homepage: click to enter
- My official account: :point_down: :point_down:
Appendix: Demo running screenshots
1. The effect of MobileIMSDK Demo running on Hongmeng Next:
编译和运行:
View the complete source code of Hongmeng Next Demo.
2. MobileIMSDK Demo running effect on Android and iOS:
安装和使用:
Enter the Android version Demo help page, enter the iOS version Demo help page.
3. MobileIMSDK Demo running effect on H5 side:
4. The effect of MobileIMSDK Demo running on WeChat applet:
5. The effect of MobileIMSDK Demo running on Uniapp:
6. MobileIMSDK Demo running effect on Windows:
安装和使用:
Enter the Java version Demo help page.
7. MobileIMSDK Demo running effect on Mac OS X:
安装和使用:
Enter the Java version Demo help page.
8. MobileIMSDK-Web version client Demo running effect:
1)MobileIMSDK-Web Demo在手机端浏览器运行效果:
View the details of MobileIMSDK-Web version.
2)MobileIMSDK-Web Demo在PC端多种主流浏览器的运行效果:
View the details of MobileIMSDK-Web version.
Case 1: Full-featured mobile IM product based on MobileIMSDK
关于RainbowChat产品的更多资料请见:
Screenshots of all functions of RainbowChat products (real-life video: Android and iOS).
[Special Note]: Because the github image was blocked, the image was not synchronized successfully. Please check it from the screenshots of all the functions of the RainbowChat product! :point_left: :point_left:
更多清晰运行截图请见:
Screenshots of all functions of the RainbowCha product.
Case 2: Web-based IM system based on MobileIMSDK-Web
RainbowChat-Web product main interface:
更多截图和视频:
Click here for more screenshots and click here for more demonstration videos.
RainbowChat-Web product main interface (when the chat window is full screen):
更多截图和视频:
Click here for more screenshots and click here for more demonstration videos.
RainbowChat-Web product main interface (independent UI effect):
更多截图和视频:
Click here for more screenshots and click here for more demonstration videos.