当前位置: 移动技术网 > 移动技术>移动开发>Android > Android源码中的目录结构详解

Android源码中的目录结构详解

2019年07月24日  | 移动技术网移动技术  | 我要评论
android 2.1
|-- makefile
|-- bionic                        (bionic c库)
|-- bootable                (启动引导相关代码)
|-- build                        (存放系统编译规则及generic等基础开发包配置)
|-- cts                        (android兼容性测试套件标准)
|-- dalvik                        (dalvik java虚拟机)
|-- development        (应用程序开发相关)
|-- external                (android使用的一些开源的模组)
|-- frameworks                (核心框架——java及c++语言)
|-- hardware                (部分厂家开源的硬解适配层hal代码)
|-- out                        (编译完成后的代码输出与此目录)
|-- packages                (应用程序包)
|-- prebuilt                (x86和arm架构下预编译的一些资源)
|-- sdk                        (sdk及模拟器)
|-- system                        (底层文件系统库、应用及组件——c语言)
`-- vendor                (厂商定制代码)

bionic 目录
|-- libc                        (c库)
|   |-- arch-arm        (arm架构,包含系统调用汇编实现)
|   |-- arch-x86        (x86架构,包含系统调用汇编实现)
|   |-- bionic                (由c实现的功能,架构无关)
|   |-- docs                (文档)
|   |-- include                (头文件)
|   |-- inet                (?inet相关,具体作用不明)
|   |-- kernel                (linux内核中的一些头文件)
|   |-- netbsd                (?nesbsd系统相关,具体作用不明)
|   |-- private                (?一些私有的头文件)
|   |-- stdio                (stdio实现)
|   |-- stdlib                (stdlib实现)
|   |-- string                (string函数实现)
|   |-- tools                (几个工具)
|   |-- tzcode                (时区相关代码)
|   |-- unistd                (unistd实现)
|   `-- zoneinfo        (时区信息)
|-- libdl                        (libdl实现,dl是动态链接,提供访问动态链接库的功能)
|-- libm                        (libm数学库的实现,)
|   |-- alpha                (apaha架构)
|   |-- amd64                (amd64架构)
|   |-- arm                (arm架构)
|   |-- bsdsrc                (?bsd的源码)
|   |-- i386                (i386架构)
|   |-- i387                (i387架构?)
|   |-- ia64                (ia64架构)
|   |-- include                (头文件)
|   |-- man                (数学函数,后缀名为.3,一些为freebsd的库文件)
|   |-- powerpc        (powerpc架构)
|   |-- sparc64                (sparc64架构)
|   `-- src                (源代码)
|-- libstdc++                (libstdc++ c++实现库)
|   |-- include                (头文件)
|   `-- src                (源码)
|-- libthread_db        (多线程程序的调试器库)
|   `-- include                (头文件)
`-- linker                        (动态链接器)
`-- arch                (支持arm和x86两种架构)

bootable 目录
.
|-- bootloader                                (适合各种bootloader的通用代码)
|   `-- legacy                                (估计不能直接使用,可以参考)
|       |-- arch_armv6                (v6架构,几个简单的汇编文件)
|       |-- arch_msm7k                (高通7k处理器架构的几个基本驱动)
|       |-- include                        (通用头文件和高通7k架构头文件)
|       |-- libboot                        (启动库,都写得很简单)
|       |-- libc                        (一些常用的c函数)
|       |-- nandwrite                (nandwirte函数实现)
|       `-- usbloader                (usbloader实现)
|-- diskinstaller                        (android镜像打包器,x86可生产iso)
`-- recovery                                (系统恢复相关)
    |-- edify                                (升级脚本使用的edify脚本语言)
    |-- etc                                (init.rc恢复脚本)
    |-- minui                                (一个简单的ui)
    |-- minzip                                (一个简单的压缩工具)
    |-- mtdutils                        (mtd工具)
    |-- res                                (资源)
    |   `-- images                        (一些图片)
    |-- tools                                (工具)
    |   `-- ota                        (ota over the air updates升级工具)
