Original URL: http://fengbohaishang.blog.51cto.com/5106297/1339556
Did not pay much attention to this problem before, do not look at the source code, now found that the source code is really a good learning resources.
Straight into the chase:
First, access to Android source resources.
This refers to the Java source files, generally about more than 10 trillion, is not the kind of online a few G Andorid SDK source code.
There are two ways: 1), from Google or Baidu search for the API version you need source resources, usually zip or jar format.
2), when upgrading the SDK version through Eclipse, there is an option to download the resources.
The last item, when checked, will download the Java source code to the SDK directory.
Second, access to the source code can be added to eclipse in the association. You can create a new Android project, or find an existing Android project, then right-click on the project, select the Properties option, then, find the Java Built path option, click on the Liberaries option on the right, Expand the corresponding Android. jar package with a source attchment option below, such as:
Then, click on the Edit option on the right:
A menu will pop up to add a resource:
The first option is to add a resource from the work path, and the second option is to add the file compression package, which is usually not recognized in the jar or Zip,rar format (this should be noted). You select your corresponding version of the ZIP compression package, click OK to slowly import into.
The third option is to add the extracted folders directly. You can find from the SDK directory of your Andorid source you downloaded through eclipse, such as the folder form, select a corresponding, click OK, slowly import can. However, this place has a problem, that is, through the third way to import, restart Eclipose, casually choose a class base class, and did not enter the source, that is, no association, I do not know what the reason (have to know the trouble to inform) .... So, I still choose to use the second method, add the form of compressed package, import into. You can view the source code.
About Android Multiple versions of the source code, you just have to re-send the different versions of the line once, and then you will see different versions of the API source code.
Source code is a very good resource, I hope you can make good use of.
"Go" How to view Android source code in eclipse