Beispiel #1
0
        public void PrepareApplication(BaseScreen baseActivity)
        {
            _baseActivity = baseActivity;

            RootPath = baseActivity.ApplicationContext.GetExternalFilesDir(null).AbsolutePath;
            Temp     = Path.Combine(RootPath, "Temp");

            if (!Directory.Exists(RootPath))
            {
                Directory.CreateDirectory(RootPath);
            }

            string nomediaPath = Path.Combine(RootPath, ".nomedia");

            if (!File.Exists(nomediaPath))
            {
                File.Create(nomediaPath);
            }


            DeviceId = Android.Provider.Settings.Secure.GetString(Android.App.Application.Context.ContentResolver
                                                                  , Android.Provider.Settings.Secure.AndroidId);

            AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException;

            _javaExceptionsHandler = new JavaExceptionHandler();
            Java.Lang.Thread.DefaultUncaughtExceptionHandler = _javaExceptionsHandler;

            D.Init(BaseActivity.Resources.Configuration.Locale.Language);

            ISharedPreferences prefs = PreferenceManager.GetDefaultSharedPreferences(BaseActivity.BaseContext);
            var infobases            = new InfobasesScreen(BaseActivity, prefs, StartApplication);

            infobases.Start();
        }
Beispiel #2
0
        protected override void Dispose(bool disposing)
        {
            if (disposing)
            {
                Android.Runtime.AndroidEnvironment.UnhandledExceptionRaiser -= OnUnhandledManagedException;
                JavaExceptionHandler.CleanUp();
            }

            base.Dispose(disposing);
        }
        public AndroidInterceptor(BugsnagClient client)
        {
            if (client == null)
            {
                throw new ArgumentNullException("client");
            }
            this.client = client;

            AndroidEnvironment.UnhandledExceptionRaiser += HandleUnhandledManagedException;
            JavaExceptionHandler.Install(client);
        }
Beispiel #4
0
        public BugsnagClient(Context context, string apiKey, bool enableMetrics = true) : base(apiKey)
        {
            sendMetrics     = enableMetrics;
            androidContext  = context.ApplicationContext;
            appStartTime    = DateTime.UtcNow;
            errorsCachePath = MakeCachePath(context);
            GuessReleaseStage();

            Android.Runtime.AndroidEnvironment.UnhandledExceptionRaiser += OnUnhandledManagedException;
            JavaExceptionHandler.Install(this);
        }
Beispiel #5
0
        public void PrepareApplication(BaseScreen baseActivity)
        {
            _baseActivity = baseActivity;

            DeviceId = Android.Provider.Settings.Secure.GetString(Android.App.Application.Context.ContentResolver
                , Android.Provider.Settings.Secure.AndroidId);

            AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException;

            _javaExceptionsHandler = new JavaExceptionHandler();
            Java.Lang.Thread.DefaultUncaughtExceptionHandler = _javaExceptionsHandler;

            D.Init(_baseActivity.Resources.Configuration.Locale.Language);

            ISharedPreferences prefs = PreferenceManager.GetDefaultSharedPreferences(_baseActivity.BaseContext);
            var infobases = new InfobasesScreen(_baseActivity, prefs, StartApplication);
            infobases.Start();
        }
Beispiel #6
0
        public void PrepareApplication(BaseScreen baseActivity)
        {
            _baseActivity = baseActivity;

            DeviceId = Android.Provider.Settings.Secure.GetString(Android.App.Application.Context.ContentResolver
                                                                  , Android.Provider.Settings.Secure.AndroidId);

            AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException;

            _javaExceptionsHandler = new JavaExceptionHandler();
            Java.Lang.Thread.DefaultUncaughtExceptionHandler = _javaExceptionsHandler;

            D.Init(_baseActivity.Resources.Configuration.Locale.Language);

            ISharedPreferences prefs = PreferenceManager.GetDefaultSharedPreferences(_baseActivity.BaseContext);
            var infobases            = new InfobasesScreen(_baseActivity, prefs, StartApplication);

            infobases.Start();
        }
 public void Dispose()
 {
     JavaExceptionHandler.CleanUp();
     AndroidEnvironment.UnhandledExceptionRaiser -= HandleUnhandledManagedException;
 }
Beispiel #8
0
        public void PrepareApplication(BaseScreen baseActivity)
        {
            _baseActivity = baseActivity;

            RootPath = baseActivity.ApplicationContext.GetExternalFilesDir(null).AbsolutePath;
            Temp = Path.Combine(RootPath, "Temp");

            if (!Directory.Exists(RootPath))
                Directory.CreateDirectory(RootPath);

            string nomediaPath = Path.Combine(RootPath, ".nomedia");
            if (!File.Exists(nomediaPath))
                File.Create(nomediaPath);


            DeviceId = Android.Provider.Settings.Secure.GetString(Android.App.Application.Context.ContentResolver
                , Android.Provider.Settings.Secure.AndroidId);

            AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException;

            _javaExceptionsHandler = new JavaExceptionHandler();
            Java.Lang.Thread.DefaultUncaughtExceptionHandler = _javaExceptionsHandler;

            D.Init(BaseActivity.Resources.Configuration.Locale.Language);

            ISharedPreferences prefs = PreferenceManager.GetDefaultSharedPreferences(BaseActivity.BaseContext);
            var infobases = new InfobasesScreen(BaseActivity, prefs, StartApplication);
            infobases.Start();
        }