Android Architecture & File System

Taking notes on the Android architecture and file system from a variety of sources

Get Started. It's Free
or sign up with your email address
Android Architecture & File System by Mind Map: Android Architecture & File System

1. The Android Open Source Project (AOSP)

1.1. Android Open Source Project Documentation

2. Bootloader

2.1. 1. Bootloader gets loaded first

2.2. 2. Bootloader inits memory

2.3. 3. (Optional) If A/B updates then determine the boot slot to use

2.4. 4. Determine if recovery mode should be booted instead

2.5. 5. Bootloader loads the image, which contains the kernel and RAM disk

2.5.1. If using Treble, then it loads a lot more...

2.5.2. In Android 8.0 they re-architected the Android OS framework

2.5.3. Known as Treble

2.6. 6. Bootloader starts loading the kernel into memory as a self-executable compressed binary

2.7. 7. Kernel decompresses itself and starts executing in memory

2.8. 8. Old vs. New

2.8.1. Old: Load `init` from the RAM disk

2.8.2. New: Load 'init' from the /system partition

2.9. 9. From /system, `init` launches and starts mounting all the other partitions, such as /vendor, /oem, and /odm, and then starts executing code to start the device

3. Partitions

3.1. boot

3.1.1. Kernel image `kernel`

3.1.2. RAM disk `ramdisk`

3.2. system

3.2.1. Mainly contains the Android framework

3.3. recovery

3.3.1. Stores the recovery image

3.3.2. Booted during the OTA (Over-the-air) process

3.4. cache

3.4.1. Stores temporary data

3.4.2. Doesn't need to be writable by bootloader, only erasable

3.5. misc

3.5.1. Used by /recovery and is 4KB or larger

3.6. userdata

3.6.1. Contains user-installed applications and data, including customization data

3.7. metadata

3.7.1. Used when device is encrypted and is 16MB or larger

3.8. vendor

3.8.1. Any binary not distributed via the AOSP. Any vendor-specific stuff. .Think Motorola, Samsung, Sprint, T-Mobile, etc.

3.9. radio

3.9.1. Only necessary for devices that include a radio that have a radio-specific software in a dedicated partiition

3.10. tos

3.10.1. Stores the binary of the Trusty OS. Used only if the device includes Trusty

4. Five Data Storage Methods

4.1. Shared Preferences

4.2. Internal Storage

4.3. External Storage

4.4. SQLite

4.5. Network

5. Directories

5.1. /data

5.1.1. /data

5.1.1.1. Common subdirectories of com.modules.app within

5.1.1.1.1. shared_prefs

5.1.1.1.2. lib

5.1.1.1.3. files

5.1.1.1.4. cache

5.1.1.1.5. databases

5.2. /sdcard

5.2.1. /data