Disclaimer: it's translation of my article that was written in Russian some time ago. All mentioned versions of software are outdated now. But anyway, it can be helpful :).
For one of my projects I needed to improve original Android sources to create firmware for specific hardware. The version of Android was chosen quite old — AOSP 4.0.4 but it was necessary because stable version of sources for our hardware was based on this version. The next issues was my work environment. Besides Android development I'm working with iOS so I have to use Mac OS X and Xcode as development environment.