How to read the Android system source code-Collection Essentials

Source: Internet
Author: User

For anyone interested in Android development, learning about Android is essential. The best way to learn the system is as Linus said: "RTFSC" (Read the fucking Source Code).
Here are some good answers from the readers.

The shoulders of Giants
    • AOSP Project official: https://source.android.com/source/index.html
      This must be read first . Project Introduction, code download, environment building, brush machine method, eclipse configuration are here. This is the foundation of everything.

    • Android Official manual: Https://developer.android.com/training/index.html
      This is actually for app developers to see. But there are also a lot of introduction to the system mechanism, it is worth reading.

    • Lao Luo's Android tour: Http://blog.csdn.net/luoshengyang
      This old Luo is not old Luo. Luo Shenyang Teacher's blog is very nutritious, basic can guide you to start reading the AOSP source of the tutorial . You can follow the blog's chronological order to see what you need. But this series of blogs has some questions:
      The early blogs were based on older versions of Android;
      A lot of code flow tracking. When reading an article, you must be aware of what you are looking at in the entire system.

    • Innost's Column: Http://blog.csdn.net/innost
      Dengfanping teacher is also for Android Daniel, blog is also very nutritious. But it's not as systematic as the Luo Shenyang teacher. More is the deep discussion of some technical points.

    • Android issues:http://code.google.com/p/android/issues/list
      Android official issue list. I found some strange bugs in the development process, and I finally found that there are basically records here. Of course you can mention some new ones, and it's another thing to have someone change.

    • Google:https://www.google.com
      Be sure to use this tool smoothly. A lot of relevant knowledge is no human system summary, you need to fix it yourself.

Reading methods

Suppose I want to study Android UI系统 , first of all to find what and the UI is related to it!
ViewThe great God jumped out, looked down at it, found it in the map in a variety of shapes, but where it is drawn, Ma Liang also want paper?
The students who develop Android can't escape Activity ! It has a setcontentview() way of looking at this name as if it were a place to combine view with activity. Quickly look at its implementation and be called, and then we'll find out Window , ViewRoot and WindowManager the figure, along with the WM and WMS we'll be pleasantly surprised to find out Surface , as well as draw the function of it incredibly on a DeCorView painting thing ha. With the help Source Insight of this, the Java horizontal static diagram of the UI layer is out.
To do this 静态UML , I think I can start tracking on the feature implementation, which is mostly C + + code (which is why I'm strongly discouraged to give up eclipse), and I went along the draw function to see the relationships at all levels, SurfaceSession control and transaction processing, SharedBuffer read and write control , the SurfaceFlinger Master of all, OpenGL ES the god Pen Ma Liang. FrameBufferand FrameBufferDevice the image output, LCD device opened, began to receive the FBD sent over a frame image, magic Bar.
All right, that's it, I can't help it on the bottom!

Software

When I decided to read the source code, to have a good reader, download the source code, etc.

    • Windows Reader: Source Insight

      With the help of this tool, you can navigate a huge number of Android source code, you can easily navigate between java,c++,c, you can quickly find the inheritance and call relationship you need.

    • MAC OS Reader: understand,

      Reference: OS X really misses the Source Insight

    • SOURCE Download:
      If you have a ladder:
      Official Downloads
      git path
      If not:
      GitHub path (you can download zip directly or use git clone)

      Readers are welcome to provide a high-quality download path (mirroring, etc.) to share

Related knowledge
    • Java
      Java is one of the main languages of AOSP. Have no say, must master skillfully.
      Proficiency in Android app development
    • Linux
      Android Linux-based and the recommended compilation environment for AOSP is Ubuntu 12.04. Therefore, it is necessary to use and understand the Linux system skillfully. If you want to understand the underlying code, it is necessary to understand the basic Linux environment of the program development. If you go deeper into the drive layer, then the knowledge of kernel is also necessary.
    • Design Patterns
      To learn, the code in the Android system is flashing the design pattern in many places, which is the only way you can become a Daniel. Of course, you just need to understand, in the reading slowly feel the line.
    • Make
      AOSP is compiled using the make system. Knowing the basics of makefile writing will give you a clearer idea of how AOSP's huge project is built.
    • Git
      Aosp use Git+repo for source control. This should be a must-have skill for programmers.
    • C++
      Some of the performance-sensitive modules and third-party libraries of the Android system are implemented in C + +, such as the input system, the Chromium project (WebView's bottom-up implementation).
Thank you for knowing and knowing ER

How do Daniel read the Android system source code?

Eggs

Finally, a lot of good resources come from abroad, if Android learners can not even open the website, it is a bit ...
About VPN to gently spit a groove :

Rather like I used to spend a lot of time to search for a variety of unstable free VPN, but also really better to spend a more than 10 dollars to save one months heart to the reality. Learning technology has to pay tuition fees, but the purchase of high-quality VPN this personal feel is a very high cost-effective and very witty approach.

About the author

Please pay attention to my GitHub https://github.com/wingjay, and read my related articles
"How to complete a cool property of Android products < simple poems >" In one day



Wen/iam_wingjay (author of Jane's book)
Original link: http://www.jianshu.com/p/b3580904d298
Copyright belongs to the author, please contact the author to obtain authorization, and Mark "book author".

How to read the Android system source code-Collection Essentials

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.