This article is sponsored by Yu Gang Said Writing Platform

Original author: Two low-profile Android pros

Copyright notice: The copyright of this article belongs to the wechat public account Yu Gangshuo

An overview of the

The 2018 GMTC Conference was just held in Beijing on June 22, 2018. GMTC Conference is a top technology event hosted by Geekbang Technology and InfoQ China, mainly involving front-end, mobile, terminal AI and other technology fields. It has been held for 3 sessions since 2016. Judging by this year’s popularity, GMTC is one of the most important vertical conferences for big Front-end developers.

Attended the world conference GMTC, special meeting of 14 basic covers all aspects of the large front end, and the full schedule for energy consumption is also very big, but also gain a lot, in addition to being able to learn about the companies facing the technical problem and solution, can also learn about the current cutting-edge technology hotspots and direction in the future. Strike while the iron is hot to talk about some personal gains and feelings, the conference includes 14 special topics, including Android new technology special, iOS new technology special, Node special, Web framework special, UI and animation, PWA special, terminal AI, engineering, cross-platform special, performance optimization and monitoring. Since there are many topics, many topics are delivered in parallel, so I will mainly talk about two topics that I am concerned about.

1) Android new technology special

2) Performance optimization and monitoring

Android new technology special

New technology represents the current technology hotspot and future direction. As a big front-end RD, it has to pay attention to the direction of big front-end technology all the time. Android new technology special session mainly has three themes to share, respectively is “Android research and development yesterday, today and tomorrow”, “when plug-in meets Android P” and “fast application development and implementation guide”.

Android: Yesterday, Today, Tomorrow

The author has rich experience in software development, promoted the development and formulation of relevant mechanisms of App componentization, dynamic deployment, hot patch and other technologies, and improved the experience of Android devices. Including Greenify App Convention, Android6.0-Doze&App Standby/Android7.0- Partial restriction on static broadcast registration /Android8.0- full restriction on static broadcast registration and background services, etc.

First of all, the author thinks that the development of Android yesterday belongs to an era of traffic enclosure. At first, the traffic entrance of simple WebApp was transferred to the entrance of NativeApp. Because the flow is the basic concept of the Internet, with the flow, with the user, just have more in-depth transformation, so the flow is the key first step, so yesterday belongs to the era of the entrance to seize the flow.

Secondly, the author believes that the development of Android today is an era of traffic attack and defense. As the functions of major applications become more and more complex and the scale becomes larger and larger, and the access to traffic is obtained, it is necessary to attack both the attack and defense. The transition from large applications to installation-free applications, such as PWA, Google Play Instant and small programs, etc. Use a Shortcut, Contextual Push, Rich Notification, etc.

Finally, the author believes that the future of Android development will be an era of infiltration of mind, which needs to shape differentiated cognition for different groups. The author believes that the fundamental changes to come are the paradigm shift of mobile Internet and the technology stack transition of mobile applications.

In conclusion, the author thinks that in terms of technology, it is simple: yesterday it was from Web to Native, today it is cross-platform, and tomorrow it is cross-terminal.

When Plug-ins Meet Android P

First, the author introduces the timeline of Android P. Google released a preview of Android P in March today, and the final release is expected in Q3 of this year. Android P has issued a ban: it is forbidden to call non-SDK interfaces. Various ways of accessing non-SDK interfaces will produce errors or other undesirable consequences. If the following table details the various access methods and corresponding results.

Quick Application Development and Implementation Guide

Fast application is a new application ecosystem jointly launched by nine mobile phone manufacturers based on hardware platforms. Users do not need to download and install the app, but use it to enjoy the performance experience of native apps. First of all, the author used two small videos to show the use of fast application scenarios and an example of multi-scene integration. Both Kuaishou and H5 are generated by scaffolding. The author makes a comparison and analysis, as shown in the figure below.

Finally, the author summarizes the architecture of the whole fast application: data-driven +DOM model + application management.

Performance optimization and Monitoring special session

