How to obtain the android SDK source code and view it in eclipse

Source: Internet
Author: User

How to obtain the android SDK source code and view it in eclipse

The search results obtained by Google for "android eclipse source code" are not suitable, because Google's eclipse Android development plug-in has been updated to ADT 8.0.1. The corresponding lib Method for associating JAVA Source Code has also changed.

Follow these steps to obtain the Java source code of Android and associate it with Eclipse:
1. First download the android SDK Installation File: http://dl.google.com/android/android-sdk_r08-windows.zip
Decompress the package to: e: \ Java \ Android-SDK-Windows, run the SDK manager.exe in the directory, and download the API packages of different Android versions.

2. Download or install the Eclipse plug-in ADT online,
Installation Package address: http://dl.google.com/android/ADT-8.0.1.zip
Online installation address: https://dl-ssl.google.com/android/eclipse/
Source: ttp: // developer.android.com/sdk/eclipse-adt.html

2. After the ADT plug-in is installed, download the Java source code compressed package of Android 2.3 (gingerbread) that I have packaged:
: Http://lizongbo.googlecode.com/files/android_gingerbread_javasrc.zip
Source: http://code.google.com/p/lizongbo/downloads/list
Copy the downloaded file to E: \ Java \ Android \ javasrc.

3. After downloading the android Java source code compressed package, set the SDK configuration in Eclipse:
The operation procedure is as follows: Main Menu-> window-> preferences-> Android, SDK location is set to: e: \ Java \ Android-SDK-windows, click Apply in the lower-right corner.

4. Start to associate the source code of Android. Create an android project in eclipse, select the project, choose Project> Properties> Android, and select Android 2.3 in Project Build target.
Click "Java build path" on the left, switch to the libraries panel, expand the Lib android2.3, and click android. jar source attachment, and click Edit. in the dialog box, click "external file", select E:/Java/Android/javasrc/android_gingerbread_javasrc.zip, and click OK to confirm. In this way, the Java code of Android is associated.

5. in the same project, select the project, Main Menu-> Project-> properties-> Android, and android1.5, android1.6, android2.01, android2.1-update1, and android2.2 for the Project Build target, repeat the settings in Step 4 above.
In any android project, press Ctrl and click the Java class name to browse the corresponding Java source code.
The source code of each Android version is:
Android1.5 android_cupcake_javasrc.zip
Android1.6corresponds to android_donut_javasrc.zip
Android2.01and android2.1-update1correspond to android_eclair_policrc.zip
Android2.2corresponds to android_froyo_javasrc.zip
Android2.3corresponds to android_gingerbread_policrc.zip

6. Information after source code Association is configured in eclipse will be stored in:
E: \ lizongbo \ workspacenew \. Metadata \. plugins \ org. Eclipse. Core. Resources \. Root \. Indexes \ properties. Index
E: \ lizongbo \ workspacenew \. Metadata \. plugins \ org. Eclipse. jdt. Core \ variablesandcontainers. dat

From: http://618119.com/archives/2011/01/01/201.html

Related Article

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.