You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#### Initializing MobileCore with Android Application instance
85
+
#### Setting Android Application instance
86
86
87
87
Use the `setApplication` api to pass the Android Application instance to SDK. This allows the SDK to monitor the lifecycle of your Android application.
88
88
@@ -113,7 +113,7 @@ class YourApp : Application() {
113
113
```
114
114
115
115
116
-
#### Retrieving the registered Application
116
+
#### Retrieving the Android Application instance
117
117
118
118
You can use the `getApplication()` api to get the Android Application instance that was previously set via `MobileCore.setApplication()`
119
119
@@ -130,8 +130,104 @@ final Application app = MobileCore.getApplication();
130
130
val app =MobileCore.getApplication()
131
131
```
132
132
133
+
#### Initializing the SDK by automatically registering all extensions and enabling Lifecycle data collection
133
134
134
-
#### Registering extensions and starting the SDK
135
+
> [!NOTE]
136
+
> API `initialize(String appId)` added since Core 3.3.0
137
+
138
+
> [!IMPORTANT]
139
+
> All Adobe Mobile SDK extensions listed as a dependency in your application are automatically registered when calling `initialize(String appId)`.
140
+
>
141
+
> Automatic Lifecycle data collection requires **Lifecycle** extension included as an app dependency.
142
+
143
+
##### Java
144
+
145
+
```java
146
+
publicclassYourAppextendsApplication {
147
+
148
+
@Override
149
+
publicvoidonCreate() {
150
+
super.onCreate();
151
+
152
+
MobileCore.initialize(this, YOUR_APP_ID);
153
+
154
+
// Optionally, if you need a callback:
155
+
// MobileCore.initialize(this, YOUR_APP_ID, , new AdobeCallback<Void>() {
156
+
// @Override
157
+
// public void call(Void result) {
158
+
// // SDK initialized.
159
+
// }
160
+
// });
161
+
}
162
+
}
163
+
```
164
+
165
+
##### Kotlin
166
+
167
+
```kotlin
168
+
classYourApp : Application() {
169
+
overridefunonCreate() {
170
+
super.onCreate()
171
+
172
+
MobileCore.initialize(this, YOUR_APP_ID)
173
+
174
+
// Optionally, if you need a callback:
175
+
// MobileCore.initialize(this, YOUR_APP_ID) {
176
+
// // SDK initialized.
177
+
// }
178
+
}
179
+
}
180
+
```
181
+
182
+
#### Initializing the SDK by automatically registering all extensions while disabling Lifecycle data collection
183
+
184
+
> [!NOTE]
185
+
> API `initialize(InitOptions options)` added since Core 3.3.0
186
+
187
+
> [!IMPORTANT]
188
+
> All Adobe Mobile SDK extensions listed as a dependency in your application are automatically registered when calling `initialize(InitOptions options)`.
0 commit comments