`-- updater                        (升级器)

build目录
.
|-- core                                (核心编译规则)
|-- history                                (历史记录)
|-- libs                               
|   `-- host                        (主机端库,有android “cp”功能替换)
|-- target                                (目标机编译对象)
|   |-- board                        (开发平台)
|   |   |-- emulator        (模拟器)
|   |   |-- generic                (通用)
|   |   |-- idea6410        (自己添加的)
|   |   `-- sim                (最简单)
|   `-- product                (开发平台对应的编译规则)
|       `-- security        (密钥相关)
`-- tools                                (编译中主机使用的工具及脚本)
    |-- acp                        (android "acp" command)
    |-- apicheck                (api检查工具)
    |-- applypatch                (补丁工具)
    |-- apriori                        (预链接工具)
    |-- atree                        (tree工具)
    |-- bin2asm                (bin转换为asm工具)
    |-- check_prereq        (检查编译时间戳工具)
    |-- dexpreopt                (模拟器相关工具,具体功能不明)
    |-- droiddoc                (?作用不明,java语言,网上有人说和jdk5有关)
    |-- fs_config                (this program takes a list of files and directories)
    |-- fs_get_stats                (获取文件系统状态)
    |-- iself                        (判断是否elf格式)
    |-- isprelinked                (判断是否prelinked)
    |-- kcm                        (按键相关)
    |-- lsd                        (list symbol dependencies)
    |-- releasetools                (生成镜像的工具及脚本)
    |-- rgb2565                (rgb转换为565)
    |-- signapk                (apk签名工具)
    |-- soslim                        (strip工具)
`-- zipalign                (zip archive alignment tool)

dalvik目录 dalvik虚拟机
.
|-- dalvikvm                        (main.c的目录)
|-- dexdump                        (dex反汇编)
|-- dexlist                                (list all methods in all concrete classes in a dex file.)
|-- dexopt                                (预验证与优化)
|-- docs                                (文档)
|-- dvz                                (和zygote相关的一个命令)
|-- dx                                (dx工具,将多个java转换为dex)
|-- hit                                (?java语言写成)
|-- libcore                                (核心库)
|-- libcore-disabled                (?禁用的库)
|-- libdex                                (dex的库)
|-- libnativehelper                (support functions for android's class libraries)
|-- tests                                (测试代码)
|-- tools                                (工具)
`-- vm                                (虚拟机实现)

