Source Tree Documentation?

3,653 views
Skip to first unread message

Sangmin Lee

unread,
Jul 22, 2011, 3:15:29 PM7/22/11
to android-platform
Hi All,

I have just started looking at source code of android but it is hard
for me to figure out which part of source code tree corresponds to
which component of android system. Is there any documentation on this?
I appreciate your help in advance.

Thanks!

giangiammy

unread,
Jul 24, 2011, 4:18:17 AM7/24/11
to android-...@googlegroups.com
Hi!

I had the same problem, when some months ago started working with Android.
I have been trying to trace the code I needed to modify, with the help of Google:
there'ra various information sparsed on the web.

I gathered my notes here: http://www.giammy.com/nsa/
They are my notes, so nothing organic, but strictly based on what I needed
to discover, and I was writing in italian.

I have seen some interest in the international community, and I have
started a translation ... but it's a free-time project ...so i do not promise
anything :-(

But the references are often original english blog .... and filenames are the same :-)

bye
giammy

-- 
Gianluca Moro                          
N.s.A - Note su Android                http://www.giammy.com/nsa
Medical Brain Computer Interface  https://groups.google.com/group/medical-bci/






Kenji Tan

unread,
Jul 22, 2011, 5:13:42 PM7/22/11
to android-...@googlegroups.com
There's documentation on http://source.android.com/source/index.html as well as http://developer.android.com/guide/index.html to get started.

Also, the platform source tree is massive, so naturally the learning curve is quite steep. I learnt my way around by starting from the build directory, specifically, build/envsetup.sh. There're are a number of useful grep functions i.e. cgrep, jgrep, resgrep. They're very handy when grepping.

Dive right in and remember to use the source :)



--
You received this message because you are subscribed to the Google Groups "android-platform" group.
To post to this group, send email to android-...@googlegroups.com.
To unsubscribe from this group, send email to android-platfo...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/android-platform?hl=en.


Nigel Sheridan-Smith

unread,
Jul 25, 2011, 6:18:20 PM7/25/11
to android-...@googlegroups.com
A quick overview of the directories (I couldn't find the one I saw previously)

bionic - Standard C library for Android device / emulator
bootable - bootloader, installer and other device booting stuff
build - All the build utils and scripts... in particular
 -  core/combo - Defines the settings for each type of device (e.g. porting)
cts - the Android testing framework
dalvik - the Android VM... in particular
 -   vm - the libdvm library
 -   libdex - the DEX file format library
 -   dalvikvm - the executable 'dalvikvm' linked to libdvm
 -   libnativehelper - the Java JNI library
development - emulator, simulator, and stuff for the NDK and SDK
device - files specific to particular vendors' devices
external - all the external source code for various libraries and tools - includes 'Skia' the Android graphics core
frameworks - the Android framework library (both Java and native code)... in particular
 -   base/core/jni - Core JNI code (bridge between Java and C/C++)
 -   base/core/java - Core Java source code
 -   base/services/java - Core Android 'services'
 -   base/cmds/ - Essential commands (typically C++) - includes 'runtime' (for simulator?), 'system_server' for booting the core Android components from Java, and 'servicemanager' which 'binds' the services together through the Binder IPC mechanism - like an naming service
 -   base/media - all the media libraries
 -   base/opengl & base/graphics - graphics libraries    
 -   libs/binder - the Binder IPC framework
 -   base/policy - policy components
 -   base/telephony - phone and telephony components
 -   base/native - additional native libraries (keyboard, graphics, etc)
hardware - libraries for basic hardware support - in particular
 -   libhardware/modules/gralloc - framebuffer driver
 -   libhardware_legacy - power, vibration, wifi drivers
libcore - the Harmony Java Virtual Machine - which Dalvik uses for its Java API... in particular
 -   luni/src/main/java - Java code for Java libraries
 -   luni/src/main/native - Native C/C++ code for Java libraries (through JNI bridge)
ndk - Native Development Kit (for developing native applications)
out - the directory where all 'host' and 'target' build files are kept... in particular
 -   host/<os>/bin - utilities for host building, including the 'simulator' (on Linux only)
 -   (debug?)/target/product/generic/system - the target system file system
packages -  'applications' and 'providers' to be packaged into .apk files
prebuilt - all the pre-built tools for cross-compiling
sdk - the Android Software Development Kit (for application developers)
system - core system libraries and utilities. In particular...
 -  core/liblog - logging
 -  core/libcutils - addtional C functions - also 'zygote' which takes care of some forking new Dalvik processes
 -  core/toolbox - typical UNIX utilities
 -  core/init - the 'init' process for native boot sequence
 -  core/libpixelflinger - low level pixel graphics rendering
 -  core/netd - the 'netd' network daemon
 -  core/vold - the 'vold' volume management daemon
 -  core/wlan - additional Wireless LAN drivers
tools - the 'tradefederation' tool, which I have not worked out what this does yet :)


To do a build, you typically run the following commands
. build/envsetup.sh
lunch
m showcommands
            ^^ shows specific command lines for each item built

You can also do "mm" for the current directory only (excluding dependencies) or "mmm" followed by a directory name to target a specific directory

I hope you have found this useful...

Cheers,

Nigel

Sangmin Lee

unread,
Jul 26, 2011, 11:05:56 AM7/26/11
to android-platform
These are all awesome! Thanks a lot!
> On Sat, Jul 23, 2011 at 7:13 AM, Kenji Tan <tan.kenji.2...@gmail.com> wrote:
> > There's documentation onhttp://source.android.com/source/index.htmlas
> > well ashttp://developer.android.com/guide/index.htmlto get started.
>
> > Also, the platform source tree is massive, so naturally the learning curve
> > is quite steep. I learnt my way around by starting from the build directory,
> > specifically, build/envsetup.sh. There're are a number of useful grep
> > functions i.e. cgrep, jgrep, resgrep. They're very handy when grepping.
>
> > Dive right in and remember to use the source :)
>
Reply all
Reply to author
Forward
0 new messages