-
Notifications
You must be signed in to change notification settings - Fork 88
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
247 changed files
with
148,767 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
.. meta:: | ||
:robots: noindex, nosnippet | ||
|
||
[[facets]] | ||
category = "programming_language" | ||
value = "cpp" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
.. meta:: | ||
:robots: noindex, nosnippet | ||
|
||
[[facets]] | ||
category = "programming_language" | ||
value = "csharp" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
.. meta:: | ||
:robots: noindex, nosnippet | ||
|
||
[[facets]] | ||
category = "programming_language" | ||
value = "dart" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,178 @@ | ||
.. meta:: | ||
:robots: noindex, nosnippet | ||
|
||
.. _java-adapters: | ||
|
||
============================== | ||
Display Collections - Java SDK | ||
============================== | ||
|
||
.. contents:: On this page | ||
:local: | ||
:backlinks: none | ||
:depth: 2 | ||
:class: singlecol | ||
|
||
Android apps often populate the UI using | ||
:android:`RecyclerView <reference/androidx/recyclerview/widget/RecyclerView.html>` | ||
or :android:`ListView <reference/android/widget/ListView>` components. | ||
Realm offers **adapters** to display realm object | ||
:ref:`collections <java-client-collections>`. These collections implement | ||
the ``OrderedRealmCollections`` interface. :ref:`RealmResults <java-results-collections>` | ||
and :ref:`RealmList <java-list-collections>` are examples of these adaptors. | ||
With these adapters, UI components update when your app changes | ||
Realm objects. | ||
|
||
Install Adapters | ||
---------------- | ||
|
||
Add these dependencies to your application level ``build.gradle`` file: | ||
|
||
.. code-block:: gradle | ||
:copyable: false | ||
|
||
dependencies { | ||
implementation 'io.realm:android-adapters:4.0.0' | ||
implementation 'androidx.recyclerview:recyclerview:1.1.0' | ||
} | ||
|
||
Realm hosts these adapters on the | ||
`JCenter <https://mvnrepository.com/repos/jcenter>`_ | ||
artifact repository. To use ``jcenter`` in your Android app, add it to your | ||
project-level ``build.gradle`` file: | ||
|
||
.. code-block:: gradle | ||
:emphasize-lines: 3, 9 | ||
:copyable: false | ||
|
||
buildscript { | ||
repositories { | ||
jcenter() | ||
} | ||
} | ||
|
||
allprojects { | ||
repositories { | ||
jcenter() | ||
} | ||
} | ||
|
||
.. seealso:: | ||
|
||
Source code: :github:`realm/realm-android-adapters` on GitHub. | ||
|
||
.. _java-adapters-model-item: | ||
|
||
Example Models | ||
-------------- | ||
|
||
The examples on this page use a Realm object named ``Item``. | ||
This class contains a string named "name" and an identifier number named | ||
"id": | ||
|
||
.. tabs-realm-languages:: | ||
|
||
.. tab:: | ||
:tabid: java | ||
|
||
.. literalinclude:: /examples/generated/java/local/JavaItem.snippet.complete.java | ||
:language: java | ||
:copyable: false | ||
|
||
.. tab:: | ||
:tabid: kotlin | ||
|
||
.. literalinclude:: /examples/generated/java/local/Item.snippet.complete.kt | ||
:language: kotlin | ||
:copyable: false | ||
|
||
.. _java-adapters-listview: | ||
|
||
Display Collections in a ListView | ||
--------------------------------- | ||
|
||
Display Realm objects in a | ||
:android:`ListView <reference/android/widget/ListView>` by extending | ||
:github:`RealmBaseAdapter | ||
<realm/realm-android-adapters/blob/master/adapters/src/main/java/io/realm/RealmBaseAdapter.java>`. | ||
The adapter uses the ``ListAdapter`` interface. Implementation works | ||
like any ``ListAdapter``. This provides support for automatically-updating | ||
Realm objects. | ||
|
||
Subclass ``RealmBaseAdapter`` to display | ||
:ref:`Item <java-adapters-model-item>` objects in a ``ListView``: | ||
|
||
.. tabs-realm-languages:: | ||
|
||
.. tab:: | ||
:tabid: java | ||
|
||
.. literalinclude:: /examples/generated/java/local/ExampleListAdapter.snippet.complete.java | ||
:language: java | ||
:copyable: false | ||
|
||
To display list data in an activity, instantiate a ``ListView``. Then, | ||
attach an ``ExampleListAdapter``: | ||
|
||
.. literalinclude:: /examples/generated/java/local/AdapterTest.snippet.list-adapter.java | ||
:language: java | ||
:copyable: false | ||
|
||
.. tab:: | ||
:tabid: kotlin | ||
|
||
.. literalinclude:: /examples/generated/java/local/ExampleListAdapter.snippet.complete.kt | ||
:language: kotlin | ||
|
||
To display list data in an activity, instantiate a ``ListView``. Then, | ||
attach an ``ExampleListAdapter``: | ||
|
||
.. literalinclude:: /examples/generated/java/local/AdapterTest.snippet.list-adapter.kt | ||
:language: kotlin | ||
:copyable: false | ||
|
||
.. _java-adapters-recyclerview: | ||
|
||
Display Collections in a RecyclerView | ||
------------------------------------- | ||
|
||
Display Realm objects in a | ||
:android:`RecyclerView <reference/androidx/recyclerview/widget/RecyclerView.html>` | ||
by extending :github:`RealmRecyclerViewAdapter | ||
<realm/realm-android-adapters/blob/master/adapters/src/main/java/io/realm/RealmRecyclerViewAdapter.java>`. | ||
The adapter extends ``RecyclerView.Adapter``. Implementation works like any | ||
``RecyclerView`` adapter. This provides support | ||
for automatically-updating Realm objects. | ||
|
||
Subclass ``RealmRecyclerViewAdapter`` to display | ||
:ref:`Item <java-adapters-model-item>` objects in a ``RecyclerView``: | ||
|
||
.. tabs-realm-languages:: | ||
|
||
.. tab:: | ||
:tabid: java | ||
|
||
.. literalinclude:: /examples/generated/java/local/ExampleRecyclerViewAdapter.snippet.complete.java | ||
:language: java | ||
:copyable: false | ||
|
||
To display list data in an activity, instantiate a ``RecyclerView``. Then, | ||
attach an ``ExampleRecyclerViewAdapter``: | ||
|
||
.. literalinclude:: /examples/generated/java/local/AdapterTest.snippet.recycler-view-adapter.java | ||
:language: java | ||
:copyable: false | ||
|
||
.. tab:: | ||
:tabid: kotlin | ||
|
||
.. literalinclude:: /examples/generated/java/local/ExampleRecyclerViewAdapter.snippet.complete.kt | ||
:language: kotlin | ||
:copyable: false | ||
|
||
To display list data in an activity, instantiate a ``RecyclerView``. Then, | ||
attach an ``ExampleRecyclerViewAdapter``: | ||
|
||
.. literalinclude:: /examples/generated/java/local/AdapterTest.snippet.recycler-view-adapter.kt | ||
:language: kotlin | ||
:copyable: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
.. meta:: | ||
:robots: noindex, nosnippet | ||
|
||
============= | ||
API Reference | ||
============= | ||
|
||
.. contents:: On this page | ||
:local: | ||
:backlinks: none | ||
:depth: 2 | ||
:class: singlecol | ||
|
||
.. toctree:: | ||
:titlesonly: | ||
:hidden: | ||
|
||
io.realm </sdk/java/api/io/realm> | ||
io.realm.annotations </sdk/java/api/io/realm/annotations> | ||
io.realm.coroutines </sdk/java/api/io/realm/coroutines> | ||
io.realm.exceptions </sdk/java/api/io/realm/exceptions> | ||
io.realm.log </sdk/java/api/io/realm/log> | ||
io.realm.mongodb </sdk/java/api/io/realm/mongodb> | ||
io.realm.mongodb.auth </sdk/java/api/io/realm/mongodb/auth> | ||
io.realm.mongodb.functions </sdk/java/api/io/realm/mongodb/functions> | ||
io.realm.mongodb.log.obfuscator </sdk/java/api/io/realm/mongodb/log/obfuscator> | ||
io.realm.mongodb.mongo </sdk/java/api/io/realm/mongodb/mongo> | ||
io.realm.mongodb.mongo.events </sdk/java/api/io/realm/mongodb/mongo/events> | ||
io.realm.mongodb.mongo.iterable </sdk/java/api/io/realm/mongodb/mongo/iterable> | ||
io.realm.mongodb.mongo.options </sdk/java/api/io/realm/mongodb/mongo/options> | ||
io.realm.mongodb.mongo.result </sdk/java/api/io/realm/mongodb/mongo/result> | ||
io.realm.mongodb.push </sdk/java/api/io/realm/mongodb/push> | ||
io.realm.mongodb.sync </sdk/java/api/io/realm/mongodb/sync> | ||
io.realm.rx </sdk/java/api/io/realm/rx> | ||
|
||
|
||
The Java API reference docs are now integrated into the main | ||
documentation site. Use the side bar to browse packages. Miss the old | ||
reference docs? You can still see the `Javadoc version | ||
<https://www.mongodb.com/docs/realm-sdks/java/latest/>`__ and the `Kotlin | ||
Extensions Reference Manual | ||
<https://www.mongodb.com/docs/realm-sdks/java/latest/kotlin-extensions/>`__. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
.. meta:: | ||
:robots: noindex, nosnippet | ||
|
||
:orphan: | ||
|
||
.. contents:: On this page | ||
:local: | ||
:backlinks: none | ||
:depth: 2 | ||
:class: singlecol | ||
|
||
|
||
|
||
API Reference | ||
^^^^^^^^^^^^^ | ||
|
||
.. toctree:: | ||
:titlesonly: | ||
:hidden: | ||
|
||
io.realm </sdk/java/api/io/realm> | ||
io.realm.annotations </sdk/java/api/io/realm/annotations> | ||
io.realm.coroutines </sdk/java/api/io/realm/coroutines> | ||
io.realm.exceptions </sdk/java/api/io/realm/exceptions> | ||
io.realm.gradle </sdk/java/api/io/realm/gradle> | ||
io.realm.log </sdk/java/api/io/realm/log> | ||
io.realm.mongodb </sdk/java/api/io/realm/mongodb> | ||
io.realm.mongodb.auth </sdk/java/api/io/realm/mongodb/auth> | ||
io.realm.mongodb.functions </sdk/java/api/io/realm/mongodb/functions> | ||
io.realm.mongodb.log.obfuscator </sdk/java/api/io/realm/mongodb/log/obfuscator> | ||
io.realm.mongodb.mongo </sdk/java/api/io/realm/mongodb/mongo> | ||
io.realm.mongodb.mongo.events </sdk/java/api/io/realm/mongodb/mongo/events> | ||
io.realm.mongodb.mongo.iterable </sdk/java/api/io/realm/mongodb/mongo/iterable> | ||
io.realm.mongodb.mongo.options </sdk/java/api/io/realm/mongodb/mongo/options> | ||
io.realm.mongodb.mongo.result </sdk/java/api/io/realm/mongodb/mongo/result> | ||
io.realm.mongodb.push </sdk/java/api/io/realm/mongodb/push> | ||
io.realm.mongodb.sync </sdk/java/api/io/realm/mongodb/sync> | ||
io.realm.rx </sdk/java/api/io/realm/rx> | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
.. meta:: | ||
:robots: noindex, nosnippet | ||
|
||
:orphan: | ||
|
||
.. contents:: On this page | ||
:local: | ||
:backlinks: none | ||
:depth: 2 | ||
:class: singlecol | ||
|
||
|
||
|
||
Realm Java API | ||
^^^^^^^^^^^^^^ | ||
|
||
.. toctree:: | ||
:titlesonly: | ||
:hidden: | ||
|
||
|
||
io.realm </sdk/java/api/io/realm> | ||
io.realm.annotations </sdk/java/api/io/realm/annotations> | ||
io.realm.coroutines </sdk/java/api/io/realm/coroutines> | ||
io.realm.exceptions </sdk/java/api/io/realm/exceptions> | ||
io.realm.log </sdk/java/api/io/realm/log> | ||
io.realm.mongodb </sdk/java/api/io/realm/mongodb> | ||
io.realm.mongodb.functions </sdk/java/api/io/realm/mongodb/functions> | ||
io.realm.mongodb.log.obfuscator </sdk/java/api/io/realm/mongodb/log/obfuscator> | ||
io.realm.mongodb.mongo </sdk/java/api/io/realm/mongodb/mongo> | ||
io.realm.mongodb.mongo.events </sdk/java/api/io/realm/mongodb/mongo/events> | ||
io.realm.mongodb.mongo.iterable </sdk/java/api/io/realm/mongodb/mongo/iterable> | ||
io.realm.mongodb.mongo.options </sdk/java/api/io/realm/mongodb/mongo/options> | ||
io.realm.mongodb.mongo.result </sdk/java/api/io/realm/mongodb/mongo/result> | ||
io.realm.mongodb.push </sdk/java/api/io/realm/mongodb/push> | ||
io.realm.mongodb.sync </sdk/java/api/io/realm/mongodb/sync> | ||
io.realm.rx </sdk/java/api/io/realm/rx> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
.. meta:: | ||
:robots: noindex, nosnippet | ||
|
||
|
||
.. contents:: On this page | ||
:local: | ||
:backlinks: none | ||
:depth: 2 | ||
:class: singlecol | ||
|
||
|
||
|
||
io.realm | ||
^^^^^^^^ | ||
|
||
.. toctree:: | ||
:titlesonly: | ||
:hidden: | ||
|
||
|
||
Case </sdk/java/api/io/realm/Case> | ||
CollectionUtils </sdk/java/api/io/realm/CollectionUtils> | ||
CompactOnLaunchCallback </sdk/java/api/io/realm/CompactOnLaunchCallback> | ||
DefaultCompactOnLaunchCallback </sdk/java/api/io/realm/DefaultCompactOnLaunchCallback> | ||
DynamicRealm </sdk/java/api/io/realm/DynamicRealm> | ||
DynamicRealm.Callback </sdk/java/api/io/realm/DynamicRealm/Callback> | ||
DynamicRealm.Transaction </sdk/java/api/io/realm/DynamicRealm/Transaction> | ||
DynamicRealm.Transaction.Callback </sdk/java/api/io/realm/DynamicRealm/Transaction/Callback> | ||
DynamicRealm.Transaction.OnError </sdk/java/api/io/realm/DynamicRealm/Transaction/OnError> | ||
DynamicRealm.Transaction.OnSuccess </sdk/java/api/io/realm/DynamicRealm/Transaction/OnSuccess> | ||
DynamicRealmObject </sdk/java/api/io/realm/DynamicRealmObject> | ||
FieldAttribute </sdk/java/api/io/realm/FieldAttribute> | ||
FrozenPendingRow </sdk/java/api/io/realm/FrozenPendingRow> | ||
ImportFlag </sdk/java/api/io/realm/ImportFlag> | ||
MapChangeListener </sdk/java/api/io/realm/MapChangeListener> | ||
MapChangeSet </sdk/java/api/io/realm/MapChangeSet> | ||
MutableRealmInteger </sdk/java/api/io/realm/MutableRealmInteger> | ||
ObjectChangeSet </sdk/java/api/io/realm/ObjectChangeSet> | ||
OrderedCollectionChangeSet </sdk/java/api/io/realm/OrderedCollectionChangeSet> | ||
OrderedCollectionChangeSet.Range </sdk/java/api/io/realm/OrderedCollectionChangeSet/Range> | ||
OrderedCollectionChangeSet.State </sdk/java/api/io/realm/OrderedCollectionChangeSet/State> | ||
OrderedRealmCollection </sdk/java/api/io/realm/OrderedRealmCollection> | ||
OrderedRealmCollectionChangeListener </sdk/java/api/io/realm/OrderedRealmCollectionChangeListener> | ||
OrderedRealmCollectionSnapshot </sdk/java/api/io/realm/OrderedRealmCollectionSnapshot> | ||
ProxyState </sdk/java/api/io/realm/ProxyState> | ||
Realm </sdk/java/api/io/realm/Realm> | ||
Realm.Callback </sdk/java/api/io/realm/Realm/Callback> | ||
Realm.Transaction </sdk/java/api/io/realm/Realm/Transaction> | ||
Realm.Transaction.Callback </sdk/java/api/io/realm/Realm/Transaction/Callback> | ||
Realm.Transaction.OnError </sdk/java/api/io/realm/Realm/Transaction/OnError> | ||
Realm.Transaction.OnSuccess </sdk/java/api/io/realm/Realm/Transaction/OnSuccess> | ||
RealmAny </sdk/java/api/io/realm/RealmAny> | ||
RealmAny.Type </sdk/java/api/io/realm/RealmAny/Type> | ||
RealmAnyNativeFunctionsImpl </sdk/java/api/io/realm/RealmAnyNativeFunctionsImpl> | ||
RealmAnyOperator </sdk/java/api/io/realm/RealmAnyOperator> | ||
RealmAsyncTask </sdk/java/api/io/realm/RealmAsyncTask> | ||
RealmChangeListener </sdk/java/api/io/realm/RealmChangeListener> | ||
RealmCollection </sdk/java/api/io/realm/RealmCollection> | ||
RealmConfiguration </sdk/java/api/io/realm/RealmConfiguration> | ||
RealmConfiguration.Builder </sdk/java/api/io/realm/RealmConfiguration/Builder> | ||
RealmDictionary </sdk/java/api/io/realm/RealmDictionary> | ||
RealmFieldType </sdk/java/api/io/realm/RealmFieldType> | ||
RealmList </sdk/java/api/io/realm/RealmList> | ||
RealmMap </sdk/java/api/io/realm/RealmMap> | ||
RealmMigration </sdk/java/api/io/realm/RealmMigration> | ||
RealmModel </sdk/java/api/io/realm/RealmModel> | ||
RealmObject </sdk/java/api/io/realm/RealmObject> | ||
RealmObjectChangeListener </sdk/java/api/io/realm/RealmObjectChangeListener> | ||
RealmObjectSchema </sdk/java/api/io/realm/RealmObjectSchema> | ||
RealmObjectSchema.Function </sdk/java/api/io/realm/RealmObjectSchema/Function> | ||
RealmQuery </sdk/java/api/io/realm/RealmQuery> | ||
RealmResults </sdk/java/api/io/realm/RealmResults> | ||
RealmSchema </sdk/java/api/io/realm/RealmSchema> | ||
RealmSet </sdk/java/api/io/realm/RealmSet> | ||
SetChangeListener </sdk/java/api/io/realm/SetChangeListener> | ||
SetChangeSet </sdk/java/api/io/realm/SetChangeSet> | ||
Sort </sdk/java/api/io/realm/Sort> |
Oops, something went wrong.