Search in sources :

Example 1 with ACRAConfigurationException

use of org.acra.config.ACRAConfigurationException in project NewPipe by TeamNewPipe.

the class App method onCreate.

@Override
public void onCreate() {
    super.onCreate();
    // init crashreport
    try {
        final ACRAConfiguration acraConfig = new ConfigurationBuilder(this).setReportSenderFactoryClasses(reportSenderFactoryClasses).build();
        ACRA.init(this, acraConfig);
    } catch (ACRAConfigurationException ace) {
        ace.printStackTrace();
        ErrorActivity.reportError(this, ace, null, null, ErrorActivity.ErrorInfo.make(ErrorActivity.SEARCHED, "none", "Could not initialize ACRA crash report", R.string.app_ui_crash));
    }
    //init NewPipe
    NewPipe.init(Downloader.getInstance());
    // Initialize image loader
    ImageLoaderConfiguration config = new ImageLoaderConfiguration.Builder(this).build();
    ImageLoader.getInstance().init(config);
    /*
        SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this);
        if(prefs.getBoolean(getString(R.string.use_tor_key), false)) {
            OrbotHelper.requestStartTor(this);
            configureTor(true);
        } else {
            configureTor(false);
        }*/
    configureTor(false);
    // DO NOT REMOVE THIS FUNCTION!!!
    // Otherwise downloadPathPreference has invalid value.
    SettingsActivity.initSettings(this);
}
Also used : ConfigurationBuilder(org.acra.config.ConfigurationBuilder) ACRAConfiguration(org.acra.config.ACRAConfiguration) ACRAConfigurationException(org.acra.config.ACRAConfigurationException) ImageLoaderConfiguration(com.nostra13.universalimageloader.core.ImageLoaderConfiguration)

Example 2 with ACRAConfigurationException

use of org.acra.config.ACRAConfigurationException in project opacclient by opacapp.

the class OpacClient method onCreate.

@Override
public void onCreate() {
    super.onCreate();
    sp = PreferenceManager.getDefaultSharedPreferences(this);
    if (!BuildConfig.DEBUG) {
        try {
            final ACRAConfiguration config = new ConfigurationBuilder(this).setResToastText(R.string.crash_toast_text).setResDialogText(R.string.crash_dialog_text).setResToastText(R.string.crash_toast_text).setResNotifTickerText(R.string.crash_notif_ticker_text).setResNotifTitle(R.string.crash_notif_title).setResNotifText(R.string.crash_notif_text).setResNotifIcon(android.R.drawable.stat_notify_error).setResDialogText(R.string.crash_dialog_text).build();
            ACRA.init(this, config);
            if (getLibrary() != null) {
                ACRA.getErrorReporter().putCustomData("library", getLibrary().getIdent());
            }
            DateTime lastUpdate = new PreferenceDataSource(getApplicationContext()).getLastLibraryConfigUpdate();
            ACRA.getErrorReporter().putCustomData("data_version", lastUpdate != null ? lastUpdate.toString() : "null");
        } catch (ACRAConfigurationException e) {
            e.printStackTrace();
        }
    }
    DebugTools.init(this);
    OpacClient.context = getApplicationContext();
    try {
        OpacClient.versionName = getPackageManager().getPackageInfo(getPackageName(), 0).versionName;
    } catch (NameNotFoundException e) {
        e.printStackTrace();
    }
    // Schedule alarms
    JobManager.create(this).addJobCreator(new SyncAccountJobCreator());
    SyncAccountJob.scheduleJob(this);
}
Also used : ConfigurationBuilder(org.acra.config.ConfigurationBuilder) NameNotFoundException(android.content.pm.PackageManager.NameNotFoundException) PreferenceDataSource(de.geeksfactory.opacclient.storage.PreferenceDataSource) ACRAConfiguration(org.acra.config.ACRAConfiguration) ACRAConfigurationException(org.acra.config.ACRAConfigurationException) DateTime(org.joda.time.DateTime) SyncAccountJobCreator(de.geeksfactory.opacclient.reminder.SyncAccountJobCreator)

Example 3 with ACRAConfigurationException

use of org.acra.config.ACRAConfigurationException in project NewPipe by TeamNewPipe.

the class App method initACRA.

private void initACRA() {
    try {
        final ACRAConfiguration acraConfig = new ConfigurationBuilder(this).setReportSenderFactoryClasses(reportSenderFactoryClasses).setBuildConfigClass(BuildConfig.class).build();
        ACRA.init(this, acraConfig);
    } catch (ACRAConfigurationException ace) {
        ace.printStackTrace();
        ErrorActivity.reportError(this, ace, null, null, ErrorActivity.ErrorInfo.make(UserAction.SOMETHING_ELSE, "none", "Could not initialize ACRA crash report", R.string.app_ui_crash));
    }
}
Also used : ConfigurationBuilder(org.acra.config.ConfigurationBuilder) ACRAConfiguration(org.acra.config.ACRAConfiguration) ACRAConfigurationException(org.acra.config.ACRAConfigurationException)

Aggregations

ACRAConfiguration (org.acra.config.ACRAConfiguration)3 ACRAConfigurationException (org.acra.config.ACRAConfigurationException)3 ConfigurationBuilder (org.acra.config.ConfigurationBuilder)3 NameNotFoundException (android.content.pm.PackageManager.NameNotFoundException)1 ImageLoaderConfiguration (com.nostra13.universalimageloader.core.ImageLoaderConfiguration)1 SyncAccountJobCreator (de.geeksfactory.opacclient.reminder.SyncAccountJobCreator)1 PreferenceDataSource (de.geeksfactory.opacclient.storage.PreferenceDataSource)1 DateTime (org.joda.time.DateTime)1