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


Java ACRA.setConfig方法代码示例

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


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

示例1: 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

示例2: sendProblemReport

import org.acra.ACRA; //导入方法依赖的package包/类
private void sendProblemReport() {
	ACRAConfiguration cfg = ACRA.getConfig();
	cfg.setResDialogText(R.string.problem_dialog_text);
	cfg.setResDialogCommentPrompt(R.string.problem_dialog_comment_prompt);
	ACRA.setConfig(cfg);
	ACRA.getErrorReporter().handleException(null);

	ErrorReporter er = ACRA.getErrorReporter();
	er.putCustomData("cause", "sendProblemReport");
	er.handleException(null);

	// FIXME: we really want to restore the default strings after the report dialog
	// is finished, but changing them here would override the problem_dialog_* strings
	// set above.
	//ACRA.setConfig(ACRA.getNewDefaultConfig((Application)getApplicationContext()));
}
 
开发者ID:cernekee,项目名称:ics-openconnect,代码行数:17,代码来源:CommonMenu.java

示例3: 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

示例4: onCreate

import org.acra.ACRA; //导入方法依赖的package包/类
@Override
public void onCreate() {
  SharedPreferences themePrefs = getSharedPreferences("THEME", 0);
  Boolean isDark = themePrefs.getBoolean("isDark", false);
  if (isDark)
    setTheme(R.style.DarkTheme);
  else
    setTheme(R.style.AppTheme);

  super.onCreate();

  ACRA.init(this);

  // initialize the system
  try {
    System.init(this);
  } catch (Exception e) {
    // ignore exception when the user has wifi off
    if (!(e instanceof NoRouteToHostException))
      System.errorLogging(e);
  }

  ACRA.setConfig(ACRA.getConfig().setApplicationLogFile(System.getCorePath() + "/cSploitd.log"));

  // load system modules even if the initialization failed
  System.registerPlugin(new RouterPwn());
  System.registerPlugin(new Traceroute());
  System.registerPlugin(new PortScanner());
  System.registerPlugin(new Inspector());
  System.registerPlugin(new ExploitFinder());
  System.registerPlugin(new LoginCracker());
  System.registerPlugin(new Sessions());
  System.registerPlugin(new MITM());
  System.registerPlugin(new PacketForger());
}
 
开发者ID:Android-leak,项目名称:csploit,代码行数:36,代码来源:CSploitApplication.java

示例5: onCreate

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

	/*
	 * The following line triggers the initialization of ACRA 
	 * ACRA is used to help with debug logs etc.
	 */

	ACRA.init(this);
	ACRA.getErrorReporter().setReportSender(new CrashReporterSave(this));

	ACRAConfiguration conf = ACRA.getNewDefaultConfig(this);
	try {
		conf.setCustomReportContent(new ReportField[] { DISPLAY, USER_COMMENT, USER_EMAIL, TOTAL_MEM_SIZE, AVAILABLE_MEM_SIZE });
		conf.setResDialogCommentPrompt(R.string.crash_dialog_comment_prompt);
		conf.setResToastText(R.string.crash_toast_text);
		conf.setResDialogText(R.string.crash_dialog_text);
		conf.setResDialogEmailPrompt(R.string.crash_dialog_email_prompt);
		conf.setResDialogTitle(R.string.crash_dialog_title);
		conf.setResDialogOkToast(R.string.crash_dialog_ok_toast);
		conf.setMode(ReportingInteractionMode.DIALOG);
	} catch (ACRAConfigurationException e) {
		e.printStackTrace();
	}

	ACRA.setConfig(conf);

	// Have to call this to continue loading Android
	super.onCreate();
}
 
开发者ID:frigidplanet,项目名称:droidtowers,代码行数:31,代码来源:DroidTowersAndroidApplication.java

示例6: sendProblemReport

import org.acra.ACRA; //导入方法依赖的package包/类
private void sendProblemReport() {
	ACRAConfiguration cfg = ACRA.getConfig();
	cfg.setResDialogText(R.string.problem_dialog_text);
	cfg.setResDialogCommentPrompt(R.string.problem_dialog_comment_prompt);
	ACRA.setConfig(cfg);
	ACRA.getErrorReporter().handleException(null);

	// FIXME: we really want to restore the default strings after the report dialog
	// is finished, but changing them here would override the problem_dialog_* strings
	// set above.
	//ACRA.setConfig(ACRA.getNewDefaultConfig((Application)getApplicationContext()));
}
 
开发者ID:cernekee,项目名称:EasyToken,代码行数:13,代码来源:MainActivity.java

示例7: reportBadRom

import org.acra.ACRA; //导入方法依赖的package包/类
private void reportBadRom(Exception e) {
	ACRAConfiguration cfg = ACRA.getConfig();
	cfg.setResDialogText(R.string.bad_rom_text);
	cfg.setResDialogCommentPrompt(R.string.bad_rom_comment_prompt);
	ACRA.setConfig(cfg);

	ErrorReporter er = ACRA.getErrorReporter();
	er.putCustomData("cause", "reportBadRom");
	er.handleException(e);
}
 
开发者ID:cernekee,项目名称:ics-openconnect,代码行数:11,代码来源:GrantPermissionsActivity.java

示例8: setErrorReportContentCrash

import org.acra.ACRA; //导入方法依赖的package包/类
public static void setErrorReportContentCrash() {
    ACRAConfiguration config = ACRA.getConfig();
    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);
}
 
开发者ID:davidgraeff,项目名称:Android-NetPowerctrl,代码行数:6,代码来源:App.java

示例9: setErrorReportContentMessage

import org.acra.ACRA; //导入方法依赖的package包/类
public static void setErrorReportContentMessage() {
    ACRAConfiguration config = ACRA.getConfig();
    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.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);
}
 
开发者ID:davidgraeff,项目名称:Android-NetPowerctrl,代码行数:6,代码来源:App.java

示例10: setErrorReportContentLogFile

import org.acra.ACRA; //导入方法依赖的package包/类
public static void setErrorReportContentLogFile(String filename) {
    ACRAConfiguration config = ACRA.getConfig();
    config.setApplicationLogFile(filename);
    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.CUSTOM_DATA, ReportField.APPLICATION_LOG, ReportField.USER_COMMENT, ReportField.USER_APP_START_DATE, ReportField.USER_EMAIL, ReportField.DEVICE_FEATURES, ReportField.SHARED_PREFERENCES});
    ACRA.setConfig(config);
}
 
开发者ID:davidgraeff,项目名称:Android-NetPowerctrl,代码行数:7,代码来源:App.java


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