Add Java and Android SDK source code for Eclipse

Source: Internet
Author: User

The most wonderful thing about Android development is that you can see the source code of its architecture, and the perspective of its architecture allows us to choose a more suitable solution.

(attention to distinguish between the operating system source code and SDK source code--!)

If Eclipse does not import the source code, we will see the following prompt when we CTRL + click:

How frustrating it is to not see the source code.

How do I add Java source code and Android SDK source code to eclipse?

1.Ctrl + Click A JDK class definition, such as String

2. Source not found is usually prompted. In the current window, click Attached source.

3. Fill in the path of the src.zip in the JDK

4.OK, you can see the definition of string

How do I add the Android SDK source code to eclipse?

Similarly, Ctrl + Click A class definition (such as ViewGroup) in an Android SDK, with source not found, which is not attached source, but change attached source, But if we change the path, we can see the Viewgroup.java, but there is no way to see String.java.

So, the steps should be:

1. First make sure that the source code for the JDK has been added to eclipse (not necessary, just so that you can see the JDK and see the android SDK)

2. Download the Android SDK source code (you can go to git, which is provided at the end of this article)

3. To the Android SDK directory android-xx create Sources folder, put the source code in it (if the compressed package in the text, need to extract, put the content into the sources)

Ex:d:\dev_space\android_space\adt-bundle-windows-x86_64-20131030\adt-bundle-windows-x86_64-20131030\sdk\ Platforms\android-19

4. Locate the Android.jar in the project. Right-click Properties, Java source Attachment, External Folder, select the new sources file price path you just created

5.OK

You can now view the source code for the JDK and Android SDK via CTRL +click

Android SDK Source code compression package download

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.