File tree Expand file tree Collapse file tree 2 files changed +17
-7
lines changed
tutorial/kotlin-android/app/src/main/java/com/mongodb/tasktracker Expand file tree Collapse file tree 2 files changed +17
-7
lines changed Original file line number Diff line number Diff line change @@ -208,12 +208,26 @@ title: Create the Realm App
208
208
ref : create-realm-app
209
209
content : |
210
210
211
- Navigate to ``TaskTracker``, which initializes {+service-short+} and
212
- sets the SDK log level. You should instantiate ``taskApp``, the global
213
- {+service-short+} App reference, here:
211
+ Navigate to ``TaskTracker``. Android automatically runs the
212
+ ``onCreate()`` lifecycle method of this class when you launch
213
+ the Task Tracker app. This happens because ``TaskTracker`` is
214
+ configured as the global ``Application`` reference in
215
+ ``AndroidManifest.xml``. This allows us to run certain logic
216
+ once each time you run the app, such as:
217
+
218
+ - initializing {+service-short+}
219
+ - defining the global ``App`` reference using the ``appId``
220
+ variable you just configured in your app-level
221
+ ``build.gradle`` file
222
+ - setting the {+service-short+} log level
214
223
215
224
.. literalinclude:: /tutorial/generated/code/final/TaskTracker.codeblock.initialize-realm-and-create-app.kt
216
225
:language: kotlin
226
+
227
+ You don't need to make any changes to this file right now,
228
+ but it is useful to know where to configure these global
229
+ settings in case you need to change the log level or debug
230
+ issues with your App connection.
217
231
218
232
---
219
233
title : Enable Authentication
Original file line number Diff line number Diff line change @@ -27,13 +27,9 @@ class TaskTracker : Application() {
27
27
// Initialize the Realm SDK
28
28
Realm .init (this )
29
29
// :code-block-start: initialize-realm-and-create-app
30
- // :state-start: final
31
30
taskApp = App (
32
31
AppConfiguration .Builder (BuildConfig .MONGODB_REALM_APP_ID )
33
32
.build())
34
- // :state-end: :state-uncomment-start: start
35
- // // TODO: Create the App object we will use to communicate with the Realm backend.
36
- // :state-uncomment-end:
37
33
// :code-block-end:
38
34
39
35
// Enable more logging in debug mode
You can’t perform that action at this time.
0 commit comments