Download, compile and test Android source code, Android source code contains a lot of things, such as: embedded in the Android system of the application (photo, Calculator, calendar, album, dialer, etc.) source code; ANDROIDSDK with various tools (ADB, emulator , Mksdcard, AAPT, etc.) source code, of course, Hal Source code, from the number of code, the Android source is still very complex. But studying the Android source code doesn't have to be all about it, just the code you need to know. You must also configure the download environment on Linux before downloading the Android source code. In addition to the makefile file in the source code directory of Android, the other directories are all different sub-projects that save the Android source. If only one part of the Android source code needs to know the directory structure of the Android source code, you can download any desired part. You can use the Repo Sync command or use the git chone command. Because each project code in the Android source code has a andorid.mk file, compiling the entire Android source code recursively invokes the Android.mk file in each project directory to compile the current project. The steps to compile the Android source code are as follows: (1) Initialize the build Environment (2) Select the target (3) to compile the Android source code. Android porting is primarily a migration of the Linux kernel, while the Linux kernel porting is primarily a Linux-powered migration. So in order to develop and test Linux drivers, two sets of development environments are built under virtual machines: the Android application development environment and the Linux kernel development environment.
Android Deep Explore fourth Chapter