1. First download the GIT tool.
Git: http://code.google.com/p/msysgit/downloads/list under Windows
The top one.
The installation process is similar to that of common Windows software.
The GIT icon added on the desktop is used to start and use the shell command tool. The operation commands are the same as those in Linux.
2. Open the GIT window and create a folder where to store the downloaded SDK source code.
Then enter the folder and enter the GIT clone https://android.git.kernel.org/platform/frameworks/base
I started to download the SDK source code. The network speed is not good. I spent more than 900 MB in total. I spent one afternoon and one night.
Enter the base Directory of the folder after the installation ,:
Run the following command:
git tag
You can see the sdks of each version, select the SDK to download, such as 4.0.3, and enter the command
git checkout android-4.0.3_r1
The download will be completed soon. After the download, copy the Java folder in the core in the base directory to the Sources folder of the corresponding platform folder in your SDK directory, for example:
C: \ Android-SDK \ platforms \ Android-15 \ sources (if there is no sources, create a new one)
Then, we need to bind the source code to the eclipse environment to make it easier to view the source code while developing:
You can open an android project code file you wrote, move your mouse over an android class, such as activity, and eclipse will automatically pop up a small window, there is a menu-style open deconfigurtion on the bottom border of the window. After clicking it, you will be prompted that sources is not found. Click the attach Source button, select the Java folder in the previous step to store the directory, and click OK.
In this way, you can view the source code when you view the activity again!
Note: Do not forget to run the "exit" command in the command line to exit the window.