development 目录                (开发者需要的一些例程及工具)
|-- apps                                (一些核心应用程序)
|   |-- bluetoothdebug        (蓝牙调试程序)
|   |-- customlocale        (自定义区域设置)
|   |-- development        (开发)
|   |-- fallback                (和语言相关的一个程序)
|   |-- fontlab                (字库)
|   |-- gesturebuilder        (手势动作)
|   |-- ninepatchlab        (?)
|   |-- objviewer                (obj查看器)
|   |-- sdksetup                (sdk安装器)
|   |-- spareparts                (高级设置)
|   |-- term                        (远程登录)
|   `-- launchperf                (?)
|-- build                                (编译脚本模板)
|-- cmds                                (有个monkey工具)
|-- data                                (配置数据)
|-- docs                                (文档)
|-- host                                (主机端usb驱动等)
|-- ide                                (集成开发环境)
|-- ndk                                (本地开发套件——c语言开发套件)
|-- pdk                                (plug development kit)
|-- samples                        (例程)
|   |-- aliasactivity        (?)
|   |-- apidemos                (api演示程序)
|   |-- bluetoothchat        (蓝牙聊天)
|   |-- browserplugin        (浏览器插件)
|   |-- businesscard        (商业卡)
|   |-- compass                (指南针)
|   |-- contactmanager        (联系人管理器)
|   |-- cubelivewallpaper        (动态壁纸的一个简单例程)
|   |-- fixedgridlayout        (像是布局)
|   |-- globaltime                (全球时间)
|   |-- helloactivity        (hello)
|   |-- home                        (home)
|   |-- jetboy                        (jetboy游戏)
|   |-- lunarlander        (貌似又是一个游戏)
|   |-- mailsync                (邮件同步)
|   |-- multiresolution        (多分辨率)
|   |-- mysamplerss        (rss)
|   |-- notepad                (记事本)
|   |-- rssreader                (rss阅读器)
|   |-- searchabledictionary        (目录搜索)
|   |-- simplejni                (jni例程)
|   |-- skeletonapp        (空壳app)
|   |-- snake                        (snake程序)
|   |-- softkeyboard        (软键盘)
|   |-- wiktionary                (?维基)
|   `-- wiktionarysimple(?维基例程)
|-- scripts                                (脚本)
|-- sdk                                (sdk配置)
|-- simulator                        (?模拟器)
|-- testrunner                        (?测试用)
`-- tools                                (一些工具)

external 目录
.
|-- aes                        (aes加密)
|-- apache-http                (网页服务器)
|-- astl                        (astl (android stl) is a slimmed-down version of the regular c++ stl.)
|-- bison                        (自动生成语法分析器,将无关文法转换成c、c++)
|-- blktrace                (blktrace is a block layer io tracing mechanism)
|-- bluetooth                (蓝牙相关、协议栈)
|-- bsdiff                        (diff工具)
|-- bzip2                        (压缩工具)
|-- clearsilver                (html模板系统)
|-- dbus                        (低延时、低开销、高可用性的ipc机制)
|-- dhcpcd                (dhcp服务)
|-- dosfstools                (dos文件系统工具)
|-- dropbear                (ssh2的server)
|-- e2fsprogs                (ext2文件系统工具)
|-- elfcopy                (复制elf的工具)
|-- elfutils                        (elf工具)
|-- embunit                (embedded unit project)
|-- emma                        (java代码覆盖率统计工具)
|-- esd                        (enlightened sound daemon,将多种音频流混合在一个设备上播放)
|-- expat                        (expat is a stream-oriented xml parser.)
|-- fdlibm                        (fdlibm (freely distributable libm))
|-- freetype                (字体)
|-- fsck_msdos                (dos文件系统检查工具)
|-- gdata                        (google的无线数据相关)
|-- genext2fs                (genext2fs generates an ext2 filesystem as a normal (non-root) user)
|-- giflib                        (gif库)
|-- googleclient        (google用户库)
|-- grub                        (this is gnu grub, the grand unified bootloader.)
|-- gtest                        (google c++ testing framework)
|-- icu4c                        (icu(international component for unicode)在c/c++下的版本)
|-- ipsec-tools                (this package provides a way to use the native ipsec functionality )
|-- iptables                (防火墙)
|-- jdiff                        (generate a report describing the difference between two public java apis.)
|-- jhead                        (jpeg头部信息工具)
|-- jpeg                        (jpeg库)
|-- junit                        (junit是一个java语言的单元测试框架)
|-- kernel-headers        (内核的一些头文件)
|-- libffi                        (libffi is a foreign function interface library.)
|-- libpcap                (网络数据包捕获函数)
|-- libpng                        (png库)
|-- libxml2                (xml解析库)
|-- mtpd                        (一个命令)
|-- netcat                        (simple unix utility which reads and writes dataacross network connections)
|-- netperf                        (网络性能测量工具)
|-- neven                        (看代码和jni相关)
|-- opencore                (多媒体框架)
|-- openssl                (ssl加密相关)
|-- openvpn                (vpn开源库)
|-- oprofile                (oprofile是linux内核支持的一种性能分析机制。)
|-- ping                        (ping命令)
|-- ppp                        (pppd拨号命令,好像还没有chat)
|-- proguard                (java class file shrinker, optimizer, obfuscator, and preverifier)
|-- protobuf                (a flexible, efficient, automated mechanism for serializing structured data)
|-- qemu                        (arm模拟器)
|-- safe-iop                (functions for performing safe integer operations )
|-- skia                        (skia图形引擎)
|-- sonivox                (sole midi solution for google android mobile phone platform)
|-- speex                        (speex编/解码api的使用(libspeex))
|-- sqlite                        (数据库)
|-- srec                        (nuance 公司提供的开源连续非特定人语音识别)
|-- strace                        (trace工具)
|-- svox                        (embedded text-to-speech)
|-- tagsoup                (tagsoup是一个java开发符合sax的html解析器)
|-- tcpdump                (抓tcp包的软件)
|-- tesseract                (tesseract open source ocr engine.)
|-- tinyxml                (tinyxml is a simple, small, c++ xml parser)
|-- tremor                        (i stream and file decoder provides an embeddable,integer-only library)
|-- webkit                        (浏览器核心)
|-- wpa_supplicant        (无线网卡管理)
|-- xmlwriter                (xml 编辑工具)
|-- yaffs2                        (yaffs文件系统)
`-- zlib                        (a general purpose data compression library)

