Previously I managed to connect an Android source to Eclipse by following the instructions of Finn Johnsen here.
However, it seems that this approach no longer works:
samuel-joseph-computer-4:android-sources samueljoseph$ git checkout origin/froyo-release
The previous HEAD position was 1de4a2c… at 62619392 : Repair the leak when the key lock is repaired.
HEAD is now at adba66b…. This class no longer exists.
There was recently a blog here that had a pre-arranged source for eclair, but nothing has happened since then.
There are also some StackOverflow positions from 2008 (older than the previous two), such as
Who are the current leaders to achieve this?
How can I solve this problem?
There is an Eclipse plugin called Android Sources that installs the sources on Gingerbread. I haven’t tried lately.
There is an updated manual. So you don’t have to install the Eclipse plugin for that.
Here is the link
Scissor at the top of the link:
If you have already downloaded Android resources, follow these steps
Go to Eclipse and press F3 on an Android source that you miss as an activity. And take that heavy glass we all hate:
Click Source Attach, select External Folder and select the kernel/java in the root directory.
For Android 4+, here is a guide to connect sources to Eclipse.
- First download the source code and javadoc from the sdk manager.
- Right-click android.jar and select Properties.
- Specify the path to the source in the form of a Java source attachment>>Location Track by clicking on the external folder .
- Fly over the path of Javadoc Location>>Javadoc Location and click on Browse .
You can now display these sources:
Here’s a guide:
- Make sure you have installed/downloaded the Android source code for the correct version of the Android SDK API.
1.1 Check the API version specified in the Eclipse for Android/Project Built purpose:
- Open Properties/Java Build Path Project and click on the Source….. link on the Source tab :
- Indicate where you installed the Android SDK, expand the Sources folder, select the correct version of the source API (and click OK) :
- Go to
- An important step is to exclude the entire associated source from the design. Otherwise, we could have several duplicate sources, and who wants to build the Android source code if we already have banks! Click on Add…, type *, click OK (and then click Done):
- Make sure everything is set correctly:
The desired result is a platform-specific source of side effects:
I hope that helped.
Solution No 5:
The best way is the one below.
- Update the Android SDK manager, indicating the source of the version you need.
- Click on Any Class Activity. When the source is connected correctly, the activity class opens.
- If it does not open, click on the attached source and specify the source path as described above.
- The source path will be android-sdk-windowssourcesandroid-17.
To add android SDK source code
Solution No 6:
You can do it this way …. Mouse over an android-supplied class name or copy and paste it. Just press F3, and you will find the Attach_a_source tag, click it, and browse to your android-sdk
folder, and from there select the source folder, because that is where all the android files are located.