Java Code Examples for org.acra.ACRA#init()

The following examples show how to use org.acra.ACRA#init() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: TVPortalApplication.java    From android with Apache License 2.0 6 votes vote down vote up
@Override
public void onCreate() {
    super.onCreate();
    ACRA.init(this);
    SharedPreferences mPrefs;
    mPrefs = PreferenceManager.getDefaultSharedPreferences(this);
    mPrefs.edit().putInt(ARG_LAUNCH_COUNT, (mPrefs.getInt(ARG_LAUNCH_COUNT, 0)) + 1).apply();
    //google analytics minimal just amount of install's and sessions
    mTracker = GoogleAnalytics.getInstance(this).getTracker(Config.GA_PROPERTY_ID);
    mTracker.send(MapBuilder.createEvent("UX", "appstart", null, null)
                    .set(Fields.SESSION_CONTROL, "start")
                    .build()
    );
    //Check if the user upgraded via the server:
    new AsyncTask<Void, Void, Void>() {
        @Override
        protected Void doInBackground(Void... voids) {
            AppUtils.isServerUpgraded(TVPortalApplication.this);
            return null;
        }
    }.execute();

}
 
Example 2
Source File: GeopaparazziApplication.java    From geopaparazzi with GNU General Public License v3.0 6 votes vote down vote up
@Override
protected void attachBaseContext(Context base) {
    super.attachBaseContext(base);
    try {

        ACRAConfiguration config = new ConfigurationBuilder(this) //
                .setMailTo(mailTo)//
                .setCustomReportContent(//
                        ReportField.APP_VERSION_CODE, ReportField.APP_VERSION_NAME, //
                        ReportField.ANDROID_VERSION, ReportField.PHONE_MODEL, //
                        ReportField.CUSTOM_DATA, ReportField.STACK_TRACE, ReportField.LOGCAT) //
                .setResToastText(R.string.crash_toast_text)//
                .setLogcatArguments("-t", "400", "-v", "time", "GPLOG:I", "*:S") //
                .setReportingInteractionMode(ReportingInteractionMode.TOAST)//
                .build();


        ACRA.init(this, config);
    } catch (ACRAConfigurationException e) {
        e.printStackTrace();
    }
}
 
Example 3
Source File: AndFChatApplication.java    From AndFChat with GNU General Public License v3.0 5 votes vote down vote up
@Override
public void onCreate() {
    super.onCreate();

    Intent serviceIntent = new Intent(this, AndFChatConnectionService.class);
    bindService(serviceIntent, networkServiceConnection, Context.BIND_AUTO_CREATE);

    // The following line triggers the initialization of ACRA
    ACRA.init(this);
}
 
Example 4
Source File: MosMetroApp.java    From mosmetro-android with GNU General Public License v3.0 5 votes vote down vote up
@Override
protected void attachBaseContext(Context base) {
    super.attachBaseContext(base);
    ACRA.init(this);

    if (!ACRA.isACRASenderServiceProcess()) {
        Logger.configure(base);
    }
}
 
