# simplemobiletools/simple-contacts architecture

> Architecture diagram of the GitHub repository simplemobiletools/simple-contacts, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-07-16). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/simplemobiletools/simple-contacts
- Repository: https://github.com/simplemobiletools/simple-contacts

## Overview

#### Purpose and Runtime
Simple Contacts is a native Android/Kotlin contact-management app. It manages device or synchronized contacts, groups, favorites, contact fields, calls/messages, duplicate merging, and vCard import/export without a backend service. The Gradle Android app module is `app/build.gradle.kts`; application metadata and Android component registration begin at `app/src/main/AndroidManifest.xml`.

#### Startup and Navigation
`App.kt` initializes application-level behavior. Android launches through the manifest into the activity flow, with `SplashActivity.kt` acting as startup routing and `MainActivity.kt` as the primary host UI. `MainActivity` presents the main contact experience, while `SettingsActivity.kt` owns user-configurable behavior and appearance.
- `app/src/main/kotlin/com/simplemobiletools/contacts/pro/App.kt`
- `app/src/main/kotlin/com/simplemobiletools/contacts/pro/activities/SplashActivity.kt`
- `app/src/main/kotlin/com/simplemobiletools/contacts/pro/activities/MainActivity.kt`

#### Contact UI and Interaction Stages
The main UI is tab/fragment-oriented: contacts, favorites, and groups are separate screens coordinated through a pager. Recycler adapters render/filter selectable contact and group lists. Selecting a contact routes into view, edit, or action behavior according to preferences.
- `app/src/main/kotlin/com/simplemobiletools/contacts/pro/fragments/ContactsFragment.kt`
- `app/src/main/kotlin/com/simplemobiletools/contacts/pro/fragments/FavoritesFragment.kt`
- `app/src/main/kotlin/com/simplemobiletools/contacts/pro/fragments/GroupsFragment.kt`

#### Contact and Group Mutation Boundaries
Dedicated activities handle viewing, creating/editing, and group membership workflows. These are the principal UI boundary around Android’s contacts data and contact actions such as calling or texting. Dialogs provide constrained operations such as selecting contacts/groups, source filtering, sorting, and visible-field management.
- `app/src/main/kotlin/com/simplemobiletools/contacts/pro/activities/ViewContactActivity.kt`
- `app/src/main/kotlin/com/simplemobiletools/contacts/pro/activities/EditContactActivity.kt`
- `app/src/main/kotlin/com/simplemobiletools/contacts/pro/activities/GroupContactsActivity.kt`

#### Data Sharing and External Integration
The app integrates with Android’s contact ecosystem and exposes its own content-provider boundary through `MyContactsContentProvider`. Android intents provide phone/SMS and file-selection interactions; no remote API or server-side runtime is represented. Provider file exposure is constrained by Android XML paths.
- `app/src/main/kotlin/com/simplemobiletools/contacts/pro/contentproviders/MyContactsContentProvider.kt`
- `app/src/main/res/xml/provider_paths.xml`
- `app/src/main/AndroidManifest.xml`

#### Import, Export, and Backup Flow
vCard import/export is a discrete persistence interchange flow: UI dialogs choose the operation and file, `VcfImporter`/`VcfExporter` translate contact records, and Android storage/content URIs form the external boundary. Automated backup is scheduled/triggered by broadcast receivers, including device boot recovery.
- `app/src/main/kotlin/com/simplemobiletools/contacts/pro/helpers/VcfImporter.kt`
- `app/src/main/kotlin/com/simplemobiletools/contacts/pro/helpers/VcfExporter.kt`
- `app/src/main/kotlin/com/simplemobiletools/contacts/pro/receivers/AutomaticBackupReceiver.kt`

#### Configuration and Distribution
`Config.kt` centralizes persisted app behavior such as sorting, visible tabs/fields, display options, and click behavior, consumed across activities/fragments. Product variants include F-Droid and prepaid resources. Gradle is the build runtime; Fastlane holds store metadata/release automation.
- `app/src/main/kotlin/com/simplemobiletools/contacts/pro/helpers/Config.kt`
- `app/src/fdroid/res/values/bools.xml`
- `app/src/prepaid/res/values/bools.xml`

