[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-4075":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":16,"subscribersCount":16,"size":16,"stars1d":16,"stars7d":16,"stars30d":17,"stars90d":16,"forks30d":16,"starsTrendScore":16,"compositeScore":18,"rankGlobal":10,"rankLanguage":10,"license":19,"archived":20,"fork":20,"defaultBranch":21,"hasWiki":22,"hasPages":20,"topics":23,"createdAt":10,"pushedAt":10,"updatedAt":31,"readmeContent":32,"aiSummary":33,"trendingCount":16,"starSnapshotCount":16,"syncStatus":34,"lastSyncTime":35,"discoverSource":36},4075,"realm-java","realm\u002Frealm-java","realm","Realm is a mobile database: a replacement for SQLite & ORMs","http:\u002F\u002Frealm.io",null,"Java",11465,1748,338,361,0,1,44.73,"Apache License 2.0",false,"main",true,[24,25,26,27,28,29,30],"android","database","java","mobile","mobile-database","nosql-database","realtime-database","2026-06-12 02:00:58","> [!WARNING]\n> We announced the deprecation of Atlas Device Sync + Realm SDKs in September 2024. For more information please see:\n> - [SDK Deprecation](https:\u002F\u002Fwww.mongodb.com\u002Fdocs\u002Fatlas\u002Fdevice-sdks\u002Fdeprecation\u002F)\n> - [Device Sync Deprecation](https:\u002F\u002Fwww.mongodb.com\u002Fdocs\u002Fatlas\u002Fapp-services\u002Fsync\u002Fdevice-sync-deprecation\u002F)\n>\n\n\u003Cpicture>\n    \u003Csource srcset=\".\u002Fmedia\u002Flogo-dark.svg\" media=\"(prefers-color-scheme: dark)\" alt=\"realm\">\n    \u003Cimg src=\".\u002Fmedia\u002Flogo.svg\" alt=\"realm\">\n\u003C\u002Fpicture>\n\n[![Maven Central](https:\u002F\u002Fimg.shields.io\u002Fmaven-central\u002Fv\u002Fio.realm\u002Frealm-gradle-plugin?colorB=4dc427&label=Maven%20Central)](https:\u002F\u002Fsearch.maven.org\u002Fartifact\u002Fio.realm\u002Frealm-gradle-plugin)\n[![License](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FLicense-Apache-blue.svg)](https:\u002F\u002Fgithub.com\u002Frealm\u002Frealm-java\u002Fblob\u002Fmaster\u002FLICENSE)\n\nRealm is a mobile database that runs directly inside phones, tablets or wearables.\nThis repository holds the source code for the Java version of Realm, which currently runs only on Android.\n\n## Realm Kotlin\n\nThe [Realm Kotlin SDK](https:\u002F\u002Fgithub.com\u002Frealm\u002Frealm-kotlin) is now GA and can be used for both Android and Kotlin Multiplatform. While we are still adding features, please consider using Realm Kotlin for any new project, and let us know if you miss anything there!\n\n## Features\n\n* **Mobile-first:** Realm is the first database built from the ground up to run directly inside phones, tablets, and wearables.\n* **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](https:\u002F\u002Fwww.mongodb.com\u002Fdocs\u002Fatlas\u002Fdevice-sdks\u002Fsdk\u002Fjava\u002F): most of our users pick it up intuitively, getting simple apps up & running in minutes.\n* **Modern:** Realm supports easy thread-safety, relationships & encryption.\n* **Fast:** Realm is faster than even raw SQLite on common operations while maintaining an extremely rich feature set.\n* **[Device Sync](https:\u002F\u002Fwww.mongodb.com\u002Fatlas\u002Fapp-services\u002Fdevice-sync)**: Makes it simple to keep data in sync across users, devices, and your backend in real-time. Get started for free with [a template application](https:\u002F\u002Fgithub.com\u002Fmongodb\u002Ftemplate-app-react-native-todo) and [create the cloud backend](http:\u002F\u002Fmongodb.com\u002Frealm\u002Fregister?utm_medium=github_atlas_CTA&utm_source=realm_js_github).\n\n## Getting Started\n\nPlease see the [Quick Start](docs\u002Fguides\u002Fquick-start-local.md) to add Realm to your project.\n\n## Documentation\n\nDocumentation for Realm can be found in the [docs\u002F](docs\u002FREADME.md) directory.\n\nThe Javadoc and Kotlin Extensions API Reference docs can be generated\nfrom source.\n\n## Getting Help\n\n- **Got a question?**: Look for previous questions on the [#realm tag](https:\u002F\u002Fstackoverflow.com\u002Fquestions\u002Ftagged\u002Frealm?sort=newest) — or [ask a new question](http:\u002F\u002Fstackoverflow.com\u002Fquestions\u002Fask?tags=realm). We actively monitor & answer questions on StackOverflow! You can also check out our [Community Forum](https:\u002F\u002Fdeveloper.mongodb.com\u002Fcommunity\u002Fforums\u002Ftags\u002Fc\u002Frealm\u002F9\u002Frealm-sdk) where general questions about how to do something can be discussed.\n- **Think you found a bug?** [Open an issue](https:\u002F\u002Fgithub.com\u002Frealm\u002Frealm-java\u002Fissues\u002Fnew?template=bug_report.md). If possible, include the version of Realm, a full log, the Realm file, and a project that shows the issue.\n- **Have a feature request?** [Open an issue](https:\u002F\u002Fgithub.com\u002Frealm\u002Frealm-java\u002Fissues\u002Fnew?template=feature_request.md). Tell us what the feature should do, and why you want the feature.\n\n## Using Snapshots\n\nIf 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 [Sonatype OSS](https:\u002F\u002Foss.sonatype.org\u002F#nexus-search;quick~realm-gradle-plugin)\n\n\n```\nbuildscript {\n    repositories {\n        mavenCentral()\n        google()\n        maven {\n            url 'https:\u002F\u002Foss.sonatype.org\u002Fcontent\u002Frepositories\u002Fsnapshots\u002F'\n        }\n        jcenter()\n    }\n    dependencies {\n        classpath \"io.realm:realm-gradle-plugin:\u003Cversion>-SNAPSHOT\"\n    }\n}\n\nallprojects {\n    repositories {\n        mavenCentral()\n        google()\n        maven {\n            url 'https:\u002F\u002Foss.sonatype.org\u002Fcontent\u002Frepositories\u002Fsnapshots\u002F'\n        }\n        jcenter()\n    }\n}\n```\n\nSee [version.txt](version.txt) for the latest version number.\n\n## Building Realm\n\nIn case you don't want to use the precompiled version, you can build Realm yourself from source.\n\n### Prerequisites\n\n * Download the [**JDK 8**](http:\u002F\u002Fwww.oracle.com\u002Ftechnetwork\u002Fjava\u002Fjavase\u002Fdownloads\u002Fjdk8-downloads-2133151.html) from Oracle and install it.\n * The latest stable version of Android Studio. Currently [4.1.1](https:\u002F\u002Fdeveloper.android.com\u002Fstudio\u002F).\n * Download & install the Android SDK **Build-Tools 29.0.3**, **Android Pie (API 29)** (for example through Android Studio’s **Android SDK Manager**).\n * Install CMake version 3.18.4 and build Ninja.\n * Install the NDK (Side-by-side) **21.0.6113669** from the SDK Manager in Android Studio. Remember to check `☑  Show package details` in the manager to display all available versions.\n\n * Add the Android home environment variable to your profile:\n\n    ```\n    export ANDROID_HOME=~\u002FLibrary\u002FAndroid\u002Fsdk\n    ```\n\n * If you are launching Android Studio from the macOS Finder, you should also run the following command:\n\n    ```\n    launchctl setenv ANDROID_HOME \"$ANDROID_HOME\"\n    ```\n\n * If you'd like to specify the location in which to store the archives of Realm Core, define the `REALM_CORE_DOWNLOAD_DIR` environment variable. It enables caching core release artifacts.\n\n   ```\n   export REALM_CORE_DOWNLOAD_DIR=~\u002F.realmCore\n   ```\n\n   macOS users must also run the following command for Android Studio to see this environment variable.\n\n   ```\n   launchctl setenv REALM_CORE_DOWNLOAD_DIR \"$REALM_CORE_DOWNLOAD_DIR\"\n   ```\n\nIt would be a good idea to add all of the symbol definitions (and their accompanying `launchctl` commands, if you are using macOS) to your `~\u002F.profile` (or `~\u002F.zprofile` if the login shell is `zsh`)\n\n * If you develop Realm Java with Android Studio, we recommend you to exclude some directories from indexing target by executing following steps on Android Studio. It really speeds up indexing phase after the build.\n\n    - Under `\u002Frealm\u002Frealm-library\u002F`, select `build`, `.cxx` and `distribution` folders in `Project` view.\n    - Press `Command + Shift + A` to open `Find action` dialog. If you are not using default keymap nor using macOS, you can find your shortcut key in `Keymap` preference by searching `Find action`.\n    - Search `Excluded` (not `Exclude`) action and select it. Selected folder icons should become orange (in default theme).\n    - Restart Android Studio.\n\n### Download sources\n\nYou can download the source code of Realm Java by using git. Since realm-java has git submodules, use `--recursive` when cloning the repository.\n\n```\ngit clone git@github.com:realm\u002Frealm-java.git --recursive\n```\n\nor\n\n```\ngit clone https:\u002F\u002Fgithub.com\u002Frealm\u002Frealm-java.git --recursive\n```\n\n### Build\n\nOnce you have completed all the pre-requisites building Realm is done with a simple command.\n\n```\n.\u002Fgradlew assemble\n```\n\nThat command will generate:\n\n * a jar file for the Realm Gradle plugin\n * an aar file for the Realm library\n * a jar file for the annotations\n * a jar file for the annotations processor\n\nThe full build may take an hour or more, to complete.\n\n### Building from source\n\nIt is possible to build Realm Java with the submodule version of Realm Core. This is done by providing the following parameter when building: `-PbuildCore=true`.\n\n```\n.\u002Fgradlew assembleBase -PbuildCore=true\n```\n\nYou can turn off interprocedural optimizations with the following parameter: `-PenableLTO=false`. \n\n```\n.\u002Fgradlew assembleBase -PenableLTO=false`\n```\n\nNote: Building the `Base` variant would always build realm-core.\n\nNote: Interprocedural optimizations are enabled by default.\n\nNote: If you want to build from source inside Android Studio, you need to update the Gradle parameters by going into the Realm projects settings `Settings > Build, Execution, Deployment > Compiler > Command-line options` and add `-PbuildCore=true` or `-PenableLTO=false` to it. Alternatively you can add it into your `gradle.properties`:\n\n```\nbuildCore=true\nenableLTO=false\n```\n\nNote: If building on OSX you might like to prevent Gatekeeper to block all NDK executables by disabling it: `sudo spctl --master-disable`. Remember to enable it afterwards: `sudo spctl --master-enable`\n\n### Other Commands\n\n * `.\u002Fgradlew tasks` will show all the available tasks\n * `.\u002Fgradlew javadoc` will generate the Javadocs\n * `.\u002Fgradlew monkeyExamples` will run the monkey tests on all the examples\n * `.\u002Fgradlew installRealmJava` will install the Realm library and plugin to mavenLocal()\n * `.\u002Fgradlew clean -PdontCleanJniFiles` will remove all generated files except for JNI related files. This reduces recompilation time a lot.\n * `.\u002Fgradlew connectedUnitTests -PbuildTargetABIs=$(adb shell getprop ro.product.cpu.abi)` will build JNI files only for the ABI which corresponds to the connected device.  These tests require a running Object Server (see below)\n\nGenerating the Javadoc using the command above may generate warnings. The Javadoc is generated despite the warnings.\n\n\n### Upgrading Gradle Wrappers\n\n All gradle projects in this repository have `wrapper` task to generate Gradle Wrappers. Those tasks refer to `gradle` property defined in `\u002Fdependencies.list` to determine Gradle Version of generating wrappers.\nWe have a script `.\u002Ftools\u002Fupdate_gradle_wrapper.sh` to automate these steps. When you update Gradle Wrappers, please obey the following steps.\n\n 1. Edit `gradle` property in defined in `\u002Fdependencies.list` to new Gradle Wrapper version.\n 2. Execute `\u002Ftools\u002Fupdate_gradle_wrapper.sh`.\n\n### Gotchas\n\nThe repository is organized into six Gradle projects:\n\n * `realm`: it contains the actual library (including the JNI layer) and the annotations processor.\n * `realm-annotations`: it contains the annotations defined by Realm.\n * `realm-transformer`: it contains the bytecode transformer.\n * `gradle-plugin`: it contains the Gradle plugin.\n * `examples`: it contains the example projects. This project directly depends on `gradle-plugin` which adds a dependency to the artifacts produced by `realm`.\n * The root folder is another Gradle project.  All it does is orchestrate the other jobs.\n\nThis means that `.\u002Fgradlew clean` and `.\u002Fgradlew cleanExamples` will fail if `assembleExamples` has not been executed first.\nNote that IntelliJ [does not support multiple projects in the same window](https:\u002F\u002Fyoutrack.jetbrains.com\u002Fissue\u002FIDEABKL-6118#)\nso each of the six Gradle projects must be imported as a separate IntelliJ project.\n\nSince the repository contains several completely independent Gradle projects, several independent builds are run to assemble it.\nSeeing a line like: `:realm:realm-library:compileBaseDebugAndroidTestSources UP-TO-DATE` in the build log does *not* imply\nthat you can run `.\u002Fgradlew :realm:realm-library:compileBaseDebugAndroidTestSources`.\n\n## Examples\n\nThe `.\u002Fexamples` folder contains many example projects showing how Realm can be used. If this is the first time you checkout or pull a new version of this repository to try the examples, you must call `.\u002Fgradlew installRealmJava` from the top-level directory first. Otherwise, the examples will not compile as they depend on all Realm artifacts being installed in `mavenLocal()`.\n\n## Running Tests on a Device\n\nTo run these tests, you must have a device connected to the build computer, and the `adb` command must be in your `PATH`\n\n1. Connect an Android device and verify that the command `adb devices` shows a connected device:\n\n    ```sh\n    adb devices\n    List of devices attached\n    004c03eb5615429f device\n    ```\n\n2. Run instrumentation tests:\n\n    ```sh\n    cd realm\n    .\u002Fgradlew connectedBaseDebugAndroidTest\n    ```\n\nThese tests may take as much as half an hour to complete.\n\n## Running Tests Using The Realm Object Server\n\nTests in `realm\u002Frealm-library\u002Fsrc\u002FsyncIntegrationTest` require a running testing server to work.\nA docker image can be built from `tools\u002Fsync_test_server\u002FDockerfile` to run the test server.\n`tools\u002Fsync_test_server\u002Fstart_server.sh` will build the docker image automatically.\n\nTo run a testing server locally:\n\n1. Install [docker](https:\u002F\u002Fwww.docker.com\u002Fproducts\u002Foverview) and run it.\n\n2. Run `tools\u002Fsync_test_server\u002Fstart_server.sh`:\n\n    ```sh\n    cd tools\u002Fsync_test_server\n    .\u002Fstart_server.sh\n    ```\n\n    This command will not complete until the server has stopped.\n\n3. Run instrumentation tests\n\n    In a new terminal window, run:\n\n    ```sh\n    cd realm\n    .\u002Fgradlew connectedObjectServerDebugAndroidTest\n    ```\n\nNote that if using VirtualBox (Genymotion), the network needs to be bridged for the tests to work.\nThis is done in `VirtualBox > Network`. Set \"Adapter 2\" to \"Bridged Adapter\".\n\nThese tests may take as much as half an hour to complete.\n\n## Contributing\n\nSee [CONTRIBUTING.md](CONTRIBUTING.md) for more details!\n\nThis project adheres to the [MongoDB Code of Conduct](https:\u002F\u002Fwww.mongodb.com\u002Fcommunity-code-of-conduct).\nBy participating, you are expected to uphold this code. Please report\nunacceptable behavior to [community-conduct@mongodb.com](mailto:community-conduct@mongodb.com).\n\nThe directory `realm\u002Fconfig\u002Fstudio` contains lint and style files recommended for project code.\nImport them from Android Studio with Android Studio > Preferences... > Code Style > Manage... > Import,\nor Android Studio > Preferences... > Inspections > Manage... > Import.  Once imported select the\nstyle\u002Flint in the drop-down to the left of the Manage... button.\n\n## License\n\nRealm Java is published under the Apache 2.0 license.\n\nRealm Core is also published under the Apache 2.0 license and is available\n[here](https:\u002F\u002Fgithub.com\u002Frealm\u002Frealm-core).\n\n## Feedback\n\n**_If you use Realm and are happy with it, all we ask is that you, please consider sending out a tweet mentioning [@realm](http:\u002F\u002Ftwitter.com\u002Frealm) to share your thoughts!_**\n\n**_And if you don't like it, please let us know what you would like improved, so we can fix it!_**\n\n\u003Cimg style=\"width: 0px; height: 0px;\" src=\"https:\u002F\u002F3eaz4mshcd.execute-api.us-east-1.amazonaws.com\u002Fprod?s=https:\u002F\u002Fgithub.com\u002Frealm\u002Frealm-java#README.md\">\n","Realm 是一个专为移动设备设计的数据库，用以替代 SQLite 和 ORM。其核心功能包括直接在手机、平板或可穿戴设备上运行，提供简单直观的数据对象操作接口，支持线程安全、关系管理和数据加密等现代特性，并且在常见操作上比原始 SQLite 更快。此外，它还支持实时数据同步功能，能够轻松保持跨用户、设备和后端的数据一致性。适合需要高性能、易用性及良好移动适配性的安卓应用开发场景使用。",2,"2026-06-11 02:58:17","top_language"]