# belledonnecommunications/linphone-android architecture

> Architecture diagram of the GitHub repository belledonnecommunications/linphone-android, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-10-16). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/belledonnecommunications/linphone-android
- Repository: https://github.com/belledonnecommunications/linphone-android

## Overview

##### Project type and purpose
- This is Linphone-Android, an open-source SIP softphone client for Android (voice/video calls + messaging).
- It is a full-blown native mobile application (no web or server code here) that embeds a native SIP/media stack via an AAR from the linphone-sdk.

##### File structure
- Top level
- app/ – the Android Studio Gradle module containing all code & resources
- build scripts (build.gradle.kts, settings.gradle.kts, gradle wrapper, CI config, Docker files)
- metadata/ – Play Store & F-Droid descriptions
- app/src/main/java/org/linphone
- core/ – wrappers around the native SIP core: services, context, preferences, VFS, file transfer, push handling
- ui/ – subdivided into assistant, call, conference, chat, contacts, fileviewer, main, meetings, recordings, settings, welcome
– each feature follows MVVM: Fragment/Activity → ViewModel → Model
- compatibility/ – Android OS version abstractions
- notifications/, telecom/ – Android platform integrations (InCallService, TelecomManager, NotificationReceiver)
- utils/ – shared helpers (AudioUtils, FileUtils, Event, ToastUtils, etc.)
- Configuration & assets – linphonerc default values, google-services.json for Firebase, proguard rules

##### README for additional insights
- Confirms it pulls a Linphone-SDK AAR (native C/C++ SIP stack) at build time.
- Supports Firebase push notifications for incoming calls/messages.
- Targets Android 9.0+ and uses NDK for native symbol generation.
- Uses AndroidX (Navigation Component, ViewModel, LiveData).

##### Attention to detail
- Navigation graphs as part of the UI layer or as an overlay
- JNI bridge explicitly between Core API Layer and native library
- Background receivers/services and their triggers (system boot, push arrival)
- Persistent storage components and where data flows for logs and settings

## Diagram (Mermaid)

