当前位置: 首页>>代码示例>>Java>>正文


Java ACRA.init方法代码示例

本文整理汇总了Java中org.acra.ACRA.init方法的典型用法代码示例。如果您正苦于以下问题:Java ACRA.init方法的具体用法?Java ACRA.init怎么用?Java ACRA.init使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.acra.ACRA的用法示例。


在下文中一共展示了ACRA.init方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: onCreate

import org.acra.ACRA; //导入方法依赖的package包/类
@Override
public void onCreate() {
    ACRA.init(this);
    HockeySender crashSender = new HockeySender();
    ACRA.getErrorReporter().setReportSender(crashSender);
    super.onCreate();
    instance = this;
    gpsDetector = new GPSDetector();
    eventApp = new EventApp();
    iriTable = new IRITable();
    measurementsDataHelper = new MeasurementsDataHelper();
    user = new User();
    iriTable.init();
    user.restore(this);
    initImageLoader();
}
 
开发者ID:WorldBank-Transport,项目名称:RoadLab-Pro,代码行数:17,代码来源:RAApplication.java

示例2: onCreate

import org.acra.ACRA; //导入方法依赖的package包/类
@Override
public void onCreate() {
    super.onCreate();
    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);
}
 
开发者ID:antest1,项目名称:kcanotify,代码行数:25,代码来源:KcaApplication.java

示例3: initACRA

