Docs Menu

Docs HomeRealm

Install Realm - Java SDK

On this page

  • Overview
  • Prerequisites
  • Installation
  • Project Gradle Configuration
  • Application Module Gradle Configuration
  • Enable Atlas Device 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).

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

Note

ProGuard

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

To add local-only Realm 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 Atlas Device Sync in your application, create a realm block in your application module build.gradle. Within this block, set syncEnabled to true.

realm {
syncEnabled = true
}

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

  • Android

  • Wear OS

  • Android Automotive OS

  • Android TV

  • Android Things

←  Realm - Java SDKQuick Starts - Java SDK →
Share Feedback
© 2023 MongoDB, Inc.

About

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