How to download the android source code

Source: Internet
Author: User

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.

1 chmod a+x ~/repo

Step 7: create a directory mydroid and enter the DirectoryThe picture is still the one above. Take a closer look.

View Source

Print?

1 mkdir
mydroid
2 cd
mydroid
 

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

1 ~/repo sync

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.

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.