1. First, install git on your computer. For details, refer to the GIT official website.
2. Open the GIT command window and enter the GIT clone http://android.git.kernel.org/platform/frameworks/base Android (here is the name of your custom folder, we call it Android). I have tried git clone git: // clone? Therefore, we recommend that you use an HTTP address.
The following are:
3. Because the network speed is slow, the power failure in the dormitory has not been completed, and resumable data transfer is not allowed. Therefore, you cannot resume the next morning and finish the next morning. Run the following command:
4. This is all the source code packages. Select 4.0 for download:
Git checkout android-sdk-4.0.3_r1
Soon it will be finished, and then copy the Java folder in core in the base directory to the Sources folder of the corresponding platform folder in your SDK directory, such:
Android-SDK-Windows \ platforms \ Android-14 \ sources (if there is no sources, create a new one)
5. To view the source code while developing, we need to bind the source code to the eclipse environment:
You can open an android project you wroteCodeFile, move the mouse over an android class such as activity, then eclipse will automatically pop up a small window, there is a menu-style open deconfigurtion on the bottom of the window, after clicking, it will prompt that no sources is found, click attach source, select the Java folder in the previous step, and click OK.
In this way, you can view the activity again.Source codeNow!