```mermaid
graph TB
  subgraph "UI Layer"
    UI["Activities & Fragments\n(assistant, call, chat, contacts, settings, welcome)"]:::ui
    NAV["Navigation Graphs"]:::ui
  end

  subgraph "ViewModel Layer"
    VM["Feature ViewModels"]:::vm
  end

  subgraph "Core API Layer"
    CC["CoreContext"]:::api
    CPref["CorePreferences"]:::api
    CFT["CoreFileTransferService"]:::api
    CPS["CorePushService"]:::api
    CKA["CoreKeepAliveThirdPartyAccountsService"]:::api
    CPR["CorePushReceiver"]:::api
    CI["CoreInCallService"]:::api
    VFS["VFS (Virtual File System)"]:::api
    BR["BootReceiver"]:::api
  end

  subgraph "Native SIP Core"
    NSC["linphone-sdk AAR\n(JNI Bridge)"]:::native
  end

  subgraph "Android Platform Services"
    PLT1["TelecomManager\n& InCallService"]:::platform
    PLT2["NotificationsManager\n& NotificationReceiver"]:::platform
    AUTO["Android Auto Services"]:::platform
  end

  subgraph "Storage"
    SP["SharedPreferences"]:::storage
    FS["Local File System"]:::storage
  end

  subgraph "External Services"
    SIP["SIP Registrar/Proxy & RTP/RTCP"]:::external
    FCM["Firebase Cloud Messaging"]:::external
  end

  UI -->|events| VM
  VM -->|calls| CC
  VM -->|calls| CFT
  VM -->|calls| CPS
  VM -->|calls| CI
  CC -->|jni| NSC
  CFT -->|jni| NSC
  CPS -->|jni| NSC
  CI -->|jni| NSC
  NSC -->|SIP signaling & media| SIP
  NSC -->|telecom integration| PLT1
  NSC -->|notifications| PLT2
  CPS <-->|push token & events| FCM
  BR -->|on boot| CPS

  CPref -->|stores| SP
  VFS -->|stores| FS

  click UI "https://github.com/belledonnecommunications/linphone-android/tree/master/app/src/main/java/org/linphone/ui"
  click NAV "https://github.com/belledonnecommunications/linphone-android/tree/master/app/src/main/res/navigation"
  click VM "https://github.com/belledonnecommunications/linphone-android/tree/master/app/src/main/java/org/linphone/ui/*/viewmodel"
  click CC "https://github.com/belledonnecommunications/linphone-android/blob/master/app/src/main/java/org/linphone/core/CoreContext.kt"
  click CPref "https://github.com/belledonnecommunications/linphone-android/blob/master/app/src/main/java/org/linphone/core/CorePreferences.kt"
  click CFT "https://github.com/belledonnecommunications/linphone-android/blob/master/app/src/main/java/org/linphone/core/CoreFileTransferService.kt"
  click CPS "https://github.com/belledonnecommunications/linphone-android/blob/master/app/src/main/java/org/linphone/core/CorePushService.kt"
  click CI "https://github.com/belledonnecommunications/linphone-android/blob/master/app/src/main/java/org/linphone/core/CoreInCallService.kt"
  click CKA "https://github.com/belledonnecommunications/linphone-android/blob/master/app/src/main/java/org/linphone/core/CoreKeepAliveThirdPartyAccountsService.kt"
  click CPR "https://github.com/belledonnecommunications/linphone-android/blob/master/app/src/main/java/org/linphone/core/CorePushReceiver.kt"
  click VFS "https://github.com/belledonnecommunications/linphone-android/blob/master/app/src/main/java/org/linphone/core/VFS.kt"
  click BR "https://github.com/belledonnecommunications/linphone-android/blob/master/app/src/main/java/org/linphone/core/BootReceiver.kt"
  click NSC "https://github.com/belledonnecommunications/linphone-android/blob/master/app/build.gradle.kts"
  click PLT1 "https://github.com/belledonnecommunications/linphone-android/blob/master/app/src/main/java/org/linphone/telecom/TelecomManager.kt"
  click PLT1 "https://github.com/belledonnecommunications/linphone-android/blob/master/app/src/main/java/org/linphone/telecom/TelecomCallControlCallback.kt"
  click AUTO "https://github.com/belledonnecommunications/linphone-android/blob/master/app/src/main/java/org/linphone/telecom/auto/AndroidAutoService.kt"
  click AUTO "https://github.com/belledonnecommunications/linphone-android/blob/master/app/src/main/java/org/linphone/telecom/auto/AndroidAutoSession.kt"
  click AUTO "https://github.com/belledonnecommunications/linphone-android/blob/master/app/src/main/java/org/linphone/telecom/auto/AndroidAutoScreen.kt"
  click PLT2 "https://github.com/belledonnecommunications/linphone-android/blob/master/app/src/main/java/org/linphone/notifications/NotificationsManager.kt"
  click PLT2 "https://github.com/belledonnecommunications/linphone-android/blob/master/app/src/main/java/org/linphone/notifications/NotificationBroadcastReceiver.kt"
  click FCM "https://github.com/belledonnecommunications/linphone-android/blob/master/app/google-services.json"

  classDef ui fill:#D0E8FF,stroke:#333,stroke-width:1px
  classDef vm fill:#D0FFD0,stroke:#333,stroke-width:1px
  classDef api fill:#FFE0B2,stroke:#333,stroke-width:1px
  classDef native fill:#FFCC80,stroke:#333,stroke-width:1px
  classDef platform fill:#E1BEE7,stroke:#333,stroke-width:1px
  classDef storage fill:#F0F0F0,stroke:#333,stroke-width:1px
  classDef external fill:#CFD8DC,stroke:#333,stroke-width:1px
```
