This has been done before, but the way I set it up now is easier than other methods I've seen.
- Visit the Git site for browsing the Android framework source.
- Click the "tree" link next to the branch you want (e.g. Eclair, Donut, Cupcake, etc.)
- Click the "snapshot" link to download a tgz of the source for that branch.
- Create a
sources
directory in the associated platform directory of your Android SDK. For Eclair, it should be something like~/android-sdk-linux_86/platforms/android-7/sources
(depending on where you installed your SDK). - Extract the tgz to the new
sources
directory you created. - Restart Eclipse and voila, you have browseable Android source code for your chosen platform.
Cupcake (version 1.5) is platform/android-3
Donut (version 1.6) is platform/android-4
Eclair (version 2.0, 2.0.1, 2.1) is platform/android-{5,6,7}