use of org.acra.config.CoreConfigurationBuilder in project acra by ACRA.
the class ACRATest method failing.
@Test(expected = AssertionError.class)
public void failing() {
Application application = ApplicationProvider.getApplicationContext();
CoreConfigurationBuilder builder = new CoreConfigurationBuilder().withPluginLoader(new SimplePluginLoader(FailingTestAdministrator.class));
ACRA.init(application, builder);
ACRA.getErrorReporter().handleException(new RuntimeException());
}
use of org.acra.config.CoreConfigurationBuilder in project acra by ACRA.
the class DefaultAttachmentProviderTest method getAttachments.
@Test
public void getAttachments() throws Exception {
Uri uri = Uri.parse("content://not-a-valid-content-uri");
List<Uri> result = new DefaultAttachmentProvider().getAttachments(ApplicationProvider.getApplicationContext(), new CoreConfigurationBuilder().withAttachmentUris(uri.toString()).build());
assertThat(result, hasSize(1));
assertEquals(uri, result.get(0));
}
use of org.acra.config.CoreConfigurationBuilder in project acra by ACRA.
the class MyApplication method attachBaseContext.
@Override
protected void attachBaseContext(Context base) {
super.attachBaseContext(base);
CoreConfigurationBuilder builder = new CoreConfigurationBuilder(this);
builder.withBuildConfigClass(BuildConfig.class).withReportFormat(StringFormat.JSON);
builder.getPluginConfigurationBuilder(HttpSenderConfigurationBuilder.class).withUri("https://yourserver.com/report").withEnabled(true);
ACRA.init(this, builder);
}
use of org.acra.config.CoreConfigurationBuilder in project J2ME-Loader by nikita36078.
the class EmulatorApplication method attachBaseContext.
@SuppressWarnings("ConstantConditions")
@Override
protected void attachBaseContext(Context base) {
super.attachBaseContext(base);
if (BuildConfig.DEBUG) {
MultiDex.install(this);
}
ContextHolder.setApplication(this);
if (isSignatureValid() && !BuildConfig.FLAVOR.equals("dev")) {
CoreConfigurationBuilder builder = new CoreConfigurationBuilder(this);
builder.withBuildConfigClass(BuildConfig.class).withParallel(false).withSendReportsInDevMode(false).withEnabled(true);
builder.getPluginConfigurationBuilder(DialogConfigurationBuilder.class).withResTitle(R.string.crash_dialog_title).withResText(R.string.crash_dialog_message).withResPositiveButtonText(R.string.report_crash).withResTheme(R.style.Theme_AppCompat_Dialog).withEnabled(true);
ACRA.init(this, builder);
}
SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(this);
sp.registerOnSharedPreferenceChangeListener(themeListener);
setNightMode(sp.getString(Constants.PREF_THEME, "light"));
AppCompatDelegate.setCompatVectorFromResourcesEnabled(true);
}
use of org.acra.config.CoreConfigurationBuilder in project acra by ACRA.
the class ACRATest method init.
@Test
public void init() {
Application application = ApplicationProvider.getApplicationContext();
CoreConfigurationBuilder builder = new CoreConfigurationBuilder().withPluginLoader(new SimplePluginLoader(StacktraceCollector.class, TestAdministrator.class));
ACRA.init(application, builder);
ACRA.getErrorReporter().handleException(new RuntimeException());
}
Aggregations