1- Import the following libraries :
import com.microsoft.appcenter.AppCenter import com.microsoft.appcenter.analytics.Analytics import com.microsoft.appcenter.crashes.Crashes
2- Enable Appcenter with the following line of code in the onCreate overrided method :
AppCenter.start(getApplication(), "eeeeeeee-xxxx-yyyy-zzzz-aaaaaaaaaaaa",Analytics::class.java, Crashes::class.java)
3- Don't forget to replace the key by the one generated for your account in AppCenter ("eeeeeeee..." by the new one)
4- In App/build.gradle file, add :
dependencies { def appCenterSdkVersion = '2.3.0' implementation "com.microsoft.appcenter:appcenter-analytics:${appCenterSdkVersion}" implementation "com.microsoft.appcenter:appcenter-crashes:${appCenterSdkVersion}" }
That's it !