Make the MongoDB docs better! We value your opinion. Share your feedback for a chance to win $100.
Click here >
Docs Menu

Atlas Device SDK para Java

Utiliza el SDK de Atlas Device para Java para desarrollar aplicaciones Android en Java o Kotlin. Para desarrollar aplicaciones multiplataforma usando Kotlin Multiplatform (KMP), consulta el SDK de Kotlin.

This SDK is in best-effort maintenance mode and no longer receives new development or non-critical bug fixes. To develop your app with new features, use the Kotlin SDK. You can use the Java SDK with the Kotlin SDK.

Obtén más información sobre cómo Migrar del SDK de Java al SDK de Kotlin.

Qué puedes hacer

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.

1

Use the Gradle build system to install the Java SDK in your project.

2

Use Java or Kotlin to idiomatically define an object schema.

3

La base de datos del SDK, Realm, almacena objetos en archivos en tu dispositivo. O bien, puedes abrir una base de datos en memoria, que no crea un archivo. Para comenzar a leer y escribir datos, configura y abre una base de datos.

4

Crear, leer, actualizar y borrar objetos de la base de datos. Utilice consultas nativas de Android para filtrar datos.

5

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.

Ilustración móvil del SDK del dispositivo Atlas
1

Configurar Sincronización de dispositivos en una aplicación de App Services. Define reglas de acceso a datos. Usa el modo de desarrollo para inferir tu esquema a partir de tu modelo de datos de Java o Kotlin.

Luego, conéctate al backend desde tu cliente.

2

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.

3

Configure and open a synced database. Subscribe to a query to determine what data the synced database can read and write.

4

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 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.

Ilustración de Device Sync

You can call serverless Functions from your client application that run in an App Services backend.

You can query data stored in MongoDB directly from your client application code.

Authenticate users with built-in and third-party authentication providers. Use the authenticated user to access App Services.

App Services Illustration
Documentación esencial
Icono de tutorial

Java Quick Start

Get started with the Java SDK.

Explora el Inicio rápido

Atlas Device SDK Icon

Java API Reference

Explore generated reference docs for the SDK's Java APIs.

Java API Reference

Atlas Device SDK Icon

Kotlin Extensions API Reference

Explore generated reference docs for the Kotlin Extensions APIs.

Kotlin Extensions Reference