View the android source code in eclipse

Source: Internet
Author: User

 

This article describes a simple way to view the android source code in eclipse (record it as a memo ). I have seen several methods that are a little tedious, such as: git to the android source code and then use Python scripts to extract andriod. jar source code, or download a package pre-extracted by others (there are issues such as whether the link is still valid, sometimes it is not easy to download, and the latest version is not timely ). This article introduces a more direct and unrestricted method, as shown below:

 

1. Download the android source code package directly through URL instead of git. The path is as follows:

Http://git.source.android.com /? P = platform/frameworks/base. Git; A = snapshot; H = head; Sf = tgz

Download the file base-head.tar.gz (106 MB at present ). Decompress it to a directory, for example (on my machine ):

D:/droid/base-head

The Source Path corresponding to andriod. jar is (on my machine ):

D:/droid/base-head/base/CORE/Java

 

2. configuration items

Because the automatically configured Android library usually cannot add source code paths, we need to use our own definition. Open the project properties and create a new user library on the Java build path> libraries interface. For example, name myandroid1.6 and ask the user library to reference your desired Android version (1.6 here. JAR file, and then add the following source code path to the library. Return confirmation.

 

After you see that the user library you Just configured is no different from the automatically configured Android library except the name and the newly added source code path, you can remove the reference to the automatically configured Android library.

 

3. End

Check the source code. Everything is fine!

 

[Update 20120125] for Android 4x, it is easier to obtain the source code: you can download the source code in SDK manager.

 

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.