Architecture Overview

Pebbl follows modern Android development best practices with a clean, maintainable architecture.

Technology Stack

Core Android

Technology
Version
Purpose

Kotlin

2.0.21

Primary programming language

Android SDK

Min 24, Target 36

Platform framework

Jetpack Compose

2024.09.00

Declarative UI framework

Material 3

Latest

Design system

Architecture Components

Component
Version
Purpose

Room

2.6.1

Local SQLite database ORM

ViewModel

2.8.0

UI state management

Navigation Compose

2.7.7

Type-safe navigation

DataStore

1.1.1

Key-value preferences

Networking & AI

Library
Version
Purpose

Retrofit

2.9.0

HTTP client

OkHttp

4.12.0

HTTP engine & interceptors

Gson

2.10.1

JSON serialization

Speech Recognition

Library
Version
Purpose

Vosk SDK

0.3.38

Offline speech-to-text

Async & Reactive

Component
Version
Purpose

Kotlin Coroutines

1.8.0

Async/await pattern

Flow & StateFlow

Core

Reactive data streams

Build Tools

Tool
Version
Purpose

Gradle

8.13.0

Build system

KSP

2.0.21-1.0.29

Annotation processing for Room

AGP

8.5.1

Android Gradle Plugin

Project Structure

Design Patterns

MVVM (Model-View-ViewModel)

Separation of Concerns

Benefits:

  • Testable business logic (ViewModels)

  • Reactive UI updates (StateFlow)

  • Lifecycle-aware components

  • Clear data flow

Repository Pattern

Abstracts data sources from ViewModels:

Benefits:

  • Single source of truth

  • Easy to mock for testing

  • Centralized error handling

  • Can switch data sources without changing ViewModels

Sealed Classes for State

Type-safe state representation prevents impossible states:

Benefits:

  • Exhaustive when expressions

  • Impossible to have invalid state combinations

  • Clear state transitions

  • Type-safe data associated with states

Dependency Injection (Manual)

Currently using manual DI via Application class:

Access in Activities:

Note: Consider migrating to Hilt/Dagger for larger-scale DI needs.

Last updated