How can individual developers create a free and high-performance app server?

Source: Internet
Author: User

In early January this year, I started to think about it. I am a pure android client programmer, but I want to develop a mobile small bbs forum application by myself. What should I do if I have no server? What if there is no database? What should I do if all programming on the server is forgotten?

So I had an idea: Using Baidu push to push commands and data to the client, the client responded to the request to Baidu cloud disk!

After more than a month of continuous development, the final result proves that this solution is completely feasible and efficient, without spending a penny, we developed the high-performance small bbs forum application "universal discussion". Before I introduce the specific development steps below, let's take a look at the final: Download experience (ps: because there are too many political content in the small forum, all the markets except Baidu refused to include the content, crying .....)




Step 1: analyze the principles of Baidu push

1. basic principle: When I listen to push notifications, many of my friends may think of annoying notify notification reminders and each time I can only send dozens of poor short messages, which is definitely not acceptable, fortunately, Baidu push is not so watery. The rich media push pushed by Baidu has solved the push capacity problem well. The principle of rich media is as follows, you edit an Html document on the push webpage, and click send. This document is sent to the client where your application is installed. The customer clicks this document to open a webpage.

2. My Transformation:

① Decompile the jar package pushed by Baidu, replace the class that will bring up the notification bar of the application, and add your own class file so that the push will no longer have any reminder or disturb the customer's behavior

② Write your own long post into html and use a data organization structure defined by yourself to facilitate the layout of the client and push it to the client

③ When the client receives an html file, the client cannot open the webpage directly because it is ugly and consistent, therefore, we need to write the content of the data defined in this html in the special organization form into xml.

④ By controlling the parsing xml, you can display the desired text typographical effect on the client. For example, as you can see above, my content is what foreigners talk about.

⑤ The focus is that when you want to write raw data in html, the format of the data organization should be easily parsed on the client.


Step 2: use Baidu cloud to make a comment and post System

1. Basic principle: the customer needs to reply after reading your article on the mobile phone, So he uploads the reply content to Baidu cloud disk.

2. my Transformation: I may post more than a dozen posts a day. How can I manage all posts and a large number of replies, what is most convenient here is to make full use of the html file timestamp when Baidu rich media pushes. Each time a user replies to a post,

Put the reply content into a txt document. Using Cloud disk API, it can carry a folder name, And the folder name is the timestamp of this post. In this way, the reply txt files are automatically archived to the folder with the timestamp of the respective posts.

When you want to view the comments, you can download all the txt comments in the folder by requesting the folder with the timestamp of the current post, and control them on the client to display them.


Conclusion: few words are mentioned, but it is very troublesome to do it. For example, if push only sends a download link for a zip package, we still have to download and decompress the package, but the effect is as follows, the customer cannot see that it is implemented through push.

The response experience is the same for requests in the c/s mode, and does not disturb customers.

I spoke quite well. Maybe you don't believe it, so you can download it from the Baidu app and try it out to see if I'm talking about it:

Mobile bbs: Click to download

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.