frameworks 目录        (核心框架——java及c++语言)
.
|-- base                        (基本内容)
|   |-- api                  (?都是xml文件,定义了java的api?)
|   |-- awt                 (awt库)
|   |-- build                (空的)
|   |-- camera           (摄像头服务程序库)
|   |-- cmds              (重要命令:am、app_proce等)
|   |-- core                (核心库)
|   |-- data                (字体和声音等数据文件)
|   |-- docs                (文档)
|   |-- graphics           (图形相关)
|   |-- include             (头文件)
|   |-- keystore        (和数据签名证书相关)
|   |-- libs                (库)
|   |-- location        (地区库)
|   |-- media                (媒体相关库)
|   |-- obex                (蓝牙传输库)
|   |-- opengl                (2d-3d加速库)
|   |-- packages        (设置、tts、vpn程序)
|   |-- sax                (xml解析器)
|   |-- services        (各种服务程序)
|   |-- telephony        (电话通讯管理)
|   |-- test-runner        (测试工具相关)
|   |-- tests                (各种测试)
|   |-- tools                (一些叫不上名的工具)
|   |-- vpn                (vpn)
|   `-- wifi                (无线网络)
|-- opt                        (可选部分)
|   |-- com.google.android                                (有个framework.jar)
|   |-- com.google.android.googlelogin                (有个client.jar)
|   `-- emoji                (standard message elements)
`-- policies                (product policies are operating system directions aimed at specific uses)
    `-- base               
        |-- mid        (mid设备)
        `-- phone   (手机类设备一般用这个,与锁屏有关的代码)

hardware 目录                (部分厂家开源的硬解适配层hal代码)
|-- broadcom                        (博通公司)
|   `-- wlan                        (无线网卡)
|-- libhardware                        (硬件库)
|   |-- include                        (头文件)
|   `-- modules                (default (and possibly architecture dependents) hal modules)
|       |-- gralloc                (gralloc显示相关)
|       `-- overlay                (skeleton for the "overlay" hal module.)
|-- libhardware_legacy        (旧的硬件库)
|   |-- flashlight                (背光)
|   |-- gps                        (gps)
|   |-- include                        (头文件)
|   |-- mount                        (旧的挂载器)
|   |-- power                        (电源)
|   |-- qemu                        (模拟器)
|   |-- qemu_tracing        (模拟器跟踪)
|   |-- tests                        (测试)
|   |-- uevent                        (uevent)
|   |-- vibrator                        (震动)
|   `-- wifi                        (无线)
|-- msm7k                        (高通7k处理器开源抽象层)
|   |-- boot                        (启动)
|   |-- libaudio                (声音库)
|   |-- libaudio-qsd8k        (qsd8k的声音相关库)
|   |-- libcamera                (摄像头库)
|   |-- libcopybit                (copybit库)
|   |-- libgralloc                (gralloc库)
|   |-- libgralloc-qsd8k        (qsd8k的gralloc库)
|   |-- liblights                (背光库)
|   `-- librpc                        (rpc库)
|-- ril                                (无线电抽象层)
|   |-- include                        (头文件)
|   |-- libril                        (库)
|   |-- reference-cdma-sms        (cdma短信参考)
|   |-- reference-ril                        (ril参考)
|   `-- rild                                (ril后台服务程序)
`-- ti                                                (ti公司开源hal)
    |-- omap3                                (omap3处理器)
    |   |-- dspbridge                (dsp桥)
    |   |-- libopencorehw        (opencore硬件库)
    |   |-- liboverlay                (overlay硬件库)
    |   |-- libstagefrighthw        (stagefright硬件库)
    |   `-- omx                        (omx组件)
    `-- wlan                                (无线网卡)

