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.
See full instructions in our docs.
Documentation for Realm can be found at realm.io/docs/java. The API reference is located at realm.io/docs/java/api.
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 (>= r9d). 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/r9d
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 generateReleaseJavadoc
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.
Whether you find a bug, typo or an API call that could be clarified, please file an issue on our GitHub repository.
When filing an issue, please provide as much of the following information as possible in order to help others fix it:
- Goals
- Expected results
- Actual results
- Steps to reproduce
- Code sample that highlights the issue (link to full Android Studio projects that we can compile ourselves are ideal)
- Version of Realm/Android Studio/OS
If you'd like to send us sensitive sample code to help troubleshoot your issue, you can email help@realm.io directly.
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 info@realm.io 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!