I learned some tricks of Android

I learned some tricks of Android

Today I will share with you some of my methods and ideas for learning Android. The sharing is not limited to how to learn a certain part of Android. It is a general and universal learning routine and method. I hope it can help you solve some problems.

Please note that the knowledge points in this article are relatively scattered. The latter part contains some questions raised by the audience, but it does not affect the overall reading and understanding.

[[207255]]

What programming foundations does Android need to lay?

  • Java Basics (Kotlin)
  • OOP thinking and design patterns
  • Android Basics
  • Data Structures and Algorithms
  • Others, such as JVM related

In addition to programming basics, what other abilities do we need to supplement?

  • Interest in research
  • Good English comprehension skills
  • Good at thinking and summarizing
  • Efficient learning method
  • Ability to use Google search wisely
  • Good use of tools
  • The ability to draw analogies with real things

Attitude towards problems

1. The interest in delving into details. Although the emergence of high-level programming languages ​​has allowed us to focus more on business rather than programming details, as the saying goes, knowing the reason behind a thing is to know the reason behind it. Delving into details can help us better realize our business and make it clear in our minds.

2. Good English comprehension ability. For some reasons, some of the technical information we come into contact with is second-hand information, and these second-hand information often have some discounts or even deviations in the effect of knowledge transfer. English can be said to be an accelerator for (Android) programming improvement. At the same time, good English can help us write more self-explanatory code.

3. Be good at thinking and summarizing . The more you debate, the clearer the truth becomes. Similarly, the more you think about technology, the clearer it becomes. For a technology, we usually need to have such questions

  • What is it in one sentence
  • What problem has been solved? What is the significance of existence?
  • How to solve the problem of internal implementation
  • What are its shortcomings? Multi-angle analysis

