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
@@ -40,46 +43,32 @@ The Mobile Center SDK is designed with a modular approach – a developer only n
40
43
41
44
Below are the steps on how to integrate our compiled libraries in your application using Android Studio and Gradle.
42
45
43
-
1. Open your app level build.gradle file (app/build.gradle) and add the following lines after `apply plugin`. During the private beta, you need to include these credentials in order to get the libraries.
2. In the same file, include the dependencies that you want in your project. Each SDK module needs to be added as a separate dependency in this section. If you would want to use both Analytics and Crashes, add the following lines:
46
+
1. Open your app level build.gradle file (app/build.gradle) and include the dependencies that you want in your project. Each SDK module needs to be added as a separate dependency in this section. If you would want to use both Analytics and Crashes, add the following lines:
3. Save your build.gradle file and make sure to trigger a Gradle sync in Android Studio.
56
+
2. Save your build.gradle file and make sure to trigger a Gradle sync in Android Studio.
68
57
69
58
Now that you've integrated the SDK in your application, it's time to start the SDK and make use of Mobile Center services.
70
59
71
60
## 3. Start the SDK
72
61
73
62
To start the Mobile Center SDK in your app, follow these steps:
74
63
75
-
1. **Start the SDK:** Mobile Center provides developers with two modules to get started – Analytics and Crashes. In order to use these modules, you need to opt in for the module(s) that you'd like, meaning by default no modules are started and you will have to explicitly call each of them when starting the SDK. Insert the following line inside your app's main activity class' `onCreate` callback.
64
+
1. **Start the SDK:** Mobile Center provides developers with two services to get started – Analytics and Crashes. In order to use these services, you need to opt in for the service(s) that you'd like, meaning by default no services are started and you will have to explicitly call each of them when starting the SDK. Insert the following line inside your app's main activity class' `onCreate` callback.
You can also copy paste the `start` method call from the Overview page on Mobile Center portal once your app is selected. It already includes the App Secret so that all the data collected by the SDK corresponds to your application. Make sure to replace {Your App Secret} text with the actual value for your application.
81
70
82
-
The example above shows how to use the `start()` method and include both the Analytics and Crashes module. If you wish not to use Analytics, remove the parameter from the method call above. Note that, unless you explicitly specify each module as parameters in the start method, you can't use that Mobile Center service. Also, the `start()` API can be used only once in the lifecycle of your app – all other calls will log a warning to the console and only the modules included in the first call will be available.
71
+
The example above shows how to use the `start()` method and include both the Analytics and Crashes services. If you wish not to use Analytics, remove the parameter from the method call above. Note that, unless you explicitly specify each service as parameters in the start method, you can't use that Mobile Center service. Also, the `start()` API can be used only once in the lifecycle of your app – all other calls will log a warning to the console and only the services included in the first call will be available.
83
72
84
73
Android Studio will automatically suggest the required import statements once you insert the `start()` method-call, but if you see an error that the class names are not recognized, add the following lines to the import statements in your activity class:
85
74
@@ -91,7 +80,7 @@ To start the Mobile Center SDK in your app, follow these steps:
91
80
92
81
## 4. Analytics APIs
93
82
94
-
* **Track Session, Device Properties:** Once the Analytics module is included in your app and the SDK is started, it will automatically track sessions, device properties like OS Version, model, manufacturer etc. and you don’t need to add any additional code.
83
+
* **Track Session, Device Properties:** Once the Analytics service is included in your app and the SDK is started, it will automatically track sessions, device properties like OS Version, model, manufacturer etc. and you don’t need to add any additional code.
95
84
Look at the section above on how to [Start the SDK](#3-start-the-sdk) if you haven't started it yet.
96
85
97
86
* **Custom Events:** You can track your own custom events with specific properties to know what's happening in your app, understand user actions, and see the aggregates in the Mobile Center portal. Once you have started the SDK, use the `trackEvent()` method to track your events with properties.
@@ -110,21 +99,21 @@ To start the Mobile Center SDK in your app, follow these steps:
110
99
Analytics.trackEvent("Video clicked");
111
100
```
112
101
113
-
* **Enable or disable Analytics:** You can change the enabled state of the Analytics module at runtime by calling the `Analytics.setEnabled()` method. If you disable it, the SDK will not collect any more analytics information for the app. To re-enable it, pass `true` as a parameter in the same method.
102
+
* **Enable or disable Analytics:** You can change the enabled state of the Analytics service at runtime by calling the `Analytics.setEnabled()` method. If you disable it, the SDK will not collect any more analytics information for the app. To re-enable it, pass `true` as a parameter in the same method.
114
103
115
104
```Java
116
105
Analytics.setEnabled(false);
117
106
```
118
107
119
-
You can also check, if the module is enabled or not using the `isEnabled()` method:
108
+
You can also check if the service is enabled or not using the `isEnabled()` method:
120
109
121
110
```Java
122
111
Analytics.isEnabled();
123
112
```
124
113
125
114
## 5. Crashes APIs
126
115
127
-
Once you set up and start the Mobile Center SDK to use the Crashes module in your application, the SDK will automatically start logging any crashes in the device's local storage. When the user opens the application again, all pending crash logs will automatically be forwarded to Mobile Center and you can analyze the crash along with the stack trace on the Mobile Center portal. Refer to the section to [Start the SDK](#3-start-the-sdk) if you haven't done so already.
116
+
Once you set up and start the Mobile Center SDK to use the Crashes service in your application, the SDK will automatically start logging any crashes in the device's local storage. When the user opens the application again, all pending crash logs will automatically be forwarded to Mobile Center and you can analyze the crash along with the stack trace on the Mobile Center portal. Refer to the section to [Start the SDK](#3-start-the-sdk) if you haven't done so already.
128
117
129
118
* **Generate a test crash:** The SDK provides you with a static API to generate a test crash for easy testing of the SDK:
130
119
@@ -146,19 +135,19 @@ Once you set up and start the Mobile Center SDK to use the Crashes module in you
* **Enable or disable the Crashes module:** You can disable and opt out of using the Crashes module by calling the `setEnabled()` API and the SDK will collect no crashes for your app. Use the same API to re-enable it by passing `true` as a parameter.
138
+
* **Enable or disable Crashes:** You can disable and opt out of using Crashes by calling the `setEnabled()` API and the SDK will collect no crashes for your app. Use the same API to re-enable it by passing `true` as a parameter.
150
139
151
140
```Java
152
141
Crashes.setEnabled(false);
153
142
```
154
143
155
-
You can also check if the module is enabled or not using the `isEnabled()` method:
144
+
You can also check if the service is enabled or not using the `isEnabled()` method:
156
145
157
146
```Java
158
147
Crashes.isEnabled();
159
148
```
160
149
161
-
* **Advanced Scenarios:** The Crashes module provides callbacks for developers to perform additional actions before and when sending crash reports to Mobile Center. This gives you added flexibility on the crash reports that will be sent.
150
+
* **Advanced Scenarios:** The Crashes service provides callbacks for developers to perform additional actions before and when sending crash reports to Mobile Center. This gives you added flexibility on the crash reports that will be sent.
162
151
To handle the callbacks, you must either implement all methods in the `CrashesListener` interface, or override the `AbstractCrashesListener` class and pick only the ones you're interested in.
163
152
You create your own Crashes listener and assign it like this:
164
153
@@ -181,7 +170,7 @@ You create your own Crashes listener and assign it like this:
181
170
```
182
171
183
172
* **User Confirmation:** If user privacy is important to you as a developer, you might want to get user confirmation before sending a crash report to Mobile Center. The SDK exposes a callback where you can tell it to await user confirmation before sending any crash reports.
184
-
Your app is then responsible for obtaining confirmation, e.g. through a dialog prompt with one of these options - "Always Send", "Send", and "Don't send". Based on the user input, you will tell the SDK and the crash will then respectively be forwarded to Mobile Center or not.
173
+
Your app is then responsible for obtaining confirmation, e.g. through a dialog prompt with one of these options - "Always Send", "Send", and "Don't Send". Based on the user input, you will tell the SDK and the crash will then respectively be forwarded to Mobile Center or not.
@@ -259,7 +248,7 @@ You create your own Crashes listener and assign it like this:
259
248
You only include the modules for the services you want to use. They all have a dependency on the Mobile Center module, so this will be included once you pull down the dependencies.
260
249
261
250
* **Debugging steps, when you can't see crash reports on the portal:**
262
-
1. Make sure the SDK `start()` API is used correctly and the Crashes module is configured. Also, you need to restart the app after a crash – our SDK will forward the crash log only after it's restarted.
251
+
1. Make sure the SDK `start()` API is used correctly and the Crashes service is configured. Also, you need to restart the app after a crash – our SDK will forward the crash log only after it's restarted.
263
252
2. Make sure your device is connected to the internet.
264
253
3. Check if the App Secret used to start the SDK matches the App Secret in the Mobile Center portal.
265
254
4. Disable any other SDK that provides Crash Reporting functionality, as those might interfere with the Mobile Center SDK.
@@ -271,13 +260,4 @@ You create your own Crashes listener and assign it like this:
271
260
Depending on the services you use, the following permissions are required:
Required permissions will automatically be merged into your app's manifest by the SDK. Where possible, the SDK will use [Run Time permissions](https://developer.android.com/training/permissions/requesting.html).
0 commit comments