View android source code in eclipse

Source: Internet
Author: User

Recently I used eclipse to develop an android program and found that the following error was reported when I checked the android sdk source code:

Source not found

The JAR of this class file belongs to container 'android 2.0 'which does not allow modification to source attachments on its entries


The general SDK does not contain the source code, so you need to download it online.

repo init -u git://android.git.kernel.org/platform/manifest.git
repo sync

(Www.android.git.kernel.org is the android source code website)


I was sorted out from the Internet ready-made download, the version is android 2.0, this is: http://download.csdn.net/source/1873037


1. Create a new folder named sources under the folder of the corresponding version number (this name must be used)

For example: android-sdk-linux_x86/platforms/android-2.0/sources

2. Place the downloaded source file in the sources folder.

3. Restart eclipse


In this way, you can view the source code.

Article about solving: http://android.opensourceror.org/2010/01/18/android-source/

Http://blog.michael-forster.de/2008/12/view-android-source-code-in-eclipse.html

Http://stuffthathappens.com/blog/2008/11/01/browsing-android-source-in-eclipse/


PS: start my project is built on Android-2.2, in order to add the source code, self blind in android-sdk-linux_x86/platforms/Android-8/, the results lead to engineering errors, the error is as follows:


Android. Hello. helloactivity does not extend Android. App. Activity androidmanifest. xml/Hello Line 8


I don't know why, and now I don't want to take the time to check it, so I changed the project to 2.0.

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.