Spring for Android programmers! 9 Android interview experience summary, interview suggestions

Preface

Since graduating in 18 years, I have worked in two companies and have done a few large and small projects. I am very grateful to my two bosses for giving me a lot of guidance on my android growth path and the relationship between teachers and friends.

I have participated in interviews with many companies since years ago, and have also received offers from several giants and other companies. Summarizing the experience is also a review and summary of the past.

Project actual combat

  • Start speed
  • Fluency
  • The practice of Douyin in APK package size resource optimization
  • Full analysis of Youku's responsive layout technology
  • Network Optimization
  • Revealing the Secret of the Performance Optimization Project on Taobao Double Eleven
  • Analysis of source code dependence of AutoNavi APP full link
  • Sharing of actual combat experience of completely eliminating OOM
  • WeChat Android terminal memory optimization practice

theory

In terms of Android application optimization, we mainly optimize from the following 6 aspects:

  • Optimization of startup speed and execution efficiency
  • Layout detection and optimization
  • Memory optimization
  • Power consumption optimization
  • Network transmission and data storage optimization
  • APK size optimization

1. Start-up speed and execution efficiency optimization

  • Cold start and hot start analysis
    This section mainly introduces the startup method, characteristics, application startup process, measuring application startup time, what is the startup time of the application, reducing the time-consuming application startup, and optimizing the experience of the application startup.

  • APP start black and white screen solution
    Solution 1, change the background of the white screen to a picture; Solution 2, make the background of the white screen transparent.

  • The
    16ms principle of APP jam problem analysis and solutions ;
    jam processing;
    Triple Buffer, since frame loss is inevitable, the Android team has never given up on the optimization of this area, so Triple Buffer (three buffer mechanism) appeared.


  • StrictMode Detailed StrictMode, Systrace and TraceView for optimization of startup speed and execution efficiency .

2. Layout detection and optimization

  • Layout level optimization
    Every component and layout of the program needs to be initialized, laid out and drawn. If the layout nesting level is too deep, it will cause the loading operation to be more time-consuming, and even more serious, it may cause memory overflow. This section learns to use two tools to check and optimize Layout.

  • Over-rendering
    Since the number of over-rendering can be known through the system settings, the value is read during the test, and the report is completed. Why automate? Because when testing the app systematically, you will find that there are many pages. For example, there are more than 20 pages for the first and second levels of the housekeeper, and the integration package, gray package, formal package, and regression package must be tested once, so it is automated Over-rendering count reading is necessary.

Three, memory optimization

Due to the sandbox mechanism of Android applications, the size of the memory allocated by each application is limited. If the memory is too low, the LMK (Low Memory Killer) mechanism will be triggered, which will cause a crash. If you want to optimize memory, you need to understand how java memory is allocated and recycled. In this regard, you can focus on the following:

Mainly contains

  • Memory jitter and memory leak
  • Large memory users, Bitmap memory optimization
  • Profile memory monitoring tool
  • Mat large object and leak detection

Fourth, power consumption optimization

If an app is rarely used, but the power consumption of the app is high, then the user will definitely want to uninstall the app directly. So how to reduce the power consumption of your app is a very important thing.

What are the power consumption factors?

(1) Alarm Manager wakeup wakes up too much
(2) Frequent use of local wake locks
(3) Background network usage is too high
(4) Background WiFi scans are too much

Details include

  • Doze&Standby
  • Battery Historian
  • JobScheduler、WorkManager

Five, network transmission and data storage optimization

  • google serialization tool protobuf
  • 7z ultimate compression

Six, APK size optimization

Let our apk file be as small as possible, remove those unused code and resource files, save downloads and improve efficiency.

  • APK slimming
  • WeChat resource confusion principle

At last

I hope that everyone will have a good attitude. You have to think clearly about what kind of company you want to enter. It is not necessarily a large company, and I am not a mega company. Of course, if you don’t know the choice or plan, choose a big company! I hope that we can choose the company we want to go to before investing or recommending it, instead of having a company that wants me to go! Also, don’t be afraid, don’t be pressured, just treat it with your heart, but be prepared. Finally, I hope everyone can get a satisfactory offer! If you currently have a job, please cherish it and work hard. Finding a job is actually quite tiring and hard.

Attached here are dozens of sets of ByteDance related to the above-mentioned interview questions, interview questions from JD.com, Xiaomi, Tencent, Toutiao, Ali, Meituan and other companies in 19 years. The technical points are organized into videos and PDFs (in fact, a lot of effort was spent than expected), including knowledge + many details.

Due to limited space, I will show you a small part in the form of pictures. You can click GitHub to get it for free

A6%82%E4%BD%95%E9%9D%A2%E8%AF%95%E6%8B%BF%E9%AB%98%E8%96%AA%EF%BC%81.md)

[External link image is being transferred...(img-FGsLUpfp-1610953936055)]

Guess you like

Origin blog.csdn.net/fjfdhduuffududu/article/details/112783050