> For the complete documentation index, see [llms.txt](https://sec88.0x88.online/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://sec88.0x88.online/android-appsec/android-app-fundamentals/android-architecture.md).

# Android Architecture

Android OS implements many security components and has many considerations for its various layers; the following diagram summarizes the Android security architecture on ARM with TrustZone support:

![](https://static.packt-cdn.com/products/9781785287817/graphics/B04179_04_03.jpg)

### Layers of Modern Android Application Architecture

#### UI Layer

Puts data from the application on the screen. The UI Layer is typically made up of two more compact parts (UI = UI Elements + UI State).

#### Domain Layer

This layer is optional; not all applications, particularly basic ones, require a domain layer to manage reusable business logic or are too complex to be contained entirely within the data layer. The business logic of an application specifies the creation, storage, and modification of data.

#### Data Layer

Data sources and repositories are the two elements that make up the data layer, which controls the majority of the application’s business logic.

### Android Framework

* **Definition:** The Android Framework provides essential classes for building Android applications. It manages the user interface, application resources, and acts as an abstraction layer for hardware access.
* **Services Offered:**
  * Telephony service
  * Location services
  * Notification management
  * NFC service
  * View system, etc.
* **APIs Access:**
  * Entire Android OS features are accessible to developers through Java-written APIs.
* **Crucial Components:**
  1. **View System:** Facilitates the creation of graphic elements for app interaction.
  2. **Activity Manager:** Manages app entry points and UI components called activities.
  3. **Location Manager:** Utilizes GPS for precise user location.
  4. **Telephony Manager:** Integrates hardware and software elements for telephony services.
  5. **Resource Manager:** Provides access to non-code resources like layout files and graphics.
  6. **Content Provider:** Facilitates standardized data sharing between apps.
  7. **Notification Manager:** Handles informing users about application events.

### Android System Architecture

1. **Linux Kernel:**
   * Foundation of Android architecture.
   * Manages drivers, resources, security, memory, and multitasking.
2. **Android Runtime:**
   * Includes Dalvik Virtual Machine (DVM) for executing Android applications.
   * Converts Java byte code to `.dex` files for optimization.
3. **Libraries:**
   * Native libraries offering instructions for handling various data types.
   * Includes Java-based and C/C++ core libraries for graphics, SSL, SQLite, media, etc.
4. **Application Framework:**
   * Provides high-level services, APIs, and an Android Hardware Abstraction Layer (HAL).
   * Interfaces between the application layer and native libraries.
   * Services like Resource Manager, Notification Manager, Package Manager.....
5. **Applications:**
   * Top layer containing installed third-party and native Android apps.
   * Includes all user-installed programs, games, settings, etc.

## Application Journey

1. Code -> Compile -> DEX Format
2. DEX -> Build -> APK
3. APK -> Signature -> Signed APK
4. Signed APK -> Google Play -> User Install


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://sec88.0x88.online/android-appsec/android-app-fundamentals/android-architecture.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