packages 目录
.
|-- apps                            (应用程序库)
|   |-- alarmclock              (闹钟)
|   |-- bluetooth                (蓝牙)
|   |-- browser                  (浏览器)
|   |-- calculator                (计算器)
|   |-- calendar                  (日历)
|   |-- camera                   (相机)
|   |-- certinstaller             (在android中安装数字签名,被调用)
|   |-- contacts                 (拨号(调用)、联系人、通话记录)
|   |-- deskclock               (桌面时钟)
|   |-- email                       (email)
|   |-- gallery                     (相册,和camera类似,多了列表)
|   |-- gallery3d                 (?3d相册)
|   |-- globalsearch            (为google搜索服务,提供底层应用)
|   |-- googlesearch           (google搜索)
|   |-- htmlviewer             (浏览器附属界面,被浏览器应用调用,同时提供存储记录功能)
|   |-- im                            (即时通讯,为手机提供信号发送、接收、通信的服务)
|   |-- launcher                  (登陆启动项,显示图片框架等等图形界面)
|   |-- launcher2                (登陆启动项,负责应用的调用)
|   |-- mms                        (?彩信业务)
|   |-- music                        (音乐播放器)
|   |-- packageinstaller        (安装、卸载程序的响应)
|   |-- phone                        (电话拨号程序)
|   |-- provision                (预设应用的状态,使能应用)
|   |-- settings                (开机设定,包括电量、蓝牙、设备信息、界面、wifi等)
|   |-- soundrecorder        (录音机,可计算存储所需空间和时间)
|   |-- stk                         (接收和发送短信)
|   |-- sync                        (空)   -------○1
|   |-- updater                (空)
|   `-- voicedialer                (语音识别通话)
|-- inputmethods                (输入法)
|   |-- latinime                (拉丁文输入法)
|   |-- openwnn                (openwnn输入法)
|   `-- pinyinime                (拼音输入法)
|-- providers                        (提供器,提供应用程序、界面所需的数据)
|   |-- applicationsprovider                (应用程序提供器,提供应用程序启动项、更新等)
|   |-- calendarprovider                        (日历提供器)
|   |-- contactsprovider                        (联系人提供器)
|   |-- downloadprovider                (下载管理提供器)
|   |-- drmprovider                        (创建和更新数据库时调用)
|   |-- googlecontactsprovider        (联系人提供器的子类,用以同步联系人)
|   |-- googlesubscribedfeedsprovider(设置信息提供器)
|   |-- improvider                                (空)
|   |-- managementprovider                (空)
|   |-- mediaprovider                        (媒体提供器,提供存储数据)
|   |-- telephonyprovider                (彩信提供器)
|   |-- userdictionaryprovider        (用户字典提供器,提供用户常用字字典)
|   `-- websearchprovider                (空)
|-- services                                       
|   |-- easservice                                (空)
|   `-- lockandwipe                        (空)
`-- wallpapers                                        (墙纸)
    |-- basic                                        (基本墙纸,系统内置墙纸)
    |-- livepicker                                (选择动态壁纸)
    |-- magicsmoke                        (壁纸特殊效果)
    `-- musicvisualization                (音乐可视化,图形随音乐而变化)

○1里面有一个隐藏的.git文件夹,内容都是一样的,没有有意义的代码,config看似乎是一个下载程序,因此认为这些文件夹下没有实质东西。