For example, our summary of considerations about WebView

  • Support js?
  • Support mixed content (https pages loading http images)
  • Problems with communicating with js, such as adding JavaScriptInterface annotations to methods
  • Whether to handle certain URLs (different protocols, not allowing flipboard://showSection, etc.) by itself or hand them over to external programs
  • Regarding whether to add specific logos to UA, such as the word Flipboard
  • Whether to add a specific header

Once we have our thoughts, we need to record them in writing. This is in line with the old saying that a good memory is not as good as a bad pen. It is recommended to summarize them in the form of a blog.

4. Efficient learning method.

  • It is important to clarify the concept
  • Control variable method
  • More hands-on practice combined with theory
  • Focus on the key points and eliminate distractions

In fact, any complex thing is composed of simple things, and programming is the same. In the process of programming, we will come into contact with many concepts, which are very important. A superficial understanding of the concepts will often make us go slower and slower, and it will become more and more difficult to learn. Therefore, it is important to understand the concepts in programming accurately and deeply.

Control variable method: When we were doing experiments in junior high school, we often used the control variable method. It is also used in programming. When we solve a problem, we must also control the modification. For example, if we need to fix a webview-related bug in our project, we should think about whether we can break away from the current large and complex project and write a simple sample with a single variable to reproduce it, so as to achieve fast and small-scale verification.

Combine more hands-on practice with theory: Often, when we learn new technology, we should first learn how to use it. After we have a preliminary understanding, it will be easier for us to understand and study it in depth. For example, regarding GUI, we have to make something from time to time. Theory and practice should complement each other.

Focus on the key points and eliminate distractions:

  • Any complex thing is a complex interweaving of simple problems.
  • Remove irrelevant or interfering factors
  • Supplement the knowledge necessary to understand the problem
  • Concrete analysis: look at its implementation principle and operation mechanism (for example, by analyzing the source code, we know that HandlerThread is nothing more than a thread that comes with and initializes the Handler)
  • Abstract summary: summarize from a moderately abstract perspective

5. Use Google wisely. When you are engaged in programming, using Google is a must. Although it is not accessible in China, it is not a problem for smart programmers. Usually, I convert the knowledge points I want to search into English, excluding Chinese. I will first check the content of stackoverflow and google groups. In comparison, the relevant resources in Chinese are not very reliable and the quality is generally worse.

6. Make good use of tools, use the terminal more often, and try to write some scripts to solve repetitive tasks. Python, Ruby, and Shell scripts can help you write many powerful tools.

  • For example, the full-text keyword search tool grep -E $1 --exclude-dir={.git,lib,.gradle,.idea,build,captures} --exclude={*.png,*.jpg,*.jar} . -R --color=always -n can find the files and line numbers containing a keyword under the Android project.
  • Quickly get the name of the current Activity adb shell dumpsys window windows | grep -E 'mCurrentFocus|mFocusedApp' --color=always
  • Quickly check whether the json file is legal

https://github.com/androidyue/DroidScripts

7. Ability to draw analogies with real things

As we spend more time programming, we will find that many concepts in the program are similar to things in real life.

  • For example, the database index and the dictionary index we use in real life. The advantage is that they facilitate quick search. The disadvantage is that too many indexes will increase the usage, and adding, deleting, and modifying the index will also slow down the modification.
  • For example, the object pool is similar to the public tableware in a real restaurant. When we need to recycle, we need to clean up the dirty data to avoid affecting the next use.
  • For example, the tableware recycling staff in KFC is similar to the JVM GC in terms of when to recycle the plates. An object can be recycled if it is not held by other objects. That is, if there is no one at a table, only the tableware can usually be recycled.

How to make associations and analogies

  • Understand the specific concepts in programming and grasp the key points and key behaviors of the problem
  • Choose analogies that are commonplace in real life, not those that are vague.
  • Extract common points and check whether they match.

8. Attitude towards problems The attitude towards problems must be positive. Don't just muddle through. For example, for problems that are difficult or impossible to reproduce, even if there is no machine that can reproduce it, you should try to reproduce it by simulating or using cloud devices.

For problems that only you know about, do not hide them and try to expose them. This will make it easier for you and others to discover and solve them.

As an Android programmer, how to grasp the breadth and depth of technology

For Android, there are too many temptations, such as React Native, applets, hot updates, and plug-ins.

My understanding is that we should expand in breadth first and then conduct in-depth research.

When do you need to expand horizontally?

  • beginner
  • The workload is varied, such as browser development (common App development technology, HTML+Javascript and other technologies)
  • Personal interests

When do you need to go deep?

  • Intermediate and Advanced Development
  • Seeking deeper details and ideas
  • Job requirements

What are the horizontal developments?

  • ReactNative and other technologies
  • Simple backend development Java/PHP/Python/Ruby
  • IOS and other application development
  • In short, there will be more

What is vertical development?

  • System source code
  • Implementation mechanisms of various technologies
  • Knowledge about operating systems, etc.
  • In a word, it means learning thoroughly, knowing the whys and the reasons behind them.

Personally, I prefer to spend more time doing in-depth research. In this process, I will gradually develop the ability to thoroughly understand the technology. With this ability, I will be able to apply what I have learned to other areas, and it will be easier to learn other technologies.

In addition, work needs are an important factor that affects the direction in which you develop. So be careful when choosing a company.

  • Usually large companies and excellent teams will help you to go deeper vertically
  • Small companies and startups will have more impact on your horizontal development.

How to get the most out of your daily work

In our daily work, we are working on the company's projects. If we want to maximize our profits, we need to do

  • Don’t limit your requirements to just functional implementation (for example, completing an interface does not mean that your revenue has reached maximization, it just means that the task is completed)
  • You need to understand the principles and essence of the technology you are using. Don't just stop at using the API, otherwise you won't be able to enhance your competitiveness. For example, we all use LRUCache to load Bitmap, so we need to at least understand the principles of LRUCache, and if possible, understand its internal implementation mechanism.
  • If there are good things in the project, think about what is good about it and think about the general scenarios of this technology.
  • Think of better solutions in the project. Compare the advantages and disadvantages of the two solutions. For example, if you have listened to the explanation of ArrayMap in "Android Performance Pattern" and also considered the space occupation of HashMap, don't rush to replace it. You should make a comparison (understand both HashMap and ArrayMap) and choose the most suitable one based on the business scenario.
  • If you encounter a problem in the project, it is recommended to solve it first, and then study the principles and details of this technology in your spare time. Subsequent research must be done.
  • Be good at summarizing and write your experiences and lessons into blogs to share with others.

Our daily work provides us with numerous good practices and bad problems, and is a precious source of technical improvement.

There are so many Android libraries. Which ones should I choose? How should I learn them? To what extent should I learn them?

Libraries exist to encapsulate details, simplify caller implementations, or help us find problems more easily. For example, ButterKnife uses annotations to simplify view search and type conversion.

How to choose those libraries

  • Determine if this library is required
  • Can this library improve development efficiency and reduce code maintenance costs?
  • What is the learning cost of this library? For example, the learning cost of rxjava is actually relatively high.
  • The quality of this library should not only be judged by the number of stars, but also by the handling of issues.

Flipboard commonly used libraries (partial)

  • LeakCanary A memory leak detection library for Android and Java.
  • Stetho Stetho is a debug bridge for Android applications, enabling the powerful Chrome Developer Tools and much more.
  • ButterKnife Bind Android views and callbacks to fields and methods.
  • Baber A custom view styling library
  • GoldenGate An Android annotation processor for generating type safe javascript bindings
  • MaterialEditText EditText in Material Design
  • . . .

Regarding the library, first we need to master its usage, and also understand its operating mechanism.

What advice do college students have for beginners?

  • More and more news about the Internet winter is coming out
  • I hear more and more people complaining that it is getting harder and harder to find jobs in the Android field and that it is approaching saturation.
  • The Android development boom is fading, especially for junior and mid-level developers
  • I have nothing against joining the Android development team now.
  • Containers, machine learning, and artificial intelligence are still likely to catch up.
  • But no matter which technology you choose, even if it is Android, please have a good foundation, strong programming skills and enough interest. Don't just pursue material things.

I always wanted to learn, but it was hard to stick to it.

  • It's good to have the intention.
  • If it is difficult to persist, the possible reason is that you have not learned it well, or your self-control is poor.
  • If you haven't learned it yet, you can refer to the learning methods mentioned above.
  • If it is self-control, it can be improved through self-monitoring and supervision by others.

I don't know where to learn Android. Can I learn and work at the same time?

  • There are many ways to learn Android, you can learn by yourself (video sites, books, blogs) or choose training (not recommended)
  • It is usually possible to study and work at the same time, but the specific implementation depends on one's own situation, such as whether there is sufficient time, the learner's determination and self-study ability.

Preparing for the Spring Recruitment, what to do if you don’t understand data structures and algorithms

Whether it is spring recruitment or autumn recruitment, the mastery of basic knowledge is a very important criterion. After all, graduates have relatively less practical experience.

Data structures and algorithms should be an essential part. It is recommended to do more preparation work.

Show your best self to interview for spring recruitment.

What kind of personal project do you have to be competitive?

If this project is an App

  • First, there must be enough users, such as tens of thousands of active users per month.
  • The interface and interaction are well handled and conform to Android UI/UE specifications
  • Runs smoothly and stably, without low-level errors (such as freezes and other issues)
  • App can obviously solve the user's pain points

If this project is an open source project

  • There are enough stars (but this has been broken)
  • Issue handling status
  • Number of contributors
  • Is the design idea excellent?
  • Is the code self-explanatory?
  • Minimize learning and maintenance costs

How do I choose the learning materials from the Internet?

  • Use Google and StackOverflow, Medium
  • If it is a blog post, try to choose English if you can understand it.
  • The easiest way to judge the quality of an article is to go to the bottom of the article and look at the comments (Good, Executive, Awesome) and the number of shares on Google+, Facebook, and Twitter.
  • Try to choose articles with neat content (which indicates a serious attitude)

Poor learning results

  • I have been watching MOOCs and forums for a long time, but the effect is very poor
  • I feel like I have made a lot of progress by learning from videos, but even after I finish learning, I still feel like a novice
  • I have watched the video and read the book, but I still find it difficult to write. What should I do next to become proficient and advanced?

The reasons for these results:

  • The skills that video websites usually teach everyone are often effective immediately.
  • Lack of thinking in learning, unable to apply knowledge to other cases.
  • The foundation is weak and the concepts are not clear. It is difficult to do the higher-level things.
  • There are no better auxiliary tools or it is impossible to find excellent auxiliary content.

How to improve the core competitiveness of Android programmers, project understanding ability or technical ability, which is more important?

  • What is core competitiveness? It is reflected in the ability to learn technology, the attitude towards problems, and the technical solutions to problems. This is also true for other industries.
  • I have mentioned above how to improve core competitiveness specifically, and refer to the other abilities that programmers need to possess.
  • These two abilities complement each other, and it is difficult to decide which is more important.

Troubles of older Android programmers

I often receive emails from Android programmers, many of whom are worried about their future career choices after working on Android for many years. For example, Huawei laid off employees over 34 years old during the Internet winter.

Indeed, since the demand for Android-related engineers is not as strong as before, and the older you are, the less motivated you may be than young people who have just graduated. This worry is understandable.

Some ways to get out of trouble

  • Keep learning, consolidate the foundation, and expand the technical side. Why do I always mention this? Because there are actually many programmers who don’t have strong logical thinking and don’t like to learn. Continuous learning is crucial for programmers.
  • Improve your competitiveness, don't just become a programmer who is good at API programming. Think hard and pursue higher goals. Those who seek the best will get the middle, and those who seek the middle will get the worst. You must be different from who you were 5 or even 10 years ago. You can't just repeat the same skill for 5 or 10 years.
  • Build a personal brand: write blogs, books, open source projects, write independent apps, etc. Note that any of these requires long-term persistence to complete.
  • In fact, many of the worries of modern people, whether they are programmers or not, are about the fear of material life. Buying a car, buying a house, family expenses, etc. And the fear and worry that their ability cannot meet the material expenses. If you cannot change it, adjust your mentality appropriately.
  • Try to monetize your knowledge, but it requires continuous accumulation and time. It can’t be done overnight.
  • Theory on comfort zone, learning zone and fear zone

theory

  • “Comfort zone” refers to knowledge that is not difficult to learn or things that you are accustomed to, and you can be in a comfortable psychological state.
  • The "learning zone" is somewhat challenging for me, so I feel uncomfortable, but not too uncomfortable.
  • "Panic zone" means when there are too many things or knowledge that are beyond one's ability, one will feel seriously uncomfortable psychologically, which may lead to a breakdown and even giving up learning.

For a person, the most ideal state is to be in the "learning zone" and learn something that is appropriately challenging. After a period of time, the "learning zone" will slowly turn into a "comfort zone". The "comfort zone" will become larger and larger, and a part of the "panic zone" will also become a "learning zone" accordingly.

<<:  Tech Neo Technology Salon No. 16 - Automated Operation and DevOps

>>:  Let’s talk about the process of the project from 0 to 1

Recommend

Brain development: the “infrastructure powerhouse” above our heads

Produced by: Science Popularization China Author:...

Can bidding hosting improve the quality of corporate marketing?

Can bidding hosting improve the quality of corpor...

Another national treasure! China's first space telescope - CSST is here

Not long ago, at around 22:30 on July 12, 2022, B...

New Energy Vehicle Channel Development in 2022-2023

On March 30, 2023, the 2022 Automobile Distributi...

Analysis of AARRR models of Starbucks, luckin coffee, Pinduoduo, etc.!

In the user operation system, there is a classic ...

NIO to release new ES6, targeting Tesla Model Y

Recently, some media revealed that NIO will relea...

Is Microsoft taking a risky move to use Android to save Windows?

Earlier, there was news that the consumer preview...

Analysis of Meituan and Pinduoduo’s e-commerce coupon competitors!

Jingxi’s coupon system was inherited from JD.com,...