We all know that the Android system is an open source project that can be downloaded to the source code online.
Generally search on the Internet, you will find a variety of ways to download the source code, such as the use of git and repo,android source code to download the URL is http://android.git.kernel.org/.
On the use of git download Android source code method, I will not repeat, because there are many ways online, here is a reference link Windows platform under the Android source download.
If you are the same as I am a beginner, believe that read the above article, you will know how to use git download Android source code.
However, look at the http://android.git.kernel.org/site under the various directories and files, I believe you will also like me dumbfounded,
I don't know what the file in that directory corresponds to. So here's an introduction to the structure of the Android source code,
If you find that the article has the wrong place, also please children's shoes lightly hit brick!
Figure: http://android.git.kernel.org/ under a complex document
Android System Architecture
Before you know the Android source code structure, let's familiarize yourself with Android's system architecture.
Android architecture is divided into four tiers, from bottom to top: Linux operating system and drive layer, native framework and Java Runtime Environment, Java framework, Java application layer.
The specific description of each layer is skipped here.
Android source code structure
Android Code project is divided into 3 parts, after opening the http://android.git.kernel.org/see, is the root directory of the Android source code.
(Suggested: After opening this website, learn the following content)
- Core Project: Build the foundation of your Android system, in the various folders in the root directory.
- Extension Engineering (External project): Features extended with other open source projects in the External folder.
- Package: Provides Android apps and services in the Packages folder.
1. Android Core Project
Android's core project contains support for the basic operation of the Android system, as well as the Android system's compilation system, the project's contents are as follows:
Android's core project
Project name |
Project description |
Bionic |
[Build System] C Run-time support: libc, LIBM, LIBDL, dynamic linker |
Bootloader/legacy |
Bootloader Reference Code (kernel loader, run before kernel runs) |
Build |
[Build System] Build system |
Dalvik |
Dalvik virtual Machines |
Delelopment |
High-level development and commissioning tools |
Framework/base |
Android Core Frame Library |
Framework/policies/base |
Framework Configuration Policy |
Hardware/libhardware |
Hardware Abstraction Layer Library |
Hardware/ril |
Wireless interface Layers (Radio Interface layer) |
Kernel |
Linux kernel |
prebuilt |
[Precompiled kernel] binary support for Linux and Mac OS compilation |
System/core |
Minimizing a bootable environment |
System/extras |
Bottom-level debugging and inspection tools |
In addition to the works listed in the table above, there are other projects, but most of the Android system is the 2nd level of source code.
2. Android Extension Project
Android's extension project is included in the external folder, which is an open source project adapted to the Android system.
Some projects run on the host, and some are run on the target machine. Because of the expansion of the project is more, not listed, interested children's shoes can collect some of their own information to learn.
3. Java Package in Android
The Java package in Android is the 4th level of Android architecture, including the application (application) and content provider (contents Providers) two parts, and a directory inputmethods is the input method part.
Applications (application) in the Package/apps directory, mainly include:
Alarmclock,browser,calculator,calendar,camera,contacts,e-mail,googlesearch
HTML Viewer,im,launcher,mms,music,packageinstaller,phone
Settings,soundrecorder,stk,sync,updater,voicedialer.
content providers (Providers) in the Package/providers directory, mainly include:
Calendarprovider,contactsprovider,downloadprovider,drmprovider
Googlecontactsprovider,googlesubsribedfeedsprovidercimprovider,mediaprovider
Settingsprovider,subscribedfeedsprovider,telephonyprovider.
4,
on-demand download
If you only need one or several of these files, you can use the following GIT commands:
git clone git://android.git.kernel.org/Project code path
(Example: Git clone git://android.git.kernel.org/platform/packages/providers/drmprovider.git)
The destination address of the download is the current directory where the git command line is currently located.
Download various versions of the Android SDK source code
To provide you with a way to download different versions of SDK source code under Windows, I also found other methods on the Internet, but all copy&paste out.
or refer to another blog post: Download Android.jar Source Code using the Git tool
1, download git, and install it well;
2, create a new file frameworks, this folder is used to store the Android SDK you will download the source code of the directory
3. Start the git bash command line, enter the command git clone git://android.git.kernel.org/platform/frameworks/base.git frameworks,
All files and folders under the Base folder on the android.git.kernel.org site will be downloaded to the local frameworks folder;
4, in the GIT command line environment, using the CD command, step into the Frameworks/base folder;
5, use "git tag" command, display all the Android source code project name;
6, find the name and version of the source code you need, in the use of the command "Git checkout android-1.5r4" switch to the corresponding version of the simulator (emulator);
7. Copy all the files under Frameworks/base/core/java to the "android-sdk-windows\platforms\android-3\sources" folder in your SDK directory.
Note: Each time you switch the version of the emulator, Git automatically downloads the corresponding version of the source code from the website to the frameworks/base/folder, and copies the files under that folder to the corresponding version of the SDK directory.
Android Source Code Architecture