本文整理汇总了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();
}
示例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);
}
示例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);
}
示例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;
}
示例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();
}
示例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();
}
}
示例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();
}
}
示例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());
}
示例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();
}
示例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);
}
示例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
}
}
示例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);
}
示例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);
}
示例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();
}
}
示例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);
}