Docs Menu

Install Realm - Java SDK

On this page

  • Overview
  • Prerequisites
  • Installation
  • Project Gradle Configuration
  • Application Module Gradle Configuration
  • Enable Realm Sync
  • Supported Platforms

This page details how to install Realm in your project and get started.

  • Android Studio version 1.5.1 or higher.
  • Java Development Kit (JDK) 11 or higher.
  • An emulated or hardware Android device for testing.
  • Android API Level 16 or higher (Android 4.1 and above).

MongoDB Realm only supports the Gradle build system. Follow these steps to add the MongoDB Realm Java SDK to your project.


Because MongoDB Realm provides a ProGuard configuration as part of the MongoDB Realm library, you do not need to add any MongoDB Realm-specific rules to your ProGuard configuration.

To add local-only Realm Database to your application, make the following changes to your project-level Gradle build file, typically found at <project>/build.gradle:

Then, make the following changes to your application-level Gradle build file, typically found at <project>/app/build.gradle:

After updating the build.gradle files, resolve the dependencies by clicking File > Sync Project with Gradle Files.

To use Realm Sync in your application, create a realm block in your application module build.gradle. Within this block, set syncEnabled to true.

realm {
syncEnabled = true

MongoDB Realm's Java SDK enables you to build apps for the following platforms:

  • Android
  • Wear OS
  • Android Automotive OS
  • Android TV
  • Android Things
←  MongoDB Realm Java SDKQuick Start - Java SDK →
Give Feedback
© 2022 MongoDB, Inc.


  • Careers
  • Investor Relations
  • Legal Notices
  • Privacy Notices
  • Security Information
  • Trust Center
© 2022 MongoDB, Inc.