Browsing Android Source in Eclipse

This has been done before, but the way I set it up now is easier than other methods I've seen.
  1. Visit the Git site for browsing the Android framework source.
  2. Click the "tree" link next to the branch you want (e.g. Eclair, Donut, Cupcake, etc.)
  3. Click the "snapshot" link to download a tgz of the source for that branch.
  4. 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).
  5. Extract the tgz to the new sources directory you created.
  6. Restart Eclipse and voila, you have browseable Android source code for your chosen platform.
You'll need to repeat these steps for each platform you use as a target for your projects. As a bonus for making it to the end of this post, here's a summary of platform numbers, version numbers, and code names:

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}

No comments:

Post a Comment