-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Examples
F43nd1r edited this page Jul 2, 2018
·
3 revisions
@AcraCore(buildConfigClass = BuildConfig.class,
reportFormat = StringFormat.JSON)
@AcraHttpSender(uri = "https://yourdomain.com/acra/report",
httpMethod = HttpSender.Method.POST,
basicAuthLogin = "*****",
basicAuthPassword = "*****")
@AcraScheduler(requiresNetworkType = JobRequest.NetworkType.UNMETERED,
requiresBatteryNotLow = true)
@AcraLimiter
public class MyApplication extends Application {
@Override
protected void attachBaseContext(Context base) {
super.attachBaseContext(base);
ACRA.init(this);
}
}
Same as above, but without annotations
public class MyApplication extends Application {
@Override
protected void attachBaseContext(Context base) {
super.attachBaseContext(base);
CoreConfigurationBuilder builder = new CoreConfigurationBuilder(this)
.setBuildConfigClass(BuildConfig.class)
.setReportFormat(StringFormat.JSON);
builder.getPluginConfigurationBuilder(HttpSenderConfigurationBuilder.class)
.setUri("https://yourdomain.com/acra/report")
.setHttpMethod(HttpSender.Method.POST)
.setBasicAuthLogin("*****")
.setBasicAuthPassword("*****")
.setEnabled(true);
builder.getPluginConfigurationBuilder(SchedulerConfigurationBuilder.class)
.setRequiresNetworkType(JobRequest.NetworkType.UNMETERED)
.setRequiresBatteryNotLow(true)
.setEnabled(true);
builder.getPluginConfigurationBuilder(LimiterConfigurationBuilder.class)
.setEnabled(true);
ACRA.init(this, builder);
}
}