[Android share] social software development Solutions

Source: Internet
Author: User

A simple social software solution should solve the problem:

Communication/sharing/space (Friends Circle)/user/friends/news/chat history.

Socializing is mainly about communication and the Circle of Friends (space). Communication is also divided into text, emoticons, voice, video. The circle of friends mainly includes the dynamic of oneself and friends, some also contain the information that the system recommends.

This is what I use Bmob examples of solutions provided:

communication: based on the establishment of BMOB push service, there is a message to push the notification or information to the participant side, the text can be pushed directly, for the video, voice push is the storage connection address, when the participants receive a push message, according to the address download the message. There are two ways to look at a facial expression, one is to store the expression pack locally, and the other is to be identified by the corresponding message type, like video and voice. Here video, voice, if emoticons are used in the same way as video and voice, use the Bmob file service store. Chat logs are stored using the BMOB table structure.

User management: The user is the whole social process of the object, friends, communication, dynamic, circle of friends, record query, comment dynamic and so on are based on the user's foundation. The use of the services provided by Bmob is a good solution to the contact between users. Room Diagram:

650) this.width=650; "id=" aimg_164860 "src=" http://a1.eoeandroid.com/attachment/forum/201604/25/ 154440pi8wo6f5zq8ju5wr.png "class=" Zoom "width=" "height=" 451 "alt=" 154440pi8wo6f5zq8ju5wr.png "/>

user tables: Each app has only one user table, which is automatically generated by the Bmob service to manage the users who use the app:

650) this.width=650; "id=" aimg_164861 "src=" http://a1.eoeandroid.com/attachment/forum/201604/25/ 154543acetmxocozhcwt2o.png "class=" Zoom "width=" "alt=" 154543acetmxocozhcwt2o.png "/>"

User Friends Table : Use the app for a user's friend information table, one item in each user table should correspond to a friend table, the developer will be created according to when a new record is inserted in the user table, to manage all the friends of that user, such as according to the user table above, would need to create Windworld _friends and Rainworld_friends tables.

650) this.width=650; "id=" aimg_164862 "src=" http://a1.eoeandroid.com/attachment/forum/201604/25/ 154607kzcg9cw9djr2l03c.png "class=" Zoom "width=" "alt=" 154607kzcg9cw9djr2l03c.png "/>"

is Rainworld friend table;

User Dynamic Table: All of the user's dynamic storage tables, as well as one item in each user table, should correspond to a dynamic table that manages the dynamic of the user's publication (Friend Circle Dynamics); Rainworld_ should be created based on the contents of the user table above Dynamic and Windworld_dynamic tables.

650) this.width=650; "id=" aimg_164863 "src=" http://a1.eoeandroid.com/attachment/forum/201604/25/ 154644ezf2tal3a8f75fzf.png "class=" Zoom "width=" "alt=" 154644ezf2tal3a8f75fzf.png "/>"

is a dynamic table of Rainworld;

Chat Log table: the user participates in the session of the table, when creating a new session, create a session table, which stores the session content, it is recommended to use the ID of both sessions to create a session table;


It's Rainworld and Windworld's Chat history table:

650) this.width=650; "id=" aimg_164864 "src=" http://a1.eoeandroid.com/attachment/forum/201604/25/ 154728u08xb9vaag50agxg.png "class=" Zoom "width=" "alt=" 154728u08xb9vaag50agxg.png "/>"

Scheduled Task Store table: stores the results of timed task Execution (note: The timing task is mainly to get and update the friend dynamic, when the friend dynamic, only need to read this Schedule Task table can be);

Note: In addition to the user table, other data table Bmob are not created and must be created by the developer as needed. For example, when the user registers, the corresponding user friend table and the dynamic information table should be created according to the registered information, and when there is a session, the session table related to the session is created, which is used to store the records, and when the multimedia information needs to be uploaded, the corresponding file Information store table (the path of the main storage multimedia file) These tables can be created directly using the Bmob service object, which corresponds to the object store, which is available for viewing: Http://docs.bmob.cn/android/developdoc/index.html?menukey=develop_doc &key=develop_android#index_ add data.


Chat history uses table-structured cloud storage. A unified structure to identify whether the information is a multimedia type, if it is presented in a different way. Local distribution through a custom data structure (when the customer accepts the message, parsing the message structure, depending on the type of the custom message, decides what to do, either by displaying the text message directly, or by displaying the image, or by displaying the video, or by displaying the audio information). Communication process:

650) this.width=650; "id=" aimg_164865 "src=" http://a1.eoeandroid.com/attachment/forum/201604/25/ 154804oyb4etbk4uoeembm.png "class=" Zoom "width=" "alt=" 154804oyb4etbk4uoeembm.png "/>"

The above is a specific way to communicate social software , which simply describes the use of BMOB services to achieve simple social solutions. Where A and B represent two clients of communications, which can be Android or iOS. Here A, B can upload multimedia information and download multimedia information. Push and message communication is not the direct push of images, voice, video, these push is only the storage address. For example, when a message is sent by a like B, a message is pushed to B by a, in which case a voice, video, or image is synchronized to the file service store of the Bmob service. When B receives the push message, the corresponding processing according to the type, if it is video, audio, image download.


such as how to send images:

650) this.width=650; "id=" aimg_164866 "src=" http://a1.eoeandroid.com/attachment/forum/201604/25/ 154826phkbolc1tvddufzd.png "class=" Zoom "width=" "alt=" 154826phkbolc1tvddufzd.png "/>"

1: Gets the image to send;

2.0: Push the message sending the image to B;

2.1: Synchronize with 2.0 to save the image file to the Bmob file server;

3.0: Receive the push image message;

3.1: After receiving the image message, download the image file from the Bmob file server;

The above several processes implement communication between A and B.

Note: The communication process of multimedia information such as voice and video is similar to the image. You do not need to use file storage for text.

The above operation will need to tell the file upload to the Bmob cloud service, the same need to create a session record table, need to update the file storage table

Space (Circle of Friends): Here is a circle of friends as a template, you can see all the friends dynamic, while you can view individual dynamic, but also a separate view of a friend dynamic, which are viewed in chronological order, from the most recent start. There is an independent storage method, a friend a dynamic information table. The circle of Friends is implemented with the cloud code provided by Bmob. When requesting a circle of friends, call the cloud to query the Friends circle from the Bmob cloud, of course, the friend Circle contains the friends news and comments. Use the cloud code to dynamically organize it into HTML or return a list of custom data structures, such as JSON data, and return it to the requester.


There are two solutions , one for each request based on the Friend information table, one is to use a timed task to dynamically update the scheduled task table, when you need to view the dynamic (Circle of Friends), the corresponding time to read the Task storage table.

Because the circle of friends also contains their own dynamic and friends, the dynamic should be able to comment on friends, you can also view their own dynamic record and comment records, to see their own dynamic is directly to get their own dynamic table, when you need to comment on the dynamic of friends, The content of the comment will be updated dynamically based on the friend table to find the corresponding dynamic table.


This article is from the "12012117" blog, please be sure to keep this source http://12022117.blog.51cto.com/12012117/1844662

[Android share] social software development Solutions

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.