Main entry points: [`app/src/main/AndroidManifest.xml`](https://github.com/simplemobiletools/simple-contacts/blob/master/app/src/main/AndroidManifest.xml) (Android manifest), [`app/src/main/kotlin/com/simplemobiletools/contacts/pro/activities/MainActivity.kt`](https://github.com/simplemobiletools/simple-contacts/blob/master/app/src/main/kotlin/com/simplemobiletools/contacts/pro/activities/MainActivity.kt) (Main contact host), [`app/build.gradle.kts`](https://github.com/simplemobiletools/simple-contacts/blob/master/app/build.gradle.kts) (Android app module), [`app/src/main/kotlin/com/simplemobiletools/contacts/pro/fragments/ContactsFragment.kt`](https://github.com/simplemobiletools/simple-contacts/blob/master/app/src/main/kotlin/com/simplemobiletools/contacts/pro/fragments/ContactsFragment.kt) (Contacts tab)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Android runtime"]
  node_manifest["Android manifest<br/>component registry"]
  node_app["Application setup<br/>Kotlin application<br/>[App.kt]"]
  node_splash["Startup router<br/>activity<br/>[SplashActivity.kt]"]
end

subgraph group_ui["Contact UI"]
  node_main["Main contact host<br/>activity<br/>[MainActivity.kt]"]
  node_contacts["Contacts tab<br/>fragment"]
  node_favorites["Favorites tab<br/>fragment"]
  node_groups["Groups tab<br/>fragment<br/>[GroupsFragment.kt]"]
  node_view_contact["Contact details<br/>activity"]
  node_edit_contact["Contact editor<br/>activity"]
  node_group_membership["Group membership<br/>activity"]
  node_config[("User preferences<br/>persisted config<br/>[Config.kt]")]
end

subgraph group_integration["Data &amp; integration"]
  node_contacts_provider{{"App contacts provider<br/>content provider"}}
  node_android_contacts[("Android contacts ecosystem<br/>platform contacts data")]
  node_android_intents{{"Phone, SMS &amp; file intents<br/>Android integration"}}
  node_vcf_import["vCard importer<br/>contact translator<br/>[VcfImporter.kt]"]
  node_vcf_export["vCard exporter<br/>contact translator<br/>[VcfExporter.kt]"]
  node_storage[("Storage content URIs<br/>Android storage")]
  node_backup_receiver["Automatic backup<br/>broadcast receiver"]
  node_provider_paths["Provider file paths<br/>Android XML policy<br/>[provider_paths.xml]"]
end

subgraph group_delivery["Build variants"]
  node_gradle["Android app module<br/>Gradle build<br/>[build.gradle.kts]"]
  node_fdroid_variant["F-Droid resources<br/>product variant<br/>[bools.xml]"]
  node_prepaid_variant["Prepaid resources<br/>product variant<br/>[bools.xml]"]
end

node_gradle -->|"builds"| node_manifest
node_gradle -.->|"selects"| node_fdroid_variant
node_gradle -.->|"selects"| node_prepaid_variant
node_manifest -->|"initializes"| node_app
node_manifest -->|"launches"| node_splash
node_manifest -->|"registers"| node_contacts_provider
node_manifest -->|"registers"| node_backup_receiver
node_splash -->|"routes to"| node_main
node_main -->|"hosts"| node_contacts
node_main -->|"hosts"| node_favorites
node_main -->|"hosts"| node_groups
node_main -.->|"reads"| node_config
node_contacts -->|"opens"| node_view_contact
node_contacts -->|"creates or edits"| node_edit_contact
node_groups -->|"manages"| node_group_membership
node_view_contact -->|"calls or texts"| node_android_intents
node_edit_contact -->|"updates contacts"| node_android_contacts
node_group_membership -->|"updates membership"| node_android_contacts
node_contacts_provider -->|"shares contacts"| node_android_contacts
node_provider_paths -.->|"constrains file access"| node_contacts_provider
node_android_intents -->|"selects import file"| node_vcf_import
node_vcf_import -->|"creates records"| node_android_contacts
node_vcf_export -->|"writes vCard"| node_storage
node_android_contacts -->|"exports records"| node_vcf_export
node_backup_receiver -->|"triggers backup"| node_vcf_export

click node_gradle "https://github.com/simplemobiletools/simple-contacts/blob/master/app/build.gradle.kts"
click node_manifest "https://github.com/simplemobiletools/simple-contacts/blob/master/app/src/main/AndroidManifest.xml"
click node_app "https://github.com/simplemobiletools/simple-contacts/blob/master/app/src/main/kotlin/com/simplemobiletools/contacts/pro/App.kt"
click node_splash "https://github.com/simplemobiletools/simple-contacts/blob/master/app/src/main/kotlin/com/simplemobiletools/contacts/pro/activities/SplashActivity.kt"
click node_main "https://github.com/simplemobiletools/simple-contacts/blob/master/app/src/main/kotlin/com/simplemobiletools/contacts/pro/activities/MainActivity.kt"
click node_contacts "https://github.com/simplemobiletools/simple-contacts/blob/master/app/src/main/kotlin/com/simplemobiletools/contacts/pro/fragments/ContactsFragment.kt"
click node_favorites "https://github.com/simplemobiletools/simple-contacts/blob/master/app/src/main/kotlin/com/simplemobiletools/contacts/pro/fragments/FavoritesFragment.kt"
click node_groups "https://github.com/simplemobiletools/simple-contacts/blob/master/app/src/main/kotlin/com/simplemobiletools/contacts/pro/fragments/GroupsFragment.kt"
click node_view_contact "https://github.com/simplemobiletools/simple-contacts/blob/master/app/src/main/kotlin/com/simplemobiletools/contacts/pro/activities/ViewContactActivity.kt"
click node_edit_contact "https://github.com/simplemobiletools/simple-contacts/blob/master/app/src/main/kotlin/com/simplemobiletools/contacts/pro/activities/EditContactActivity.kt"
click node_group_membership "https://github.com/simplemobiletools/simple-contacts/blob/master/app/src/main/kotlin/com/simplemobiletools/contacts/pro/activities/GroupContactsActivity.kt"
click node_config "https://github.com/simplemobiletools/simple-contacts/blob/master/app/src/main/kotlin/com/simplemobiletools/contacts/pro/helpers/Config.kt"
click node_contacts_provider "https://github.com/simplemobiletools/simple-contacts/blob/master/app/src/main/kotlin/com/simplemobiletools/contacts/pro/contentproviders/MyContactsContentProvider.kt"
click node_vcf_import "https://github.com/simplemobiletools/simple-contacts/blob/master/app/src/main/kotlin/com/simplemobiletools/contacts/pro/helpers/VcfImporter.kt"
click node_vcf_export "https://github.com/simplemobiletools/simple-contacts/blob/master/app/src/main/kotlin/com/simplemobiletools/contacts/pro/helpers/VcfExporter.kt"
click node_backup_receiver "https://github.com/simplemobiletools/simple-contacts/blob/master/app/src/main/kotlin/com/simplemobiletools/contacts/pro/receivers/AutomaticBackupReceiver.kt"
click node_provider_paths "https://github.com/simplemobiletools/simple-contacts/blob/master/app/src/main/res/xml/provider_paths.xml"
click node_fdroid_variant "https://github.com/simplemobiletools/simple-contacts/blob/master/app/src/fdroid/res/values/bools.xml"
click node_prepaid_variant "https://github.com/simplemobiletools/simple-contacts/blob/master/app/src/prepaid/res/values/bools.xml"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_manifest,node_app,node_splash toneBlue
class node_main,node_contacts,node_favorites,node_groups,node_view_contact,node_edit_contact,node_group_membership,node_config toneAmber
class node_contacts_provider,node_android_contacts,node_android_intents,node_vcf_import,node_vcf_export,node_storage,node_backup_receiver,node_provider_paths toneMint
class node_gradle,node_fdroid_variant,node_prepaid_variant toneRose
```

## Components

### Android runtime

- [Android manifest](https://github.com/simplemobiletools/simple-contacts/blob/master/app/src/main/AndroidManifest.xml): component registry · Registers app components and provider exposure. · `app/src/main/AndroidManifest.xml`
- [Application setup](https://github.com/simplemobiletools/simple-contacts/blob/master/app/src/main/kotlin/com/simplemobiletools/contacts/pro/App.kt): Kotlin application · `app/src/main/kotlin/com/simplemobiletools/contacts/pro/App.kt`
- [Startup router](https://github.com/simplemobiletools/simple-contacts/blob/master/app/src/main/kotlin/com/simplemobiletools/contacts/pro/activities/SplashActivity.kt): activity · `app/src/main/kotlin/com/simplemobiletools/contacts/pro/activities/SplashActivity.kt`

### Contact UI

- [Main contact host](https://github.com/simplemobiletools/simple-contacts/blob/master/app/src/main/kotlin/com/simplemobiletools/contacts/pro/activities/MainActivity.kt): activity · `app/src/main/kotlin/com/simplemobiletools/contacts/pro/activities/MainActivity.kt`
- [Contacts tab](https://github.com/simplemobiletools/simple-contacts/blob/master/app/src/main/kotlin/com/simplemobiletools/contacts/pro/fragments/ContactsFragment.kt): fragment · `app/src/main/kotlin/com/simplemobiletools/contacts/pro/fragments/ContactsFragment.kt`
- [Favorites tab](https://github.com/simplemobiletools/simple-contacts/blob/master/app/src/main/kotlin/com/simplemobiletools/contacts/pro/fragments/FavoritesFragment.kt): fragment · `app/src/main/kotlin/com/simplemobiletools/contacts/pro/fragments/FavoritesFragment.kt`
- [Groups tab](https://github.com/simplemobiletools/simple-contacts/blob/master/app/src/main/kotlin/com/simplemobiletools/contacts/pro/fragments/GroupsFragment.kt): fragment · `app/src/main/kotlin/com/simplemobiletools/contacts/pro/fragments/GroupsFragment.kt`
- [Contact details](https://github.com/simplemobiletools/simple-contacts/blob/master/app/src/main/kotlin/com/simplemobiletools/contacts/pro/activities/ViewContactActivity.kt): activity · `app/src/main/kotlin/com/simplemobiletools/contacts/pro/activities/ViewContactActivity.kt`
- [Contact editor](https://github.com/simplemobiletools/simple-contacts/blob/master/app/src/main/kotlin/com/simplemobiletools/contacts/pro/activities/EditContactActivity.kt): activity · `app/src/main/kotlin/com/simplemobiletools/contacts/pro/activities/EditContactActivity.kt`
- [Group membership](https://github.com/simplemobiletools/simple-contacts/blob/master/app/src/main/kotlin/com/simplemobiletools/contacts/pro/activities/GroupContactsActivity.kt): activity · `app/src/main/kotlin/com/simplemobiletools/contacts/pro/activities/GroupContactsActivity.kt`
- [User preferences](https://github.com/simplemobiletools/simple-contacts/blob/master/app/src/main/kotlin/com/simplemobiletools/contacts/pro/helpers/Config.kt): persisted config · Controls sorting, tabs, fields, display, and click behavior. · `app/src/main/kotlin/com/simplemobiletools/contacts/pro/helpers/Config.kt`

### Data & integration

- [App contacts provider](https://github.com/simplemobiletools/simple-contacts/blob/master/app/src/main/kotlin/com/simplemobiletools/contacts/pro/contentproviders/MyContactsContentProvider.kt): content provider · Exposes the app's contact-sharing boundary. · `app/src/main/kotlin/com/simplemobiletools/contacts/pro/contentproviders/MyContactsContentProvider.kt`
- **Android contacts ecosystem**: platform contacts data
- **Phone, SMS & file intents**: Android integration
- [vCard importer](https://github.com/simplemobiletools/simple-contacts/blob/master/app/src/main/kotlin/com/simplemobiletools/contacts/pro/helpers/VcfImporter.kt): contact translator · `app/src/main/kotlin/com/simplemobiletools/contacts/pro/helpers/VcfImporter.kt`
- [vCard exporter](https://github.com/simplemobiletools/simple-contacts/blob/master/app/src/main/kotlin/com/simplemobiletools/contacts/pro/helpers/VcfExporter.kt): contact translator · `app/src/main/kotlin/com/simplemobiletools/contacts/pro/helpers/VcfExporter.kt`
- **Storage content URIs**: Android storage
- [Automatic backup](https://github.com/simplemobiletools/simple-contacts/blob/master/app/src/main/kotlin/com/simplemobiletools/contacts/pro/receivers/AutomaticBackupReceiver.kt): broadcast receiver · Runs scheduled backups and recovers scheduling after boot. · `app/src/main/kotlin/com/simplemobiletools/contacts/pro/receivers/AutomaticBackupReceiver.kt`
- [Provider file paths](https://github.com/simplemobiletools/simple-contacts/blob/master/app/src/main/res/xml/provider_paths.xml): Android XML policy · `app/src/main/res/xml/provider_paths.xml`

### Build variants

- [Android app module](https://github.com/simplemobiletools/simple-contacts/blob/master/app/build.gradle.kts): Gradle build · `app/build.gradle.kts`
- [F-Droid resources](https://github.com/simplemobiletools/simple-contacts/blob/master/app/src/fdroid/res/values/bools.xml): product variant · `app/src/fdroid/res/values/bools.xml`
- [Prepaid resources](https://github.com/simplemobiletools/simple-contacts/blob/master/app/src/prepaid/res/values/bools.xml): product variant · `app/src/prepaid/res/values/bools.xml`

## Connections

- Android app module → Android manifest: builds
- Android app module → F-Droid resources: selects
- Android app module → Prepaid resources: selects
- Android manifest → Application setup: initializes
- Android manifest → Startup router: launches
- Android manifest → App contacts provider: registers
- Android manifest → Automatic backup: registers
- Startup router → Main contact host: routes to
- Main contact host → Contacts tab: hosts
- Main contact host → Favorites tab: hosts
- Main contact host → Groups tab: hosts
- Main contact host → User preferences: reads
- Contacts tab → Contact details: opens
- Contacts tab → Contact editor: creates or edits
- Groups tab → Group membership: manages
- Contact details → Phone, SMS & file intents: calls or texts
- Contact editor → Android contacts ecosystem: updates contacts
- Group membership → Android contacts ecosystem: updates membership
- App contacts provider → Android contacts ecosystem: shares contacts
- Provider file paths → App contacts provider: constrains file access
- Phone, SMS & file intents → vCard importer: selects import file
- vCard importer → Android contacts ecosystem: creates records
- vCard exporter → Storage content URIs: writes vCard
- Android contacts ecosystem → vCard exporter: exports records
- Automatic backup → vCard exporter: triggers backup
