How to attach Android Source to Eclipse

后端 未结 6 1060
陌清茗
陌清茗 2020-11-28 06:07

I\'ve previously had success attaching the Android Source to Eclipse by following Finn Johnsen\'s instructions here.

However this approach seems to have stopped work

相关标签:
6条回答
  • 2020-11-28 06:09

    There is a updated guide. So, you don't need to install an eclipse plugin for this.

    Here is the link

    Snip from above Link:

    follow below steps if you already have downloaded Android sources

    1. Head into eclipse, and press F3 over some android source you're missing, like Activity. And get this pesky window, which we all hate:

    2. Click Attach Source, choose External Folder, and choose the core/java in the base folder.

    0 讨论(0)
  • 2020-11-28 06:10

    You can do it this way .... hover or copy paste any class_name which is provided from android , just press F3 you will find a Attach_a_source tag there , click in it & here browse your android-sdk folder and from it just pick source folder because inside it , every android files resides .

    0 讨论(0)
  • 2020-11-28 06:16

    Here's a tutorial:

    1. Make sure you have installed/downloaded the Android source for the appropriate Android SDK API version.

      1.1 Check the API version you have specified in Eclipse for Android/Project Build target:

      project Properties/Android

    2. Open project Properties/Java Build Path and click the "Link Source..." button on the Source tab:

      project Properties/Java Build Path

    3. Point to where you have installed the Android SDK, expand the "sources" folder, select the appropriate source API version (and click "OK"):

      select source API version

    4. Next...:

      Link Source

    5. Important step is to exclude the whole linked source from building. Otherwise we could have some duplicate source errors plus who wants to build the whole Android source when we have jars already! So, click "Add...", type in *, click "OK" (and then "Finish"):

      exclude everything

    6. Verify everything is configured correctly:

      configured

    Desired result -- linked platform source w/o side effects:

    source

    I hope this helped :)

    0 讨论(0)
  • 2020-11-28 06:30

    There is an Eclipse plugin called Android Sources that installs the sources up through Gingerbread. I haven't tried it recently.

    0 讨论(0)
  • 2020-11-28 06:31

    For Android 4+ here's a tutorial for attaching sources to eclipse.

    EDIT:

    1. First download the source and javadoc from sdk manager.Download these.
    2. Goto Your_Project>>Android XXX, Right-Click on android.jar and select Properties.

    3. Point the sources path as Java Source Attachment>>Location Path by clicking on External Folderenter image description here

    4. Point the reference path as Javadoc Location>>Javadoc Location Path by clicking on Browseenter image description here

    Now you can browse sources like this: enter image description here

    0 讨论(0)
  • 2020-11-28 06:34

    The best way is as below.

    1. Update Android SDK Manager, including source of the version you need.

    2. click on Any class like activity, if source is properly attached, it will open the Activity class.

    3. If it is not opening up, then click on the attach source and can give source path as above.

    4. Source path will be like android-sdk-windows\sources\android-17

    This will help you to add source for android SDK

    0 讨论(0)
提交回复
热议问题