A modern Android application for kDrive by Infomaniak.
Always have access to all your photos, videos and documents. kDrive can store up to 106 TB of data.
Collaborate online on Office documents, organise meetings, share your work. Anything is possible!
Protect your data in a sovereign cloud exclusively developed and hosted in Switzerland. Infomaniak doesn’t analyze or resell your data.
This project is under GPLv3 license. If you see a bug or an enhanceable point, feel free to create an issue, so that we can discuss about it, and once approved, we or you (depending on the priority of the bug/improvement) will take care of the issue and apply a merge request. Please, don't do a merge request before creating an issue.
The kDrive Android application follows a modular architecture designed for maintainability, testability, and scalability. The project is organized into multiple Gradle modules with clear separation of concerns.
android-kDrive/
├── app/ # Main application module
│ └── src/main/java/com/infomaniak/drive/
│ ├── data/ # Data layer (API, cache, models)
│ │ ├── api/ # API clients and endpoints (Ktor)
│ │ ├── cache/ # Realm database configuration
│ │ ├── models/ # Data models (File, Drive, User, etc.)
│ │ ├── sync/ # Background synchronization
│ │ └── services/ # Background services
│ ├── ui/ # Presentation layer (MVVM)
│ │ ├── fileList/ # File browsing and management
│ │ ├── menu/ # Navigation drawer menus
│ │ ├── login/ # Authentication flows
│ │ ├── home/ # Home screen
│ │ └── ...
│ ├── di/ # Dependency injection (Hilt)
│ ├── utils/ # Utility classes
│ └── extensions/ # Kotlin extensions
│
└── Core/ # Infomaniak Core libraries (composite build)
├── Legacy/ # Legacy core module
├── Legacy/AppLock/ # App lock functionality
└── Legacy/BugTracker/ # Bug tracking integration
The app follows the MVVM (Model-View-ViewModel) architecture pattern:
- Model: Data classes and repositories handling data operations
- View: Activities, Fragments, and Composables observing ViewModel state
- ViewModel: Business logic and state management using LiveData/StateFlow
UI Layer (Activities/Fragments/Composables)
↕
ViewModel Layer (StateFlow/LiveData)
↕
Repository Layer (Data operations)
↕
Data Layer (API/Local Storage)
├── API (OkHTTP client)
├── Realm (Offline data)
└── Room (Auth tokens)
- Kotlin - Primary language (100%)
- XML - Legacy UI layouts (migrating to Compose)
- XML Layouts - Legacy views
- Jetpack Compose - Modern declarative UI for new components
- Material Design 3 - UI components and theming
- Hilt - Dependency injection
- Navigation Component - In-app navigation with Safe Args
- ViewModel - UI-related data management
- WorkManager - Background work scheduling
- Ktor Client - HTTP client for API communication
- Realm - NoSQL database for offline file data
- Room - SQL database for authentication tokens
- SharedPreference - Key-value storage for preferences
- Gradle Kotlin DSL - Build configuration
- Version Catalogs - Centralized dependency management
- Composite Builds - Core libraries as included builds
The project supports multiple build flavors for different distribution channels:
| Flavor | Description | Features |
|---|---|---|
| standard | Google Play Store version | Firebase Cloud Messaging, Google Play Services |
| fdroid | F-Droid version | No proprietary dependencies, fully open source |
| preprod | Pre-production testing | Points to staging API servers |
- Minimum SDK: Android 8.1 (API 27 - Oreo)
- Target SDK: Latest stable Android version
- Recommended: Android 10+ (API 29+) for best experience
We use Realm on both platforms (iOS and Android) to store offline data including files, shares, app and user preferences (in separate database instances).
Android Room is used to store API access tokens and basic user data securely.
The sync mechanism ensures data consistency between the local cache and the server using background workers.
| Permission | API Level | Usage |
|---|---|---|
INTERNET |
All | Network access for API calls and file operations |
READ_EXTERNAL_STORAGE |
≤32 | Access files on device for upload (legacy) |
WRITE_EXTERNAL_STORAGE |
≤32 | Download files to device (legacy) |
ACCESS_MEDIA_LOCATION |
29+ | Access location metadata in media files |
READ_MEDIA_IMAGES |
33+ | Access photos for upload (Android 13+) |
READ_MEDIA_VIDEO |
33+ | Access videos for upload (Android 13+) |
READ_MEDIA_VISUAL_USER_SELECTED |
34+ | Access user-selected photos/videos (Android 14+) |
FOREGROUND_SERVICE |
All | Background file sync and download |
FOREGROUND_SERVICE_DATA_SYNC |
34+ | Foreground service for data synchronization |
RECEIVE_BOOT_COMPLETED |
All | Restart sync service after device reboot |
REQUEST_IGNORE_BATTERY_OPTIMIZATIONS |
All | Allow background file downloads |
REQUEST_INSTALL_PACKAGES |
All | Install APK files from kDrive |
CAMERA |
All | Document scanning (optional, ChromeBook compatible) |
WAKE_LOCK |
All | Keep screen on during video playback |
Note: Storage permissions have been updated for Android 13+ (API 33+) with granular media permissions (READ_MEDIA_*)
replacing the broad storage access.
In order to test the app with Unit and UI tests, you have to copy Env-Example class in AndroidTest package and name it Env.
Replace values contained in file by yours and launch the tests 👍

