In order to create our own Android system, we have to set up the AOSP build environment and build our own AOSP target for the Android emulator. Since Android is under rapid development, the build process and environment setup can change from time to time. You can always refer to Google's website for the latest information, https://source.android.com/source/building.html.
While the Google website and other sources can give general guidelines and procedures about the AOSP build, in this section we will look specifically at how to build AOSP for Android emulator image for API level 25.