本文整理汇总了Java中org.acra.ACRAConfiguration类的典型用法代码示例。如果您正苦于以下问题:Java ACRAConfiguration类的具体用法?Java ACRAConfiguration怎么用?Java ACRAConfiguration使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ACRAConfiguration类属于org.acra包,在下文中一共展示了ACRAConfiguration类的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onHandleIntent
import org.acra.ACRAConfiguration; //导入依赖的package包/类
@Override
protected void onHandleIntent(Intent intent) {
if (intent != null) {
final String action = intent.getAction();
if (ACTION_SEND.equals(action)) {
try {
final URL url = new URL(intent.getStringExtra(EXTRA_URL));
final String content = intent.getStringExtra(EXTRA_CONTENT);
final String login = intent.getStringExtra(EXTRA_LOGIN);
final String password = intent.getStringExtra(EXTRA_PASSWORD);
ACRAConfiguration config = ACRA.getConfig();
send(url, config.httpMethod(), content, login, password);
} catch (IOException e) {
Log.e("HttpSenderService", "url", e);
}
}
}
}
示例2: onCreate
import org.acra.ACRAConfiguration; //导入依赖的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();
}
示例3: onCreate
import org.acra.ACRAConfiguration; //导入依赖的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);
}
示例4: initAcra
import org.acra.ACRAConfiguration; //导入依赖的package包/类
void initAcra() {
ReportsCrashes rc = App.class.getAnnotation(ReportsCrashes.class);
ACRAConfiguration ac = new ACRAConfiguration(rc);
if (isUiProcess()) {
ac.setReportsDir("acra-ui-reports");
} else if (isServiceProcess()) {
ac.setReportsDir("acra-service-reports");
} else if (isProviderProcess()) {
ac.setReportsDir("acra-provider-reports");
} else {
Timber.i("Running on emulator disabling crash reporting");
return;
}
if (!StringUtils.isEmpty(rc.formUri())) {
ACRA.init(this, ac);
if (!ENABLE_LOGGING) {
ACRA.setLog(new HollowLog());
}
}
}
示例5: onCreate
import org.acra.ACRAConfiguration; //导入依赖的package包/类
@Override
public void onCreate()
{
super.onCreate();
ACRA.init(this);
final ACRAConfiguration config = ACRA.getConfig();
config.setHttpMethod(Secrets.ACRA_HTTP_METHOD);
config.setReportType(Secrets.ACRA_REPORT_TYPE);
config.setFormUri(Secrets.ACRA_FORM_URI);
config.setFormUriBasicAuthLogin(Secrets.ACRA_FORM_URI_BASIC_AUTH_LOGIN);
config.setFormUriBasicAuthPassword(Secrets.ACRA_FORM_URI_BASIC_AUTH_PASSWORD);
ACRA.getErrorReporter().setDefaultReportSenders(); // see https://github.com/ACRA/acra/issues/58
if (isDebug())
{
Log.d("Application", "Disabling ACRA in debug mode");
ACRA.getErrorReporter().setEnabled(false);
}
}
示例6: sendProblemReport
import org.acra.ACRAConfiguration; //导入依赖的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()));
}
示例7: onCreate
import org.acra.ACRAConfiguration; //导入依赖的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);
}
示例8: HttpSender
import org.acra.ACRAConfiguration; //导入依赖的package包/类
public HttpSender() {
formUri = ACRA.getConfig().formUri();
login = ACRAConfiguration.isNull(ACRA.getConfig().formUriBasicAuthLogin()) ? null : ACRA
.getConfig().formUriBasicAuthLogin();
password = ACRAConfiguration.isNull(ACRA.getConfig().formUriBasicAuthPassword()) ? null : ACRA
.getConfig().formUriBasicAuthPassword();
}
示例9: onCreate
import org.acra.ACRAConfiguration; //导入依赖的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();
}
示例10: sendProblemReport
import org.acra.ACRAConfiguration; //导入依赖的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()));
}
示例11: reportBadRom
import org.acra.ACRAConfiguration; //导入依赖的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);
}
示例12: setErrorReportContentCrash
import org.acra.ACRAConfiguration; //导入依赖的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);
}
示例13: setErrorReportContentMessage
import org.acra.ACRAConfiguration; //导入依赖的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);
}
示例14: setErrorReportContentLogFile
import org.acra.ACRAConfiguration; //导入依赖的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);
}