Lost Password?

A password will be emailed to you. You will be able to change your password and other profile details once you have logged in.

Resource Roundup: Android Source Code

Much has been made of Android being open source. Strategically, this is of huge importance. Tactically, though, your average Android application development may feel somewhat locked out of the source code, simply due to volume. The entire set of Android source code takes up 2.1GB, which means learning anything from it may be as difficult as finding a needle in a haystack.

So, here's your map to some needles of interest.

First, the source code as a whole is hosted on http://source.android.com/, and any questions you may have about the source code should go on one of the discussion groups related to the source code itself.

While the source is hosted as a roster of git repositories, your easier way to find what you want will be through the Web. There are two approaches for this:

  1. Use Google Code Search, restricting your search to things in the Android package. For example, you can search for references to specific classes, like SQLiteOpenHelper, via package:android SQLiteOpenHelper. This is especially useful when you want to find other classes that reference a particular class of interest (e.g., which Android built-in apps use SQLiteOpenHelper).
  2. Browse the source code via GitWeb.

Here are some of the more useful GitWeb trees for Android SDK developers:

Browsing the trees will get you to the source code for individual classes.

If you are looking simply to reuse some code (under the Apache License 2.0), it is probably simplest to just cut-and-paste. For example, DroidEx was created by examining some of the classes that make up DDMS and hierarchyviewer, to see how they accessed the screenshot service offered by Android devices and emulators.

Mark Murphy is the founder of CommonsWare and is the author of _The Busy Coder's Guide to Android Development_, _The Busy Coder's Guide to *Advanced* Android Development_, and _Android Programming Tutorials_.

Like this? Share it.

Related Posts

Ubuntu Ported To the Galaxy S II

  • 8

The Galaxy S II isn't even officially available yet in the US but it has already been rooted, overclocked and the first custom ROMs are coming up as well. I used to run Ubuntu on my original Galaxy S (Just for fun of course, like you can effectively use Ubuntu on a 4" screen), so I decided to port Ubuntu to the Galaxy S II. Read More »

How To Modify .apk Files

  • 12

The extension Google uses for Android applications may seem a bit complicated, but it really isn't. In fact, an .apk is nothing else than a .zip file disguised as an .apk. That makes things real simple. Read More »