Support free tutorials

vogella training Training Books

Android Source Code - Notes

Lars Vogel

Version 0.5


How to compile the Android source code

This article contains a few pointers to get the Android source code and to compile the Android source code. It also looks how to download the source code for the Android Developer Tools (which are Eclipse plugins). The description is based on Ubuntu.

Table of Contents

1. Getting the Android source code
2. Installation of the required tools
3. Cloning Android source code
4. The Android Development Tools (ADT)
4.1. ADT tools
4.2. Contributing to the ADT project
4.3. Building the tools
5. About this website
5.1. Donate to support free tutorials
5.2. Questions and discussion
5.3. License for this tutorial and its code
6. Links and Literature
6.1. Source Code
6.2. Android Resources
6.3. vogella Resources

1. Getting the Android source code

To get the Android source code you to use two tools, Git and an additional tool called repo.

2. Installation of the required tools

Install the Git command line tool. See Git tutorial for an introduction into Git and its installation.

You also need to install an additional tool called repo. Execute the following commands for this.

# assumes that you have a local directory called bin
# in your home folder

# download the tool from Google
curl > ~/bin/repo

# make it executable
chmod a+x ~/bin/repo 

3. Cloning Android source code

After you installed the repo tool you can get the Android source code with the following command.

// To get the current master 
repo init -u git:// ; repo sync ; 

The command "git branch -a" show you all available branches, e.g. froyo and gingerbread. You can checkout them via "git checkout branch_name".

To compile the code run the following command.


4. The Android Development Tools (ADT)

4.1. ADT tools

The Android Development Tools (ADT) project provide Eclipse and IntellJ based tooling to development Android applications.


Unfortunately the ADT team were not available for an interview. Most of documentation of the tooling can be found under here: Tool project side.

4.2. Contributing to the ADT project

The contribution process to ADT is based on Gerrit but uses another tool called repo. The contribution process is described here: Contributing to ADT.

4.3. Building the tools

How to build the Eclipse based ADT tooling is described in the following page: Building ADT.

5. About this website

5.1. Donate to support free tutorials

Please consider a contribution Support free tutorials if this article helped you. It will help to maintain our content and our Open Source activities.

5.2. Questions and discussion

Writing and updating these tutorials is a lot of work. If this free community service was helpful, you can support the cause by giving a tip as well as reporting typos and factual errors.

If you find errors in this tutorial, please notify me (see the top of the page). Please note that due to the high volume of feedback I receive, I cannot answer questions to your implementation. Ensure you have read the vogella FAQ as I don't respond to questions already answered there.

5.3. License for this tutorial and its code

This tutorial is Open Content under the CC BY-NC-SA 3.0 DE license. Source code in this tutorial is distributed under the Eclipse Public License. See the vogella License page for details on the terms of reuse.

6. Links and Literature

6.1. Source Code

Source Code of Examples

6.3. vogella Resources

The vogella company provides comprehensive training and education services from experts in the areas of Eclipse RCP, Android, Git, Java, Gradle and Spring. We offer both public and inhouse training. Whichever course you decide to take, you are guaranteed to experience what many before you refer to as “The best IT class I have ever attended”. The vogella company offers expert consulting services, development support and coaching. Our customers range from Fortune 100 corporations to individual developers.