Install Realm - Java SDK
On this page
Overview
This page details how to install Realm in your project and get started.
Prerequisites
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).
Installation
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.
Project Gradle 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
:
Application Module Gradle Configuration
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.
Enable Atlas Device Sync
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 }
Supported Platforms
Realm's Java SDK enables you to build apps for the following platforms:
Android
Wear OS
Android Automotive OS
Android TV
Android Things