Realm is a mobile database that runs directly inside phones, tablets or wearables. This repository holds the source code for the Java version of Realm, which currently runs only on Android.
- Mobile-first: Realm is the first database built from the ground up to run directly inside phones, tablets and wearables.
- Simple: Data is directly exposed as objects and queryable by code, removing the need for ORM's riddled with performance & maintenance issues. Plus, we've worked hard to keep our API down to very few classes: most of our users pick it up intuitively, getting simple apps up & running in minutes.
- Modern: Realm supports easy thread-safety, relationships & encryption.
- Fast: Realm is faster than even raw SQLite on common operations, while maintaining an extremely rich feature set.
Please see the detailed instructions in our docs to add Realm to your project.
Documentation for Realm can be found at realm.io/docs/java. The API reference is located at realm.io/docs/java/api.
- Need help with your code?: Look for previous questions on the #realm tag — or ask a new question. We activtely monitor & answer questions on SO!
- Have a bug to report? Open an issue. If possible, include the version of Realm, a full log, the Realm file, and a project that shows the issue.
- Have a feature request? Open an issue. Tell us what the feature should do, and why you want the feature.
- Want to ask in-depth questions? Join our online office hours. We host these once a month, and you can join via chat, audio call, or video call.
- Sign up for our Community Newsletter to get regular tips, learn about other use-cases and get alerted of blogposts and tutorials about Realm.
If you want to test recent bugfixes or features that have not been packaged in an official release yet, you can use a -SNAPSHOT release of the current development version of Realm via Gradle, available on JFrog
repositories {
maven {
url 'http://oss.jfrog.org/artifactory/oss-snapshot-local'
}
}
dependencies {
compile 'io.realm:realm-android:0.83.0-SNAPSHOT'
}
In case you don't want to use the precompiled version, you can build Realm yourself from source.
Prerequisites:
-
Make sure
make
is available in your$PATH
-
Download & install the Android SDK, Android 4.4W (API 20) (for example through Android Studio’s Android SDK Manager)
-
Also download & install the Android SDK, Android 4.4.2 (API 19) (for example through Android Studio’s Android SDK Manager)
-
Download the Android NDK (= r10d). For example, on Mac OS you can do this with Homebrew with
brew install android-ndk
. -
Add a
local.properties
file at the root of this folder with the correct paths for the Android SDK and NDK, for example:sdk.dir=/Applications/Android Studio.app/sdk ndk.dir=/usr/local/Cellar/android-ndk/r10d
Once you have completed all the pre-requisites building Realm is done with a simple command
./gradlew androidJar
That command will generate the .jar file containing the Realm runtime and the annotation processor. You will find it in realm/build/libs.
./gradlew realm:javadocRelease
will generate the Javadocs./gradlew realm:connectedCheck
will run the tests on a connected Android device
Generating the Javadoc using the command above will report a failure (1 error, 30+ warnings). The Javadoc is generated, and we will fix
realm/build.gradle
in the near future.
See CONTRIBUTING.md for more details!
Realm Java is published under the Apache 2.0 license.
The underlying core is available under the Realm Core Binary License while we work to open-source it under the Apache 2.0 license.
If you use Realm and are happy with it, all we ask is that you please consider sending out a tweet mentioning @realm, announce your app on our mailing-list, or email [email protected] to let us know about it!
And if you don't like it, please let us know what you would like improved, so we can fix it!