To a certain extent, android must read more code and think more. Android source code is a very good learning material. The content of this article is very simple, that is, download the android source code first. We know that the source code of Android is managed using the distributed version control tool git, Which is troublesome to download. Here we will use the illustration to step by step, and you will surely learn.
Step 1. Install VmwareI suppose you are in windows, and the android source code will be downloaded in Linux. Then we will install a virtual machine to create a Linux environment. Unfamiliar users go to Google "vmware workstation 7.1 installation"
Step 2: Install ubuntu10.04If you are not familiar with this step, search for "Install ubuntu10.04 in VMware" and remind you that it is best to install it on the GUI. The installation process is slow and you have to wait patiently, I waited for nearly 20 minutes at 95% ^_^.
Step 3: Go to Linux and open the terminalOh, I 'd better configure a picture, egg, and I know what you will do.
Step 4: Install git and curlRun the following command in the terminal window:
1 |
sudo apt-get install git-core curl |
For example, in the first line, press Enter next to complete installation.
Step 5: Install the repo script
1 |
curl http: //android.git.kernel.org/repo >~/repo |
Step 6: grant repo executable permissionsThe picture is still the one above. Take a closer look.
Step 7: create a directory mydroid and enter the DirectoryThe picture is still the one above. Take a closer look.
Step 8: repo InitializationThe picture is still the one above. Take a closer look.
1 |
~/repo init -u git: //android.git.kernel.org/platform/manifest.git |
Enter the name and email address, and select the test color. Finally, you will receive a message similar to "Repo initialized in/home/nebulayao/mydroid", indicating that the initialization is successful. The diagram is as follows:
Step 9: repo Synchronization
Okay, because there are about 2 GB of data to be downloaded, so you can wait for a meal and make a few rounds of Dota ......
Finally, you can see the following syncing work tree: 100%. Done indicates that the download is complete.
Step 10: acceptance results:What is the purpose of downloading the source code? Let's go to the mydroid/packages/apps/phone directory and check it out. Oh, isn't that the source code of the program called in the Android system! Treasure everywhere ^_^
Take your time and enjoy it.