prebuilt 目录                        (x86和arm架构下预编译的一些资源)
.
|-- android-arm                (arm-android相关)
|   |-- gdbserver                (gdb调试器)
|   `-- kernel                        (模拟的arm内核)
|-- android-x86                (x86-android相关)
|   `-- kernel                        (空的)
|-- common                        (通用编译好的代码,应该是java的)
|-- darwin-x86                        (drawin x86平台)
|   `-- toolchain                (工具链)
|       |-- arm-eabi-4.2.1       
|       |-- arm-eabi-4.3.1       
|       `-- arm-eabi-4.4.0       
|-- darwin-x86_64                (drawin x86 64bit平台)
|-- linux-x86                        (linux x86平台)
|   `-- toolchain                (工具链,我们应该主要用这个)
|       |-- arm-eabi-4.2.1       
|       |-- arm-eabi-4.3.1       
|       |-- arm-eabi-4.4.0       
|       `-- i686-unknown-linux-gnu-4.2.1        (x86版编译器)
|-- linux-x86_64                (linux x86 64bit平台)
|-- windows                        (windows平台)
`-- windows-x86_64        (64bit windows平台)
system 目录                (底层文件系统库、应用及组件——c语言)
.
|-- bluetooth                (蓝牙相关)
|-- core                        (系统核心工具盒接口)
|   |-- adb                (adb调试工具)
|   |-- cpio                (cpio工具,创建img)
|   |-- debuggerd        (调试工具)
|   |-- fastboot        (快速启动相关)
|   |-- include                (系统接口头文件)
|   |-- init                (init程序源代码)
|   |-- libacc                (轻量级c编译器)
|   |-- libctest                (libc测试相关)
|   |-- libcutils        (libc工具)
|   |-- liblog                (log库)
|   |-- libmincrypt        (加密库)
|   |-- libnetutils        (网络工具库)
|   |-- libpixelflinger        (图形处理库)
|   |-- libsysutils        (系统工具库)
|   |-- libzipfile        (zip库)
|   |-- logcat                (查看log工具)
|   |-- logwrapper        (log封装工具)
|   |-- mkbootimg        (制作启动boot.img的工具盒脚本)
|   |-- netcfg                (网络配置netcfg源码)
|   |-- nexus                (google最新手机的代码)
|   |-- rootdir                (rootfs,包含一些etc下的脚本和配置)
|   |-- sh                        (shell代码)
|   |-- toolbox                (toolbox,类似busybox的工具集)
|   `-- vold                (sd卡管理器)
|-- extras                        (额外工具)
|   |-- latencytop        (a tool for software developers ,identifying system latency happen)
|   |-- libpagemap        (pagemap库)
|   |-- librank                (java library ranking system库)
|   |-- procmem        (pagemap相关)
|   |-- procrank        (java library ranking system相关)
|   |-- showmap        (showmap工具)
|   |-- showslab        (showslab工具)
|   |-- sound                (声音相关)
|   |-- su                        (su命令源码)
|   |-- tests                (一些测试工具)
|   `-- timeinfo        (时区相关)
`-- wlan                        (无线相关)
    `-- ti                        (ti网卡相关工具及库)


vendor 目录                        (厂家定制内容)

|-- aosp                             (android open source project)
|   `-- products                  (一些板级规则)
|-- htc                               (htc公司)
|   |-- common-open         (通用部分)
|   |   `-- akmd                 (解压img用的工具)
|   |-- dream-open            (g1开放部分)
|   |-- prebuilt-open           (预编译开放部分)
|   `-- sapphire-open         (sapphire这款型号开放内容)
|-- pv-open                       (没东西)
|-- qcom                           (里面基本是空的)
`-- sample                        (google提供的样例)
    |-- apps                        (应用)
    |   |-- client                   (用户)
    |   `-- upgrade              (升级)
    |-- frameworks             (框架)
    |   `-- platformlibrary   (平台库)
    |-- products                  (产品)
    |-- sdk_addon              (sdk添加部分)
    `-- skins                       (皮肤)
        `-- wvgameddpi      (wvga适用的图片)

如对本文有疑问, 点击进行留言回复!!

相关文章:

验证码:
移动技术网