How to view Android source code under Eclipse

Source: Internet
Author: User

1. View the Android source code:

(1) First to download the installation source code, online there are many places can be under, Baidu "Android source code download on line", here to pay attention to the version, such as I use here is the version of 4.0.3, corresponding to the android-15. is the installation version used in the project if it is 4.0.3, you should download the android-15 source code.

(2) Create a new sources folder under the SDK (some words do not have to be created), and then download the android-15 source is stacked under the sources file. For example, this is where my files are placed:

  

(3) Right-click the project, select Buildpath-->configure build Path-->java build path-->libraries-->android 4.0.3 expand Android.jar-double-click Source Attachment, select your own built source folder in path under External location (note that the source folder is not android-15). then click OK.

2. View the source of the jar package under the Libs file, take Android-support-v4.jar as an example:

Build a android-support-v4.jar.properties file under the Libs file, with the contents written in: src = f:\\android\\adt-bundle-windows-x86-20130917\\sdk\\ EXTRAS\\ANDROID\\SUPPORT\\V4\\SRC, (note is double slash, here the specific path to its own path, such as from your SDK folder to start looking), and then turn off the project to open again.

But sometimes this method does not solve the problem, I like to see a asmack.jar, in this way can not. There are two ways to do this:

(1) This was found on the stack Overflow: basically the need to being in by right android-support-v4.jar Referenced Libraries click,. Build Path Add to Path Then Referenced Libraries -In, right-click on and properties android-support-v4 set the sources.,you also need to make sure that the "Android Private Librar IES "is ranked lower in the" Order and Export "tab of your project's" Java Build Path "preferences.

(2) I use the above method or can not view Asmack.jar, this is my other kind of more stupid way: To download the Asmack.jar source code, and then put into the SRC directory of my project, and learn from this sentence: You also need to made sure that The "Android Private Libraries" is ranked lower in the "Order and Export" tab of your project ' s "Java Build Path" Preferen CES. You can jump to the source of Asmack.jar when you choose to use the method in Asmack.jar in my project.

If you have a better way, please share it.

How to view Android source code under Eclipse

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.