Example 5
Source File: MyApplication.java    From TowerCollector with Mozilla Public License 2.0 5 votes vote down vote up
private void initACRA() {
    Timber.d("initACRA(): Initializing ACRA");

    CoreConfigurationBuilder configBuilder = new CoreConfigurationBuilder(this);
    // Configure connection
    configBuilder.setBuildConfigClass(BuildConfig.class);
    configBuilder.setSendReportsInDevMode(BuildConfig.ACRA_SEND_REPORTS_IN_DEV_MODE);
    configBuilder.setReportFormat(StringFormat.valueOf(BuildConfig.ACRA_REPORT_TYPE));
    configBuilder.setExcludeMatchingSharedPreferencesKeys(getString(R.string.preferences_api_key_key));
    configBuilder.setReportContent(getCustomAcraReportFields());
    // Configure reported content
    HttpSenderConfigurationBuilder httpPluginConfigBuilder = configBuilder.getPluginConfigurationBuilder(HttpSenderConfigurationBuilder.class);
    httpPluginConfigBuilder.setUri(BuildConfig.ACRA_FORM_URI);
    httpPluginConfigBuilder.setBasicAuthLogin(BuildConfig.ACRA_FORM_URI_BASIC_AUTH_LOGIN);
    httpPluginConfigBuilder.setBasicAuthPassword(BuildConfig.ACRA_FORM_URI_BASIC_AUTH_PASSWORD);
    httpPluginConfigBuilder.setHttpMethod(HttpSender.Method.valueOf(BuildConfig.ACRA_HTTP_METHOD));
    httpPluginConfigBuilder.setEnabled(true);
    // Configure interaction method
    NotificationConfigurationBuilder notificationConfigBuilder = configBuilder.getPluginConfigurationBuilder(NotificationConfigurationBuilder.class);
    notificationConfigBuilder.setResChannelName(R.string.error_reporting_notification_channel_name);
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
        notificationConfigBuilder.setResChannelImportance(NotificationManager.IMPORTANCE_DEFAULT);
    }
    notificationConfigBuilder.setResIcon(R.drawable.ic_notification);
    notificationConfigBuilder.setResTitle(R.string.error_reporting_notification_title);
    notificationConfigBuilder.setResText(R.string.error_reporting_notification_text);
    notificationConfigBuilder.setResTickerText(R.string.error_reporting_notification_title);
    notificationConfigBuilder.setResSendButtonText(R.string.dialog_send);
    notificationConfigBuilder.setResDiscardButtonText(R.string.dialog_cancel);
    notificationConfigBuilder.setSendOnClick(true);
    notificationConfigBuilder.setResSendWithCommentButtonText(R.string.dialog_send_comment);
    notificationConfigBuilder.setResCommentPrompt(R.string.error_reporting_notification_comment_prompt);
    notificationConfigBuilder.setEnabled(!getPreferencesProvider().getReportErrorsSilently());

    ACRA.init(this, configBuilder);
    ACRA.getErrorReporter().putCustomData("APP_MARKET_NAME", BuildConfig.MARKET_NAME);
}
 
Example 6
Source File: AmuleRemoteApplication.java    From aMuleRemote with GNU General Public License v3.0 5 votes vote down vote up
@Override
public void onCreate() {

    if (Flavor.ACRA_ENABLED) ACRA.init(this);

    super.onCreate();

    try {
        PackageInfo pInfo = getPackageManager().getPackageInfo(getPackageName(), 0);
        mVersionCode = pInfo.versionCode;
        mVersionName = pInfo.versionName;
        if (! Flavor.UPDATE_CHECKER_CHECK_BUILD) {
            mUpdateChecker = new UpdateChecker(mVersionCode);
        } else {
            int lastIndex = mVersionName.lastIndexOf("-");
            if (lastIndex >= 0) {
                mUpdateChecker = new UpdateChecker(mVersionCode, Long.parseLong(mVersionName.substring(lastIndex + 1)));
            } else {
                mUpdateChecker = new UpdateChecker(mVersionCode);
            }
        }
    } catch (NameNotFoundException e) {
    }

    mSettings = PreferenceManager.getDefaultSharedPreferences(this);
    mSettingsHelper = new SettingsHelper(mSettings);
    normalizeSettings();
    refreshServerSettings();
    refreshRefreshSettings();
}
 
Example 7
Source File: ZappApplication.java    From zapp with MIT License 5 votes vote down vote up
@Override
protected void attachBaseContext(Context base) {
	super.attachBaseContext(base);

	// The following line triggers the initialization of ACRA
	ACRA.init(this);
}
 
Example 8
Source File: MyApplication.java    From AndroidModulePattern with Apache License 2.0 5 votes vote down vote up
@Override
public void onCreate() {
    super.onCreate();
    if (Utils.isAppDebug()) {
        //开启InstantRun之后,一定要在ARouter.init之前调用openDebug
        ARouter.openDebug();
        ARouter.openLog();
    }
    ARouter.init(this);
    //崩溃日志记录初始化
    ACRA.init(this);
    ACRA.getErrorReporter().removeAllReportSenders();
    ACRA.getErrorReporter().setReportSender(new CrashReportSender());
}
 
Example 9
Source File: OpenLibre.java    From OpenLibre with GNU General Public License v3.0 5 votes vote down vote up
@Override
protected void attachBaseContext(Context base) {
    super.attachBaseContext(base);

    // The following line triggers the initialization of ACRA
    ACRA.init(this);
}
 
