(Imitate WeChat Android) chat + red envelope + live broadcast + circle of friends source code released

Today, I recommend an Android open source project - the latest version of "Fanxin", which is worth researching by development and product students.

Function overview:

IM chat

, single chat/group chat/chat room--based on Huanxin sdk

red envelope functions:

1. One-to-one red envelopes

2. Group red envelopes (grab red envelopes, answer red envelopes, exclusive red envelopes)

3. Wallet (funds and account management) )

Live broadcast function:

Ucloud push stream, Ucloud pull stream, radio pull stream

Moments , user system, friend system FanXin

own server maintenance and management data

Detailed introduction

(FanXin) Background introduction: https://github.com/huangfangyi/FanXin2 .0_IM
http://www.imgeek.org/article/825307627

Since Fanxin's 1.0 and 2.0 are developed based on the Huanxin SDK 2.x series, and the current Huanxin official push is the 3.x series of SDK, In this context, the author decided to migrate Fanxin to the 3.x demo. During the migration, some optimizations were made to the storage mechanism and network interface. At the same time, for the current hot live broadcast APP, combined with the chat room function of Huanxin and ucloud, two modules have been made - watch live broadcast and live broadcast; for the common red envelopes/grabbing red envelopes in IM scenarios, the cloud account is integrated. The red envelope SDK provided by (www.yunzhanghu.com) is a very recommended solution for developers who want to do red envelopes and account management. Developers do not have to worry about security issues, nor do they have to worry about the logic in development. Caused by the loss of funds in the transfer and other problems.

Body:

This update is divided into three parts for a detailed introduction

1. Live broadcast function;

2. Red envelope function;

3. Reconstruction and optimization of existing functions of Fanxin 2.0.

1. Live broadcast function:

The development of the live broadcast room involves three main points:

1. The source of the video to watch (pulling the stream)

2. The push of the live video broadcast by the host (pulling the stream);

3. The live broadcast room: between the host and the fans, the fans Subtitle interaction with fans.

The solution in the letter is:

1. To watch live broadcast (pull stream) and start live broadcast (pull stream), you only need to import an rtmp video stream. This project uses a Hong Kong Satellite TV radio live video
stream for everyone to test. Another way is to push the stream by setting the id of the live broadcast room, and then input the corresponding id to pull the stream. The developer can test it through two mobile phones. The premise is to ensure that the network environment is good;

2. For the interaction in the live broadcast room, the general live broadcast platform will have functions such as typing barrage, gift giving, private chat, etc., which is a communication problem. At present, the chat room function based on Huanxin in Fanxin has completed the part of typing interaction, and other parts can be realized according to this principle, which is nothing more than classifying messages (chat messages, gift messages, private chat messages).

2. Red envelope function (implemented through the cloud account red envelope SDK):

The demand for red envelopes in social APPs is increasing, and the problems involved in the independent development of this piece will at least include the following two points:

1. Security issues - payment security and funds Safety;

2. The problem of packet loss, such as in the red envelope game, the funds for sending red envelopes involve freezing funds, the received ones need to be settled, the expired ones must be returned, and the notification callback of the receiving status,
etc.

In the complex and high-frequency red envelope and transfer scenarios, how to ensure that each transaction has a complete tracking and fault tolerance mechanism on the mobile terminal and the server side are all issues that developers must consider. However, to design a complete solution and successfully develop it, the technical cost and time cost to be invested are very high. However, the red envelope is only an auxiliary module of the APP, and the high cost is not worth the gain. To this end, the author contacted the cloud account, which combined with most of the IM\customer service SaaS service providers in the market, and launched a red envelope SDK suitable for various application scenarios, which perfectly solved the efficiency and security issues. Developers only need to spend a few hours to integrate a complete red envelope + change solution.

Of course, red envelopes are not just a simple function. In addition to the one-to-one and group red envelopes we have seen in WeChat, red envelopes also have very clever monetization functions, such as brand advertising red envelopes, voucher red envelopes, transfers, financial services, life services, etc.

3. Optimization for the existing functions of Fanxin 2.0

1. In the registration interface, the registered account of Huanxin adopts authorized registration and is placed in the back-end processing;

2. The original access mechanism of the Fanxin server interface is changed to okhttp processing;

3 、 Huanxin SDK from 2.x series to 3.x, the version used (version V3.1.3 R2 2016-6-15);

4. Moments:

a. Click on the avatar to view user information;

b. Large image loading library Go from ImageLoader to Glide;

c. Click the comment icon to pop up the popwindow dislocation problem to fix;

5. Personal Center->Data update interface merge;

6. Add QR code and scan it;

7. Wallet-delete all original settings and enable The cloud account red envelope SDK is replaced;

8. The current user data processing mechanism - encapsulated in the JSONObject class, and managed in the memory layer and Perference;

9. Group avatar - from 5 combinations to 9 combinations;

10. Add userInfo field to friend information management, which is used for scalable user information system;

11. Extract several tool classes;

12. Fanxin related core code Directory: com.fanxin.app.main.*; Resource related prefixed with fx_;

Resource related: APK experience address: http://fir.im/wy79

github project source code (main update source): https://github .com/huangfangyi/FanXin3.0

developer account: 84543217 (only dealing with outsourcing development needs)

Fanxin developer group: 437758366

APP red envelope function group: 366135448

Surprise! Download and install the Fanxin client, enter the cloud account red envelope group, and you can grab a 10,000 yuan cash red envelope! Developers, please join the group!

How to participate:

1. Download the Fanxin APP activity version (http://fir.im/wy79)

2. Click "Discovery Page" ---> Cloud Account Red Packet Group

3. Wait for the arrival of the red packet rain.

Remarks: A single red envelope of 200 yuan will be sent 25 times, and each time will be divided into 30 copies. Lucky students can grab a few hundred yuan in cash red envelopes! ! !

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326608964&siteId=291194637