Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
250 changes: 250 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,250 @@
# TestAndroidApp

A minimal Android application built with **Kotlin** and **Jetpack Compose**, serving as a starter template for Android development within the ComplyCube ecosystem.

---

## Table of Contents

- [Overview](#overview)
- [Tech Stack](#tech-stack)
- [Architecture](#architecture)
- [Project Structure](#project-structure)
- [Screens and UI Flow](#screens-and-ui-flow)
- [Theme System](#theme-system)
- [Getting Started](#getting-started)
- [Building and Running](#building-and-running)
- [Testing](#testing)

---

## Overview

| Property | Value |
|-----------------|-------------------------------|
| Package name | `com.complycube.testandroidapp` |
| Min SDK | 24 (Android 7.0 Nougat) |
| Target SDK | 36 (Android 15) |
| Compile SDK | 36 |
| Language | Kotlin |
| UI toolkit | Jetpack Compose + Material 3 |
| Version | 1.0 |

---

## Tech Stack

| Layer | Library / Tool | Version |
|------------------|---------------------------------------------|---------------|
| Language | Kotlin | 2.0.21 |
| Build | Android Gradle Plugin | 9.0.1 |
| UI | Jetpack Compose BOM | 2024.09.00 |
| Material Design | androidx.compose.material3 | (BOM-managed) |
| Lifecycle | androidx.lifecycle.runtime.ktx | 2.10.0 |
| Activity | androidx.activity.compose | 1.13.0 |
| Core | androidx.core.ktx | 1.18.0 |
| Unit testing | JUnit 4 | 4.13.2 |
| UI testing | Espresso + Compose UI Test | (BOM-managed) |

Dependencies are managed via a **Gradle version catalog** (`gradle/libs.versions.toml`).

---

## Architecture

This project is a single-screen template and intentionally keeps the architecture flat. There are no ViewModels, repositories, or data layers — the app is a starting point to layer those concerns onto.

```
┌─────────────────────────────────────────────┐
│ MainActivity │
│ (ComponentActivity, edge-to-edge enabled) │
│ │
│ ┌─────────────────────────────────────┐ │
│ │ TestAndroidAppTheme │ │
│ │ (Material 3 theme wrapper) │ │
│ │ │ │
│ │ ┌───────────────────────────────┐ │ │
│ │ │ Scaffold │ │ │
│ │ │ │ │ │
│ │ │ ┌─────────────────────────┐ │ │ │
│ │ │ │ Greeting() │ │ │ │
│ │ │ │ Text("Hello Android!") │ │ │ │
│ │ │ └─────────────────────────┘ │ │ │
│ │ └───────────────────────────────┘ │ │
│ └─────────────────────────────────────┘ │
└─────────────────────────────────────────────┘
```

---

## Project Structure

```
TestAndroidApp/
├── app/
│ ├── src/
│ │ ├── main/
│ │ │ ├── java/com/complycube/testandroidapp/
│ │ │ │ ├── MainActivity.kt # Entry point, hosts Greeting composable
│ │ │ │ └── ui/
│ │ │ │ └── theme/
│ │ │ │ ├── Color.kt # Material 3 color tokens
│ │ │ │ ├── Theme.kt # App theme (light/dark + dynamic color)
│ │ │ │ └── Type.kt # Typography scale
│ │ │ ├── res/
│ │ │ │ ├── values/
│ │ │ │ │ ├── strings.xml # String resources
│ │ │ │ │ ├── colors.xml
│ │ │ │ │ └── themes.xml # Base XML theme (no action bar)
│ │ │ │ ├── drawable/ # Vector assets
│ │ │ │ ├── mipmap-*/ # Launcher icons (all densities)
│ │ │ │ └── xml/ # Backup and data extraction rules
│ │ │ └── AndroidManifest.xml
│ │ ├── test/
│ │ │ └── ExampleUnitTest.kt # JUnit 4 unit test example
│ │ └── androidTest/
│ │ └── ExampleInstrumentedTest.kt # Espresso instrumented test example
│ ├── build.gradle.kts
│ └── proguard-rules.pro
├── gradle/
│ └── libs.versions.toml # Centralized dependency versions
├── build.gradle.kts # Root build file
├── settings.gradle.kts
└── gradle.properties
```

---

## Screens and UI Flow

The app currently has **one screen**:

```
App Launch
┌──────────────────────────┐
│ MainActivity │
│ │
│ ┌──────────────────┐ │
│ │ "Hello Android!" │ │
│ └──────────────────┘ │
└──────────────────────────┘
```

### Composables

| Composable | Description |
|-------------------------|-------------------------------------------------------|
| `Greeting(name, modifier)` | Displays a greeting text string |
| `GreetingPreview()` | `@Preview` composable for IDE design-time rendering |
| `TestAndroidAppTheme{}` | Wraps children in the app's Material 3 theme |

---

## Theme System

The theme supports **light mode**, **dark mode**, and **dynamic color** (Material You, Android 12+).

```
TestAndroidAppTheme
├── Android 12+ and dynamic color enabled?
│ ├── YES → dynamicDarkColorScheme / dynamicLightColorScheme
│ └── NO ─┐
│ ▼
│ ┌────────────────┐
│ │ darkTheme? │
│ ├── YES → DarkColorScheme
│ └── NO → LightColorScheme
└── MaterialTheme(colorScheme, typography)
```

### Color Tokens

| Token | Light value | Dark value |
|----------------|---------------|---------------|
| `primary` | Purple40 | Purple80 |
| `secondary` | PurpleGrey40 | PurpleGrey80 |
| `tertiary` | Pink40 | Pink80 |

### Typography

`bodyLarge` is customized:

| Property | Value |
|-------------|-----------------|
| Font family | Default (system) |
| Font weight | Normal |
| Font size | 16sp |
| Line height | 24sp |
| Letter spacing | 0.5sp |

---

## Getting Started

### Prerequisites

- **Android Studio** Ladybug (2024.2) or later
- **JDK 17** or later
- **Android SDK** with API level 36 platform installed
- An Android emulator or physical device running Android 7.0 (API 24) or higher

### Clone the repository

```bash
git clone <repository-url>
cd TestAndroidApp
```

---

## Building and Running

### Via Android Studio

1. Open the project in Android Studio.
2. Wait for Gradle sync to complete.
3. Select a run target (emulator or connected device).
4. Click **Run** (Shift+F10).

### Via command line

```bash
# Debug build
./gradlew assembleDebug

# Install on connected device/emulator
./gradlew installDebug

# Release build (requires signing config)
./gradlew assembleRelease
```

---

## Testing

### Unit tests

```bash
./gradlew test
```

Runs JUnit 4 tests located in `app/src/test/`.

### Instrumented tests

```bash
./gradlew connectedAndroidTest
```

Runs Espresso and Compose UI tests located in `app/src/androidTest/`. Requires a connected device or running emulator.

### All checks

```bash
./gradlew check
```