import org.acra.ACRA; //导入方法依赖的package包/类
private void initACRA() {
    Log.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(new String[]{"api_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);

    ACRA.init(this, configBuilder);
}
 
开发者ID:zamojski,项目名称:TowerCollector,代码行数:21,代码来源:MyApplication.java

示例4: onCreate

import org.acra.ACRA; //导入方法依赖的package包/类
@Override
public void onCreate() {
    if (Configuration.IS_EINK_DEVICE) { // e-ink looks better with dark-on-light (esp. Nook Touch where theming breaks light-on-dark
        setTheme(R.style.Theme_AppCompat_Light);

        //This is a work-around because unit-tests call ACRA more than once.
        if (!acraInitDone) {
            ACRA.init(this);
            acraInitDone = true;
        }

    }

    super.onCreate();
    instance = this;
}
 
开发者ID:benjamarle,项目名称:typhon,代码行数:17,代码来源:Typhon.java

示例5: onCreate

import org.acra.ACRA; //导入方法依赖的package包/类
@Override
public void onCreate() {
    ACRA.init(this);
    ACRAConfiguration config = ACRA.getConfig();
    config.setFormUriBasicAuthLogin(getString(R.string.acra_login));
    config.setFormUriBasicAuthPassword(getString(R.string.acra_password));
    if (!BuildConfig.DEBUG) {
        new ANRWatchDog().setANRListener(new ANRWatchDog.ANRListener() {
            @Override
            public void onAppNotResponding(ANRError error) {
                ACRA.getErrorReporter().handleException(in.vesely.eclub.yodaqa.ANRError.New("app", false));
            }
        }).start();
    }
    super.onCreate();

}
 
开发者ID:brmson,项目名称:YodaQA-Android,代码行数:18,代码来源:YodaApplication.java

示例6: onCreate

import org.acra.ACRA; //导入方法依赖的package包/类
@Override
public void onCreate() {
    super.onCreate();
    ACRA.init(this);

    Go.init(getApplicationContext());

    String cachePath = this.getCacheDir().getAbsolutePath();
    Libcats.Init(cachePath);

    if (BuildConfig.DEBUG) {
        Timber.plant(new Timber.DebugTree());
    } else {
        Libcats.DisableDebugLogging();
    }
}
 
开发者ID:ChrisSmith,项目名称:GoCats,代码行数:17,代码来源:BaseApplication.java

示例7: onCreate

import org.acra.ACRA; //导入方法依赖的package包/类
@Override
public void onCreate() {
    mContext = getApplicationContext();
    super.onCreate();

    /**
     * The following line triggers the initialization of ACRA.
     */
    ACRA.init(this);

    /**
     * Piwik dry run. Uncomment these lines during app development.
     */
    Piwik.getInstance(this).setDryRun(BuildConfig.DEBUG);
    Piwik.getInstance(this).setDebug(BuildConfig.DEBUG);

    /**
     * Count app downloads. Fired only after new installation or upgrade.
     * It's never fired again. In fact the app is not tracking anything but installations.
     */
    if (Connectivity.isConnected(this)) {
        getTracker().trackAppDownload();
        getTracker().dispatch();
    }
}
 
开发者ID:indywidualny,项目名称:FaceSlim,代码行数:26,代码来源:MyApplication.java

示例8: onCreate

import org.acra.ACRA; //导入方法依赖的package包/类
@Override
public void onCreate()
{
    super.onCreate();

    ACRA.init(this);
    ACRA.getErrorReporter().putCustomData("PACKAGE_NAME", getPackageName());

    StrictMode.ThreadPolicy.Builder threadBuilder = new StrictMode.ThreadPolicy.Builder();
    threadBuilder.detectAll();
    threadBuilder.penaltyLog();
    StrictMode.setThreadPolicy(threadBuilder.build());

    StrictMode.VmPolicy.Builder vmBuilder = new StrictMode.VmPolicy.Builder();
    vmBuilder.detectAll();
    vmBuilder.penaltyLog();
    StrictMode.setVmPolicy(vmBuilder.build());
}
 
开发者ID:mauriciotogneri,项目名称:tpgwear,代码行数:19,代码来源:TpgWear.java

示例9: onCreate

import org.acra.ACRA; //导入方法依赖的package包/类
@Override
public void onCreate() {
    super.onCreate();

    // Migrationen durchführen
    final PreferencesMigrations preferencesMigrations = new PreferencesMigrations(getApplicationContext());
    preferencesMigrations.migrate();

    // ACRA starten
    ACRA.init(this);

    // Realm initialisieren
    Realm.init(this);
    final RealmConfiguration configuration = new RealmConfiguration.Builder()
            .migration(new DatabaseMigrations())
            .schemaVersion(3)
            .build();
    Realm.setDefaultConfiguration(configuration);

    // Updates laden
    final Thread thread = new Thread(new CheckUpdates(getApplicationContext()));
    thread.setPriority(Thread.MIN_PRIORITY);
    thread.start();
}
 
开发者ID:HTWDD,项目名称:HTWDresden,代码行数:25,代码来源:HTWDresdenApplication.java

示例10: onCreate

import org.acra.ACRA; //导入方法依赖的package包/类
@Override
public void onCreate() {
    super.onCreate();

    // Initialization of ACRA
    final int toastText = getId("toast_text");
    final String url = getText("url");
    final String username = getText("username");
    final String password = getText("password");
    Log.d(TAG, String.format("Configuration Setup: PUT_URI='%s'", url));
    final ACRAConfiguration config = ACRA.getNewDefaultConfig(this);
    config.setResToastText(toastText);
    config.setFormUri(url);
    config.setFormUriBasicAuthLogin(username);
    config.setFormUriBasicAuthPassword(password);
    ACRA.setConfig(config);
    ACRA.init(this);
}
 
开发者ID:sawatani,项目名称:Cordova-plugin-acra,代码行数:19,代码来源:AcraApplication.java

示例11: attachBaseContext

import org.acra.ACRA; //导入方法依赖的package包/类
@Override
protected void attachBaseContext(Context base) {
    super.attachBaseContext(base);


    try {
        // Initialise ACRA
        ACRA.init(this);
        ACRA.getErrorReporter().setReportSender(new ErrorFileWriter());
    } catch (Throwable t) {
        t.printStackTrace();
        //this can happen on androidx86 getExternalStorageDir is not writable or if there is a
        //permissions issue
    }


}
 
开发者ID:osmdroid,项目名称:osmdroid,代码行数:18,代码来源:OsmApplication.java

示例12: onCreate

import org.acra.ACRA; //导入方法依赖的package包/类
/**
 * We do not do any loading or starting when the application is loaded.
 * This can be requested by using useService()
 */
@Override
public void onCreate() {
    super.onCreate();
    LoadStoreIconData.onCreate(this);

    ACRAConfiguration config = ACRA.getNewDefaultConfig(this);
    config.setFormUri(getString(R.string.acralyzer_http_url));
    config.setFormUriBasicAuthLogin(getString(R.string.acralyzer_http_login));
    config.setFormUriBasicAuthPassword(getString(R.string.acralyzer_http_pwd));
    config.setReportType(HttpSender.Type.JSON);
    config.setResToastText(R.string.crash_toast_text);
    config.setBuildConfigClass(BuildConfig.class);
    try {
        config.setMode(ReportingInteractionMode.TOAST);
    } catch (ACRAConfigurationException e) {
        e.printStackTrace();
    }
    config.setCustomReportContent(new ReportField[]{ReportField.REPORT_ID, ReportField.APP_VERSION_CODE, ReportField.APP_VERSION_NAME, ReportField.PACKAGE_NAME, ReportField.PHONE_MODEL, ReportField.ANDROID_VERSION, ReportField.BUILD, ReportField.BRAND, ReportField.PRODUCT, ReportField.TOTAL_MEM_SIZE, ReportField.AVAILABLE_MEM_SIZE, ReportField.CUSTOM_DATA, ReportField.STACK_TRACE, ReportField.USER_COMMENT, ReportField.USER_APP_START_DATE, ReportField.USER_CRASH_DATE, ReportField.USER_EMAIL, ReportField.IS_SILENT, ReportField.DEVICE_FEATURES, ReportField.SHARED_PREFERENCES, ReportField.THREAD_DETAILS});
    ACRA.setConfig(config);
    ACRA.init(this);

    lifecycleHandler = new LifecycleHandler();
    registerActivityLifecycleCallbacks(lifecycleHandler);
}
 
开发者ID:davidgraeff,项目名称:Android-NetPowerctrl,代码行数:29,代码来源:App.java

示例13: onCreate

import org.acra.ACRA; //导入方法依赖的package包/类
@Override
public void onCreate() {
    super.onCreate();
    mContext = this;
    mInstance = this;

    // The following line triggers the initialization of ACRA
    ACRA.init(this);
}
 
开发者ID:feup-infolab,项目名称:labtablet,代码行数:10,代码来源:LabTablet.java

示例14: attachBaseContext

import org.acra.ACRA; //导入方法依赖的package包/类
@Override
protected void attachBaseContext(Context base) {
	super.attachBaseContext(base);

	final ACRAConfiguration config;
	try {
		config = new ConfigurationBuilder(this)
                   .setCustomReportContent(
                   		ReportField.REPORT_ID,
                   		ReportField.APP_VERSION_CODE,
                   		ReportField.APP_VERSION_NAME,
                   		ReportField.PHONE_MODEL,
                   		ReportField.ANDROID_VERSION,
                   		ReportField.BUILD,
                   		ReportField.BRAND,
                   		ReportField.PRODUCT,
                   		ReportField.TOTAL_MEM_SIZE,
                   		ReportField.AVAILABLE_MEM_SIZE,
                   		ReportField.BUILD_CONFIG,
                   		ReportField.STACK_TRACE,
                   		ReportField.STACK_TRACE_HASH,
                   		ReportField.DISPLAY,
                   		ReportField.USER_COMMENT,
                   		ReportField.USER_APP_START_DATE,
                   		ReportField.USER_CRASH_DATE,
                   		ReportField.DUMPSYS_MEMINFO,
                   		ReportField.INSTALLATION_ID,
                   		ReportField.DEVICE_FEATURES,
                   		ReportField.SETTINGS_SYSTEM,
                   		ReportField.SETTINGS_GLOBAL,
                   		ReportField.THREAD_DETAILS
				)
                   .build();

		ACRA.init(this, config);
	} catch (ACRAConfigurationException e) {
		e.printStackTrace();
	}
}
 
开发者ID:stuxo,项目名称:REDAndroid,代码行数:40,代码来源:REDApplication.java

示例15: attachBaseContext

import org.acra.ACRA; //导入方法依赖的package包/类
@Override
protected void attachBaseContext(Context base) {
    super.attachBaseContext(base);

    // The following line triggers the initialization of ACRA
    ACRA.init(this);
}
 
开发者ID:DorianScholz,项目名称:OpenLibre,代码行数:8,代码来源:OpenLibre.java


注:本文中的org.acra.ACRA.init方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。