I have never paid much attention to this problem before, but I don't know much about the source code. Now I find that the source code is indeed a good learning resource.
Go straight to the question:
1. Obtain android source code resources.
This refers to the java source file, generally about 10 MB, not the kind of several G andorid sdk source code on the Internet.
There are two ways: 1) Search for the source code resources of the api version you need from google or Baidu, which is generally in zip or jar format.
2) When upgrading the sdk version through eclipse, there will be an option to download resources.
650) this. width = 650; "src =" http://www.bkjia.com/uploads/allimg/131229/12054a563-0.jpg "title =" 1.jpg" alt = "212942309.jpg"/>
The last one. When this option is selected, the java source code will be downloaded to the sdk directory.
2. You can add the source code to eclipse for association. You can create an android project, find an existing android project, right-click the project, select the properties option, find the java Built Path option, and click the liberaries option on the right, expand the corresponding android. jar package, the following is a Source attchment option, such:
650) this. width = 650; "src =" http://www.bkjia.com/uploads/allimg/131229/12054924L-1.jpg "title =" 2.jpg" alt = "2017632690.jpg"/> then, click the edit option on the right:
A menu for adding resources will pop up, such:
650) this. width = 650; "src =" http://www.bkjia.com/uploads/allimg/131229/120549C58-2.jpg "title =" 3.jpg" alt = "2017905886.jpg"/>
The first option is to select resources from the working path, and the second option is to add a file compressed package, which is generally jar or zip, which is not recognized by the rar format ). Select the zip package of your corresponding version and click OK to import the package.
650) this. width = 650; "src =" http://www.bkjia.com/uploads/allimg/131229/1205492X6-3.jpg "title =" 4.jpg" alt = "214214761.jpg"/>
The third option is to directly add the decompressed folder. You can find your andorid source code downloaded through eclipse in the sdk directory, such as the folder format, select a corresponding one, click OK, and import it slowly. However, there is a problem here, that is, after the third method is imported, restart the external OSE and select a class base class without entering the source code, that is, if there is no association, I don't know why, please let me know ).... Therefore, I chose to use the second method to add the compressed package and import it. You can view the source code.
For the source code of multiple android versions, you only need to resend and import the source code of different versions once. Then, you will see different api source codes in different versions.
650) this. width = 650; "src =" http://www.bkjia.com/uploads/allimg/131229/1205493R0-4.jpg "title =" 5.jpg" alt = "214842924.jpg"/>
Source code is a good resource and we hope you can make good use of it.
This article is from the "Wind Sea" blog, please be sure to keep this source http://fengbohaishang.blog.51cto.com/5106297/1339556