Especially these two years, performance optimization and monitoring direction increasingly brought to the attention of the companies, popularity can also be reflected from the scene, a whole afternoon speech, room full of people, and many are sitting on the ground directly, the platform edge, even the door there is a big Bob is really crowded not came in at the door. Performance Optimization and Monitoring special session mainly has 4 topics to share, the ultimate goal of these 4 topics is the same, the methods used are not the same, but the overall idea is similar, limited to the space, here mainly share “LinkedIn Mobile application performance optimization”.

How to Optimize LinkedIn Mobile Performance

First, it introduces why performance optimization should be done. The author’s point of view is that users come first. Then, it shows that LinkedIn has more than 500 million registered users, more than 20 business lines, more than 200 team developers and 4 million lines of code. Then, the author points out that performance problems are often caused by too large a project scale. Therefore, reasonable architectural design can simplify the problems. To solve performance problems, good architectural design is needed first. As shown in the figure below, project componentization should be the only way to change the architecture of any project, separating different modules into independent components that can run independently.

1) Section-oriented programming, avoid intrusion into business as far as possible, so as to achieve no perception of business level;

2) Data collection includes not only the data of performance indicators, but also the contextual data of performance problems, as well as the division of business lines and responsible persons;

3) data acquisition is completed in the end is to be uploaded to the server, in the process of upload, if too fast will cause too much pressure to the server, and may be the main business flow out, too slow and can not repair in time to the problem, so need to weigh the server pressure in the process of data upload and effectiveness;

4) Due to the large amount of logs collected, it is impossible for us to analyze all logs, so we need to choose the priority of logs. Data with high requirements for effectiveness, such as Crash logs and some customized events delivered in real time, are expected to be uploaded to the server quickly. Unimportant logs are temporarily stored in the client first and uploaded in batches after compression.

Thirdly, the author shows the whole scheme of linkedin from data collection, storage, reporting to data visualization. As shown in the figure below: First, the client collects data and uploads data to the background through the data upload Api interface provided by the background. The background service writes data to Kafka and then distributes the data to downstream subscribers: Samza real-time task and HDFS. Samza real-time task is mainly streaming processing with high real-time performance. HDFS is a scheduled task processing every day or every hour. It mainly performs batch operations on offline data and processes a large amount of data, but the real-time performance is poor. When the processing is completed, the real-time data and timing data will be written into the database, through the data visualization tool, you can see the table corresponding to different data; Finally, the performance problem can be monitored in real time by setting the alarm threshold of the data.

With the performance log, the next step is to analyze the log. First let’s see if we can reproduce the current problem; Then check whether the current network and data switch are normal; Finally, some analysis tools are used to analyze the obtained logs and locate problems. After the fault is located, you need to rectify the fault. The common solutions include degrading the background service, sending patches to the client for hot repair, and releasing new versions. After fixing the problem, the last step is to verify that the problem you just fixed has been completely fixed and will not affect other functional modules.

Finally, the author introduces the specific practice of performance optimization in LinkedIn. As shown in the figure below, it mainly includes:

1) Network optimization

2) Data simplification

3) Layout optimization

2) Data optimization uses Frontend Deco, a data simplification tool, to delete useless fields and simplify data models;

In the end, the author gives a summary, with a picture attached.

conclusion

GMTC has developed from a mobile terminal in the first session of 2016 to a big front-end in the third session of 2016, and its popularity is getting higher and higher. The number of topics has also expanded to the current 14. Personally, THERE are 3 general directions:

  • The first is the deep root finish on the end, such as performance optimization and monitoring;
  • The second is end-to-end crossover, such as the combination of on-end AI and audio and video;
  • The third is the big front end of the river's lakeFrom RN launched by FaceBook to Flutter released by Google in foreign countries, from micro program of wechat to quick application jointly launched by nine major manufacturers in China, manufacturers at home and abroad are flourishing on the road of unification of big front-end, which fully shows that there will be a trend of unification of front-end, Android and iOS in the future.

The above content only represents my personal opinion, welcome to discuss and correct any questions.

Welcome to follow my wechat public number, receive first-hand technical dry goods