Atlas Device SDK for Kotlin
Use the Atlas Device SDK for Kotlin to develop Android or iOS apps using the Android platform or Kotlin Multiplatform (KMP).
Get Started with the Kotlin SDK
Inicio rápido
Minimal-explanation code examples of how to work with the SDK. Write to the device database, and sync with other devices.
Working Example App
Aprenda del ejemplo diseccionando una aplicación cliente Kotlin funcional que utiliza el Kotlin SDK.
Tutorial guiado
Sigue un tutorial guiado para aprender a adaptar la aplicación de ejemplo y así crear tu propia aplicación funcional.
Desarrollar aplicaciones con el SDK
Use the SDK's open-source database - Realm - as an object store on the device. Use Device Sync to keep data in sync with your MongoDB Atlas cluster and other clients.
Instalar el SDK de Kotlin
Choose whether to install the Android or the Kotlin Multiplatform version of the Kotlin SDK.
Importa el SDK a tus archivos Gradle para comenzar.
Define an Object Schema
Use Kotlin to idiomatically define an object schema.
Open a Database
The SDK's database - Realm - stores objects in files on your device. Or you can open an in-memory database which does not create a file. Configure and open a database to get started reading and writing data.
Lectura y escritura de datos
Crear, leer, actualizar y eliminar objetos en la base de datos. Filtrar datos con el lenguaje de consulta Realm.
React to Changes
Los objetos activos significan que sus datos siempre están actualizados. Puedes registrar un controlador de notificaciones para observar los cambios y realizar alguna lógica, como actualizar el Interfaz de Usuario.
_Spot.webp)
Connect to an Atlas App Services App
Configure Device Sync in an App Services App. Define data access rules. Use Development Mode to infer your schema from your data model.
Luego, conéctate al backend desde tu cliente.
Authenticate a User
Use one of our authentication providers to authenticate a user. App Services provides access to popular authentication providers, such as Apple, Google, or Facebook. Use our built-in email/password provider to manage users without a third-party, or use custom JWT authentication to integrate with other authentication providers. Anonymous authentication provides access without requiring a login or persisting user data.
Abrir una base de datos sincronizada
Configurar y abrir una base de datos sincronizada. Suscribirse a una consulta para determinar qué datos puede leer y escribir la base de datos sincronizada.
Leer y guardar datos sincronizados
The APIs to read and write data are the same whether you're using a synced or non-synced database. Data that you read and write to the device is automatically kept in sync with your Atlas cluster and other clients. Apps keep working offline and deterministically sync changes whenever a network connection is available.
_Spot.webp)
Call Serverless Functions
You can call serverless Functions from your client application that run in an App Services backend.
Authenticate Users
Autentica a los usuarios con proveedores de autenticación integrados y de terceros. Usa el usuario autenticado para acceder a App Services.

Lectura Recomendada
Kotlin API Reference
Consulta los docs de referencia generados para las API de Kotlin del SDK.
Migrate from the Java SDK to the Kotlin SDK
Learn why and how to switch from the Java SDK to the Kotlin SDK.
Example Projects
Explore engineering and expert-provided example projects to learn best practices and common development patterns using the Kotlin SDK. Check out the Example Projects page for more Kotlin sample apps.
Offline Login and Database Access
Log in a Device Sync user and open a synced database offline.
Connection State Change & Error Handling
Conozca las mejores prácticas sobre el manejo de errores de sincronización y estrategias de restablecimiento de clientes.