I'm still baffled that Google hasn't ensured this working from day #1 with this eclipse plugin. But enough crying :)
I should also mention there is an eclipse plugin made for this. I've never tried it. I don't like bloating eclipse with tons of plugins, unless I really have to. And this boils down to 8 pretty easy steps, so an eclipse plugin isn't something Id'e consider. (But I may change my mind later)
Download the sources from github, and attach them:
- Head over to
the android source at github.EDIT: new location
- Click the android SDK you're working on. (*1) I'll choose Android 2.2 SDK release 2
- Click the tiny link which says Tree
- Click the Snapshot link which just appeared by the Tree -link
You'll start downloading a file which is about 130mb. This is the android source file. It's filename starts with base, for me it's called base-08d9d9a.tar.gz
- move the base -file to the SDK platform directory, for me that's /opt/android-sdk-linux_x86/platforms/android-8
- unpack it (tar xvfz base-08d9d9a.tar.gz).
- head into eclipse, and press F3 over some android source you're missing, like Activity. And get this pesky window, which we all hate:
- Click Attach Source, choose External Folder, and choose the core/java in the base folder. For me that's /opt/android-sdk-linux_x86/platforms/android-8/base-08d9d9a/core/java
(*1) There are loads of versions there, and it's a bit confusing. I've concluded the stuff we're looking for should end with SDK. However I'm not 100% certain about what version to download to match the Android version we see in the Android SDK download tool - this is just me guessing.