1,First, download androidSource code:
Android 2.0 source code: http://download.csdn.net/source/2931366
Android 2.1 source code: http://download.csdn.net/source/2931364
2,Then, create a new name named [Sources.The source code is used as an example, as shown in:
3,Open the directory where the android 2.1 SDK is located: C:/Android-SDK-Windows/platforms/Android-7 (the specific location depends on the actual situation of each person, here, Android 2.1 corresponds to the Android-7 folder, and so on), and then copies the above [sources] folder to it, as shown in:
4,Now it's okay, it's so simple ^_^.
Let's test it now:
Open eclipse, create an android project, and select Android 2.1 at build target, as shown in Figure :( Note: if you are using another version of Android, select it below, but the premise is that you have put the [sources] folder above into the SDK corresponding to this version)
After the project is created, select fangjian. myactivity in the test package. java] Open the file, press Ctrl, and click the left mouse button, as shown in, to open the source code of the activity class:
Shows the source code after opening:
In addition, you can also find the desired class from the [Android] package and double-click it, as shown in:
Finally, it should be noted that some classes may not be able to view their source code, mainly because the downloaded source code package does not contain it.