I remember that when I wrote the year-end summary last year, I was still on the train to see my old friends. At that time, I was full of countless expectations for the New Year. Although it was a race against time, when I announced that the game was over, the harvest, growth, regret and loss of this year had been fixed.

Content of the feed

  • MVP architecture App
  • Floating window components open source
  • NodeJs full stack development
  • The development trend of App web
  • Blog of the Year

MVP architecture App

In view of the chaotic structure and unclear hierarchy of the project, THE idea of MVP architecture was put forward. After internal sharing and pilot practice, the MVP foundation and EventBus were reconstructed in May and June. The benefits of the architecture are continuous, eliminating the coupling of callback functions at all levels, avoiding the most common memory leak problems at the architecture level, while the high decoupling between layers allows us to use different unit testing frameworks for different levels, greatly reducing the cost of writing unit tests.

While MVP and EventBus are not new technologies, it was a first for our project, and as part of a team, it’s not easy to introduce new technologies or new ideas. You have to convince your boss and your colleagues, you can’t just say the technology is good and then your colleagues will convince you, especially the difference in skill level and vision, without cognitive resonance, it’s hard to push the implementation. As the new face of the team, I also took pains to share MVP in the group at the beginning, and then took the lead in practicing MVP in the newly acquired business. The following experience really made everyone fully recognize me:

Around April or May, as features were added, the hidden memory leaks here and there finally reached a tipping point, causing OOM problems in large numbers. After the memory tool investigation, repeated testing, observe the memory trend, walk most of the history of the code finally solved the problem. I write the detailed solve process two internal share article, whipping corpse n several black code (a lot of people for fear of affecting the relationship between colleagues, would rather tolerate slag code, also don’t want to, I really don’t agree with this kind of values, for the formation of technology atmosphere is very bad, slag code is to whip corpse, I think we should advocate review, whipping corpse slag code to each other.) The memory overflow is not at a single function point, but rather at handlers scattered all over the place that keep the layers together. To circumvent these problems, MVP + EventBus came along, and it really took off.

In addition to communication skills, there are two things you should do to introduce new technology into your team: 1. Understand the problems of the project; 2. Use the technology you want to introduce to solve the current problems; 3.

Floating window components open source

In order to facilitate players to experience the service of our App without switching the game during the game, we need to “stretch out our hands” into the game and appear at the right place and time. The function of App is castrated into the floating window, so the logic is still complicated. After several versions, there are many problems, especially the compatibility problem. After solving these problems, I think we should deposit the floating window component and open source it: github.com/liuguangli/… .

Plug-in research

In the design of floating window function, I planned to make it in the form of plug-in at first, and spent a lot of time on the research of plug-in. I looked at several open source frameworks, which improved the design mode, Android framework, App loading and execution, and finally formed a series of articles on plug-in research:

  • DexClassLoader for Plug-in research of Android Applications
  • AssetManager: Plug-in Research for Android Applications
  • Plug-in Research ACTIVITY Registration
  • Resource Conflict in Plug-in Research

NodeJs full stack development

The demand of App client is becoming less and less, so it happens that the back-end needs to do business reconstruction and separate the front and back ends, and actively apply to participate in the development of front-end NodeJs project and support the launch of the first new business from scratch. The separation of the front and back ends is also a kind of decoupling in terms of organizational architecture. In order to free the back end from the nightmare of “code pages” and focus more on the development of data business, the back end is oriented to fine-grained API development, focusing only on services and interfaces. NodeJs, as the middle layer of services to users, is user-oriented development, focusing on interaction and interface, and providing multi-end feature adaptation.

The development trend of App web

React Native (RN for short) has been sharing practical experience in various technical salons. In September 2015, RN released open source, which is a breakthrough in the idea of cross-platform App development: Web programming and original biochemistry experience.

In June 2016, Ali open source Weex; In September 2016, wechat mini program was open for internal testing; RN, Weex and applets share the same idea: a Web programming technology is used to write pages, and the js generated is deployed to the server and then delivered to the client. The client App is equipped with a JS interpreter, and finally converted into a Native component. RN uses the syntax of React to write program logic, and the client uses JavascriptCore as the JS interpreter. Weex uses Vue syntax programming, and the client uses V8 kernel as Js running environment. Micro channel small program and the first two differences may be slightly different, slightly slower evolution, small program to provide programming and Weex is very similar, but ultimately sent to the client to execute HTML and JS files, and finally by X5 kernel to execute HTML and JS.

What RN, Weex, and wechat mini programs have shown me is a change in programming, where App native development and Web development are being unified. The emergence of micro channel small program once caused a lot of discussion, there is a discussion about whether small program will annex App, I don’t think so, but I think: micro channel small program can do, Weex can do, RN can do, then OS is not easy to do it? Surely such an OS will come? (At this point, I can’t help but turn to Google, which is rumored to be working internally on an Andromeda operating system that will combine Chrome OS and Android.) That was the time of true unity. Technology development has been following Moore’s Law, performance and bandwidth have been improving year by year, and the gap between Web and native experience is narrowing. Opening App Web must be a trend.

Blog of the Year

This article summarizes the basic idea of plug-in development.

  • DexClassLoader for Plug-in research of Android Applications
  • AssetManager: Plug-in Research for Android Applications
  • Plug-in Research ACTIVITY Registration
  • Resource Conflict in Plug-in Research

2 floating window series of articles, summarizes the Android window system related knowledge points.

  • “Window Hierarchy for Floating Window Development”
  • “Using floating Windows beyond User Authorization”
  • “How an ACTIVITY receives TOUCH events (Windows and user input systems)”

3 Introduction to the Internet of Things series of articles, summarizing NodeJs in the hardware field, using Ruff to DIY your own appliances.

  • DIY Internet of Things Application 1- Learning Plan
  • DIY Internet of Things Application 2-RuFF Introduction
  • DIY Internet of Things Application 3-Control Relay
  • DIY Internet of Things Application 4- Remote control fan
  • DIY Internet of Things 5 — Mobile Phone Control Fan

4. Experience, thinking and methodology

  • The Path of The Programmer
  • Cognitive Dissonance for Programmers
  • How Important is a Programmer’s Luck?