Multiple clouds, one Kotlin Multiplatform bridge. Supporting Android, iOS, web and desktop (JVM).
Warning
This library is not yet stable. The API will change and docs may be outdated.
- ⚡ Unified: One library to access Dropbox, Google Drive and OneDrive.
- 🪶 Lightweight: No need to integrate different SDKs for different platforms (see Underlying dependencies).
- 📱 Cross-platform: Supports Android, iOS, web and desktop (JVM).
- 👥 Multi-user: Some official SDKs allow only one user, CloudBridge has no limit.
- 💥 Unified error handling: No different error codes to handle, but unified, typed errors.
Limited access scopes by using app folders are preferred by the library wherever possible. Furthermore, the library works with app folders, prefers IDs to paths and is strongly typed where possible.
See https://jacobras.github.io/CloudBridge/Vision for details.
| Mobile (Android) |
Mobile (iOS) |
Desktop (JVM) |
Web (JS/WASM) |
|
|---|---|---|---|---|
| Dropbox | ✅ | ✅ | ✅ | ✅ |
| Google Drive | ✅ | ✅ | ✅ | ✅ |
| Microsoft OneDrive | ✅ | ✅ | ✅ | ✅ |
✅ = Supported.
See specific service docs for important remarks about each service.
The library is published to Maven Central.
dependencies {
implementation("nl.jacobras:cloudbridge:0.7.0")
}The main entry point is CloudBridge.dropbox(), CloudBridge.googleDrive() or
CloudBridge.oneDrive().
Here's an example with Dropbox.
// 1: Instantiate a service
val service = CloudBridge.dropbox()
// 2: Authenticate (platform- and service-specific, see docs)
service.authenticate("clientId", "example://redirect-uri")
// 3: Ready for use!
service.listFiles("/".asFolderPath())- See https://jacobras.github.io/CloudBridge/services/Overview/ on how to authenticate each service on every platform.
- See https://jacobras.github.io/CloudBridge/api/Overview/ for all available operations.
All service APIs were written from scratch to avoid dependencies on SDKs.
This library uses:
- Ktor and Ktorfit for network requests.
- Coroutines for concurrency.
- KotlinCrypto hash for SHA256 hashing.
- urlencoder for URL encoding.
Only on Android:
- multiplatform-settings to temporarily persist the OAuth code verifier (Dropbox & OneDrive).
- Google Identity Services
(
play-services-auth) for Google Drive authorization.