Example 10
Source File: AbstractRycApplication.java    From remoteyourcam-usb with Apache License 2.0 5 votes vote down vote up
@Override
public void onCreate() {
    if (AppConfig.USE_ACRA) {
        try {
            ACRA.init(this);
        } catch (Throwable e) {
            // no fail
        }
    }
    super.onCreate();
}
 
Example 11
Source File: ContentProviderHelper.java    From ContentProviderHelper with MIT License 5 votes vote down vote up
@Override
public void onCreate() {
	super.onCreate();

	ACRA.init(this);
	PreferenceManager.setDefaultValues(this, R.xml.preferences, false);
}
 
Example 12
Source File: KcaApplication.java    From kcanotify_h5-master with GNU General Public License v3.0 5 votes vote down vote up
@Override
public void onCreate() {
    super.onCreate();
    application = this;
    String language, country;
    defaultLocale = Locale.getDefault();
    SharedPreferences pref = getSharedPreferences("pref", MODE_PRIVATE);
    String[] pref_locale = pref.getString(PREF_KCA_LANGUAGE, "").split("-");

    if (pref_locale.length == 2) {
        if (pref_locale[0].equals("default")) {
            LocaleUtils.setLocale(defaultLocale);
        } else {
            language = pref_locale[0];
            country = pref_locale[1];
            LocaleUtils.setLocale(new Locale(language, country));
        }
    } else {
        pref.edit().remove(PREF_KCA_LANGUAGE).apply();
        LocaleUtils.setLocale(defaultLocale);
    }

    LocaleUtils.updateConfig(this, getBaseContext().getResources().getConfiguration());
    ACRA.init(this);

    /*if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) {
        String processName = getProcessName();
        if (!PROCESSNAME.equals(processName)) {
            WebView.setDataDirectorySuffix("modWeb");
        }
    }*/
}
 
Example 13
Source File: AbstractRycApplication.java    From remoteyourcam-usb with Apache License 2.0 5 votes vote down vote up
@Override
public void onCreate() {
    if (AppConfig.USE_ACRA) {
        try {
            ACRA.init(this);
        } catch (Throwable e) {
            // no fail
        }
    }
    super.onCreate();
}
 
Example 14
Source File: MainApplication.java    From Overchan-Android with GNU General Public License v3.0 5 votes vote down vote up
@Override
public void onCreate() {
    super.onCreate();
    if (ACRAConstants.ACRA_ENABLED) ACRA.init(this);
    if (isGalleryProcess()) return;
    initObjects();
    instance = this;
}
 
Example 15
Source File: Application.java    From DistroHopper with GNU General Public License v3.0 5 votes vote down vote up
@Override
protected void attachBaseContext(final Context base) {
	super.attachBaseContext(base);

	// The following line triggers the initialization of ACRA
	ACRA.init(this);
}
 
Example 16
Source File: EasyXkcdApp.java    From Easy_xkcd with Apache License 2.0 4 votes vote down vote up
@Override
protected void attachBaseContext(Context base) {
    super.attachBaseContext(base);

    ACRA.init(this);
}
 
Example 17
Source File: TvApp.java    From jellyfin-androidtv with GNU General Public License v2.0 4 votes vote down vote up
@Override
protected void attachBaseContext(Context base) {
    super.attachBaseContext(base);

    ACRA.init(this);
}
 
Example 18
Source File: KcaApplication.java    From kcanotify_h5-master with GNU General Public License v3.0 4 votes vote down vote up
@Override
protected void attachBaseContext(Context base) {
    super.attachBaseContext(base);
    MultiDex.install(this);
    ACRA.init(this);
}
 
Example 19
Source File: QuizApplication.java    From Quiz with GNU General Public License v2.0 4 votes vote down vote up
@Override
public void onCreate() {
	super.onCreate();
	QuizApplication.context = getApplicationContext();
	ACRA.init(this);
}
 
Example 20
Source File: MyApplication.java    From AndroPress with Apache License 2.0 4 votes vote down vote up
@Override
public void onCreate() {
    super.onCreate();
    ACRA.init(this);
}