Android development foundation is not strong? Source code analysis of network picture loading and caching in Flutter, detailed technical introduction

Preface

The great man once said:

The book is the ladder of human progress. There is a
golden house in the book, and Yan Ruyu in the
book. Reading breaks through ten thousand
books. If there is a god in the writing, the book is the only immortal thing.
Books are the legacy of a great genius to mankind.

Recently, many friends have asked similar questions on my official account, such as "Classic introductory textbooks and learning routes for Android development?", "What are the recommendations for Android development introductory tutorials?" and other similar questions. We keep answering these questions repeatedly, which made me inspire To do the  2020ndroid development hot book recommendation: from Xiaobai-Android Senior Engineer series of learning route book introduction ideas , organize and collect the learning experience of the development of big cows, so that we can avoid detours and grow faster. Hope this article can be a good answer for everyone to deal with novices.

Here I provide you with a diagram of the advanced knowledge system of Android senior architects, and get it yourself!

Next, I will follow this route to introduce to you. Some of my friends and I have read books that are not bad.

This is a question that impressed me. Obviously it was my first time. At that time, I went to a company (call it T company for now) to interview for a job opportunity at Samsung in South Korea. The interviewer of T company was an architect named Bely. Obviously, Android development was a scarce resource at that time. Knowing the Service would be terrible. Of course, Bely didn’t intend to embarrass me. ), I answered easily:

Service is an Android component that specializes in processing long-term tasks in the background. It has no UI. It has two startup methods, startService and bindService.

You guessed it right, Bely then asked me: the difference between these two startup methods.

StartService only starts the Service, and the component that starts it (such as Activity) is not associated with the Service. The service will only be terminated when the Service calls stopSelf or other components call stopService.
The bindService method starts the Service, and other components can obtain the proxy object of the Service and interact with the Service through callbacks, and the two parties are also bound. When the initiator is destroyed, the Service will automatically perform the unBind operation. When all bindings are found Service will only be destroyed when unBind is activated.

This should be a key difference. I just used Serivce to make a music player before the interview. A few years later, I interviewed many people in Shenzhen, 60-70% of them had no experience in using Service, which made me feel that the city of Shenzhen is rather impetuous for Android development. Because there are too many job opportunities here, junior developers are more eager for quick success and quick gains, and they don’t need to work too much on themselves to find jobs (of course this is a one-sided understanding).

Of course, there are other differences, such as the impact of the two types of calls on Service life cycle functions. The interviewer can also expand on this issue.

When I meet an interviewer who knows how to use Service, and I can easily answer the difference between startService and bindService as many years ago, I usually ask one more thing:

Can Service's onCreate callback function be time-consuming?

Many people will say: Yes.

The truth is revealed, his previous answer was just a preview of the interview questions before the interview. If you know that Service's onCreate is called in the main thread (ActivityThread), time-consuming operations will block the UI, I usually ask again:

If you need to do a time-consuming operation, what would you do?

The question unfolds in this way. Whether a person really understands the principle and can apply it flexibly can be seen at once. When the interviewer answers to the thread and Handler method, I will ask the other party again:

Do you know IntentService and in what scenarios to use IntentService?

This is also what the interviewer should look at. A real project requires a developer to have a certain depth of a certain problem, and it also needs a certain breadth of knowledge of the entire Android. Depth means that the person has the spirit of studying the problem seriously, and breadth means that when the person faces the same problem, it will be easier to choose the most suitable one from a variety of feasible solutions.

The actual project of Service has been ignored by many people. Why I have repeatedly emphasized that Service is very important. Let's take a look at what problems we will encounter in our work if we are completely ignorant of Service.

Scenario: If an application wants to download MP3 files from the Internet and display a progress bar on the activity, the activity requires that the screen can be rotated. Then Actvitiy will restart when the screen is switched. How to ensure that the download progress bar can correctly display the progress?

Those who do not have the concept of Service generally come up with the following solutions:

  1. Cache the progress before changing the screen and read it out after changing the screen.
  2. Use the android:configChanges setting so that the Activity will not be destroyed and rebuilt when the screen is switched.

For the first plan, I will continue to ask him where the progress value is stored? In the process of changing the screen, we know that the rebuilding of Activity is relatively time-consuming, and it may take more than a few hundred milliseconds. Then the download thread is still working at this time, and the progress must be inconsistent with the progress during saving. How to deal with this problem? ?

For the second solution, you can start thinking for yourself. In actual projects, you may need to do some extra things to deal with the horizontal and vertical layout of the ContentView.

If you use Service to solve this problem, it seems to be perfect, but it will involve the interaction between Activity (UI) and Service, which we will discuss later.

At last

It is said that three years is a hurdle for programmers, whether they can be promoted or improve their core competitiveness, these few years are very critical.

With the rapid development of technology, from what aspects can we learn to reach the level of senior engineer and finally advance to Android architect/technical expert? I have summarized these 5 big pieces;

I have collected and sorted out the interview questions of Alibaba, Tencent, ByteDance, Huawei, Xiaomi and other companies in the past few years, and sorted out the requirements and technical points of the interview into a large and comprehensive "Android Architect" interview PDF (in fact, more than Expected to spend a lot of energy), including the knowledge context + branch details.

Java language and principles;
big factory, small factory. Android interview first see if you are familiar with the Java language

Advanced UI and custom view;
custom view, the basic skills of Android development.

Performance tuning;
data structure algorithms, design patterns. All of the key foundations and key points need to be skilled.

NDK development;
future direction, high salary is bound to be.

Cutting-edge technology;
componentization, hot upgrade, hot repair, frame design

There are a lot of materials for learning Android on the Internet, but if the knowledge learned is not structured, and when you encounter problems, you just taste it and stop studying it in depth, then it is difficult to achieve real technological improvement. I hope that this systematic technical system will provide you with a direction reference.

When I was building these technical frameworks, I also sorted out the advanced advanced tutorials of the system, which will be much better than my own fragmented learning effect, visible on GitHub; "Android Architecture Video + Study Notes"

Of course, it is not easy to learn and master these abilities in depth. Everyone knows how to learn and what work intensity is as a programmer, but no matter how busy the work is, I have to spare 2 hours a week to study.

Within half a year, you will be able to see the changes!

d)**

Of course, it is not easy to learn and master these abilities in depth. Everyone knows how to learn and what work intensity is as a programmer, but no matter how busy the work is, I have to spare 2 hours a week to study.

Within half a year, you will be able to see the changes!

Guess you like

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