I work with older releases of Android (Gingerbread 2.3.4). To develop for these versions I use now Ubuntu 10.04. At the same time, I would like to use more recent version: 1
Yes, it is possible to build Gingerbread on Ubuntu 12.10.
Biggest problem is that Ubuntu 12.10 has newer gcc 4.7, which is very strict. It is possible to fix it by patching Android source to be compliant with new gcc requirements. However, this can be difficult to do, especially when it involves patching older kernel sources.
You can bypass this by simply installing older gcc 4.4 (which is default version in Ubuntu 10.10).
sudo apt-get install gcc-4.4-multilib g++-4.4-multilib
After that, you need to make gcc 4.4 to be the default compiler for your Android compilation. Easiest way is to simply symlink gcc, g++, cpp to point to older versions and add it to PATH:
mkdir ~/bin
cd ~/bin
ln -s /usr/bin/g++-4.4 g++
ln -s /usr/bin/gcc-4.4 gcc
ln -s /usr/bin/cpp-4.4 cpp
# you might want to add line below to ~/.bashrc:
export PATH=$HOME/bin:$PATH
Now, you need to have Java installed. Unlike newer Android 4, Gingerbread can be built using OpenJDK, so you should be able to simply
sudo apt-get install openjdk-6-jdk
to get working JDK.
Also see this thread.