Esempio n. 1
0
        private void SendTestHockeyApp(object sender, EventArgs e)
        {
            //throw new NotImplementedException();

            CrashManager.Register(this, "1662454962bf4523b0664e3adbfaa658");
            throw new Exception("Se cayo la Aplicacion");
        }
Esempio n. 2
0
 void InitializeHockeyApp(string hockeyAppID)
 {
     CrashManager.Register(this, hockeyAppID);
     UpdateManager.Register(this, hockeyAppID, true);
     FeedbackManager.Register(this, hockeyAppID, null);
     MetricsManager.Register(Application);
 }
Esempio n. 3
0
        protected override void OnCreate(Bundle bundle)
        {
            // register HockeyApp as the crash reporter
            CrashManager.Register(this, Settings.HockeyAppId);

            RegisterDependencies();

            Settings.OnDataPartitionPhraseChanged += (sender, e) => {
                UpdateDataSourceIfNecessary();
            };

            // Azure Mobile Services initilizatio
            Microsoft.WindowsAzure.MobileServices.CurrentPlatform.Init();

            CachedImageRenderer.Init();

            // this line is essential to wiring up the toolbar styles defined in ~/Resources/layout/toolbar.axml
            FormsAppCompatActivity.ToolbarResource = Resource.Layout.toolbar;

            base.OnCreate(bundle);

            Forms.Init(this, bundle);

            FormsMaps.Init(this, bundle);

            LoadApplication(new App());
        }
Esempio n. 4
0
        protected override void OnCreate(Bundle bundle)
        {
            IoCManager.RegisterType <IImageDimension, AndroidImageDimensions>();

            TabLayoutResource = Resource.Layout.Tabbar;
            ToolbarResource   = Resource.Layout.Toolbar;

            SetTheme(Resource.Style.MainTheme);
            base.OnCreate(bundle);

            // Init Navigation
            NavigationService.Instance.RegisterViewModels(typeof(MainPage).Assembly);
            IoCManager.RegisterInstance(typeof(INavigationService), NavigationService.Instance);
            IoCManager.RegisterInstance(typeof(IViewCreator), NavigationService.Instance);

            // init other inversion of control classes
            IoCManager.RegisterInstance(typeof(IFabSizeCalculator), new AndroidFabSizeCalculator());
            IoCManager.RegisterInstance(typeof(IAudioPlayer), new DroidAudioPlayer());
            IoCManager.RegisterInstance(typeof(IStatusBarController), new DroidStatusBarController());
            IoCManager.RegisterInstance(typeof(ILocationManager), new LocationManager());
            IoCManager.RegisterInstance(typeof(IKeyProvider), new AndroidKeyProvider());
            IoCManager.RegisterInstance(typeof(IBarsColorsChanger), new DroidBarsColorsChanger(this));

            // setup crash reporting
            IKeyProvider keyProvider = IoCManager.Resolve <IKeyProvider>();

            CrashManager.Register(this, keyProvider.GetKeyByName("hockeyapp.android"));

            // init forms and third party libraries
            CachedImageRenderer.Init();
            Xamarin.Forms.Forms.Init(this, bundle);
            Xamarin.FormsMaps.Init(this, bundle);

            LoadApplication(new App());
        }
Esempio n. 5
0
        public DownloadManager(IPinballXManager pinballXManager, IJobManager jobManager, IVpdbManager vpdbManager,
                               ISettingsManager settingsManager, IMessageManager messageManager, IDatabaseManager databaseManager,
                               ILogger logger, CrashManager crashManager)
        {
            _pinballXManager = pinballXManager;
            _jobManager      = jobManager;
            _vpdbManager     = vpdbManager;
            _settingsManager = settingsManager;
            _messageManager  = messageManager;
            _databaseManager = databaseManager;
            _logger          = logger;
            _crashManager    = crashManager;

            // setup download callbacks
            jobManager.WhenDownloaded.Subscribe(OnDownloadCompleted);

            // setup flavor matchers as soon as settings are available.
            _settingsManager.Settings.WhenAny(
                s => s.DownloadOrientation,
                s => s.DownloadOrientationFallback,
                s => s.DownloadLighting,
                s => s.DownloadLightingFallback,
                (a, b, c, d) => Unit.Default).Subscribe(_ =>
            {
                _logger.Info("Setting up flavor matchers.");
                _flavorMatchers.Clear();
                _flavorMatchers.Add(new OrientationMatcher(_settingsManager.Settings));
                _flavorMatchers.Add(new LightingMatcher(_settingsManager.Settings));
            });
        }
Esempio n. 6
0
        protected override void OnCreate(Bundle bundle)
        {
            base.SetTheme(Resource.Style.MainTheme);
            base.OnCreate(bundle);

            if (App.Instance != null)
            {
                LoadApplication(App.Instance);
            }
            else
            {
                TabLayoutResource = Resource.Layout.Tabbar;
                ToolbarResource   = Resource.Layout.Toolbar;

                InitDependenciesBeforeLibraries();

                Forms.SetFlags("FastRenderers_Experimental");
                global::Xamarin.Forms.Forms.Init(this, bundle);

                InitDependenciesAfterLibraries();
                RegisterDependencies();

                CrashManager.Register(this, AppConstants.IdHockeyAppAndroid, new XpinnCrashManagerListener());
                MetricsManager.Register(Application, AppConstants.IdHockeyAppAndroid);

                LoadApplication(new App());
            }

            FirebasePushNotificationManager.ProcessIntent(Intent);

            CheckForUpdates();
        }
Esempio n. 7
0
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            View view = null;

            try
            {
                view = inflater.Inflate(Resource.Layout.fragment_home, container, false);

                InitializeViews(view);

                CrashManager.Register(Activity);
                MetricsManager.Register(Activity, Activity.Application);

                HomeActivity homeActivity = (HomeActivity)Activity;

                if (homeActivity.firstOpen)
                {
                    RequestProfile(true);
                    homeActivity.firstOpen = false;
                }
                else
                {
                    RequestProfile(false);
                }
            }
            catch (Exception exception)
            {
                InsightsUtils.LogException(exception);
            }

            return(view);
        }
Esempio n. 8
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            // Set our view from the "main" layout resource
            SetContentView(Resource.Layout.Main);

            // Get our button from the layout resource,
            // and attach an event to it
            startButton = FindViewById <Button>(Resource.Id.startButton);

            startButton.Click += delegate {
                StartService(new Intent(this, typeof(CollectService)));
                HockeyApp.MetricsManager.TrackEvent("Click button to start to collect data");
                Toast.MakeText(this, startButton.Text, ToastLength.Short).Show();

                SetUIState();
            };

            stopButton = FindViewById <Button>(Resource.Id.stopButton);

            stopButton.Click += delegate
            {
                StopService(new Intent(this, typeof(CollectService)));
                HockeyApp.MetricsManager.TrackEvent("Click button to stop collecting");
                Toast.MakeText(this, stopButton.Text, ToastLength.Short).Show();

                SetUIState();
            };

            SetUIState();

            CrashManager.Register(this, "9a8084607e66447184a693b8c8775734");
            MetricsManager.Register(Application, "9a8084607e66447184a693b8c8775734");
        }
Esempio n. 9
0
 public override void OnCreate()
 {
     base.OnCreate();
     Utils.Context = ApplicationContext;
     CrashManager.Initialize(this);
     CrashManager.AttachSender(() => new WorkingReportSender());
 }
Esempio n. 10
0
        /// <summary>
        /// Constructor sets up queue and creates download folder if non-existing.
        /// </summary>
        public JobManager(IDatabaseManager databaseManager, IMessageManager messageManager, IThreadManager threadManager, ILogger logger, CrashManager crashManager)
        {
            _databaseManager = databaseManager;
            _messageManager  = messageManager;
            _threadManager   = threadManager;
            _logger          = logger;
            _crashManager    = crashManager;

            // setup transfer queue
            _queue = _jobs
                     .Do(job => _logger.Info("----- Added job {0} to active transfers.", job.File.Name))
                     .ObserveOn(Scheduler.Default)
                     .Select(job => Observable.DeferAsync(async token => Observable.Return(await ProcessDownload(job, token))))
                     .Merge(MaximalSimultaneousDownloads)
                     .Subscribe(job => {
                _databaseManager.SaveJob(job);

                if (job.Status != Job.JobStatus.Aborted)
                {
                    _whenDownloaded.OnNext(job);
                }
            }, error => {
                // todo treat error in ui
                _logger.Error(error, "Error: {0}", error.Message);
            });

            // save job when status changes
            _whenStatusChanged.Sample(TimeSpan.FromMilliseconds(200)).Subscribe(_databaseManager.SaveJob);

            if (!Directory.Exists(_downloadPath))
            {
                _logger.Info("Creating non-existing download folder at {0}.", _downloadPath);
                Directory.CreateDirectory(_downloadPath);
            }
        }
        protected override void OnCreate(Bundle bundle)
        {
            TabLayoutResource = Resource.Layout.tabs;
            ToolbarResource   = Resource.Layout.toolbar;
//#if DEBUG
//      StrictMode.SetThreadPolicy(new StrictMode.ThreadPolicy.Builder().DetectAll().PenaltyLog().Build());
//      StrictMode.SetVmPolicy(new StrictMode.VmPolicy.Builder().DetectLeakedSqlLiteObjects().DetectLeakedClosableObjects().PenaltyLog().PenaltyDeath().Build());
//#endif
            base.OnCreate(bundle);

            global::Xamarin.Forms.Forms.Init(this, bundle);
            var cv       = typeof(Xamarin.Forms.CarouselView);
            var assembly = Assembly.Load(cv.FullName);

            LoadApplication(new Forms.App(new AndroidInitializer()));

            CrashManager.Register(this);
            MetricsManager.Register(Application);

            switch (Device.Idiom)
            {
            case TargetIdiom.Phone:
                RequestedOrientation = ScreenOrientation.Portrait;
                break;

            case TargetIdiom.Tablet:
                RequestedOrientation = ScreenOrientation.User;
                break;
            }

            CheckForUpdates();
        }
Esempio n. 12
0
 protected override void OnResume()
 {
     base.OnResume();
     CrashManager.Register(this,
                           "9eb7234e26894815aeb83b60e7bf10bf",
                           new CustomCrashListener());
 }
Esempio n. 13
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            // Register the crash manager before Initializing the trace writer
            CrashManager.Register(this, HOCKEYAPP_APPID);

            // Register to with the Update Manager
            UpdateManager.Register(this, HOCKEYAPP_APPID);

            // Register MetricsManager to be able to use the Metrics Feature.
            MetricsManager.Register(Application, HOCKEYAPP_APPID);

            // Set our view from the "main" layout resource
            SetContentView(Resource.Layout.Main);

            FindViewById <Button> (Resource.Id.buttonShowFeedback).Click += delegate {
                //Register with the feedback manager
                FeedbackManager.Register(this, HOCKEYAPP_APPID, null);

                //Show the feedback screen
                FeedbackManager.ShowFeedbackActivity(this);
            };

            FindViewById <Button>(Resource.Id.buttonCauseCrash).Click += delegate {
                // Throw a deliberate sample crash
                throw new HockeyAppSampleException("You intentionally caused a crash!");
            };

            FindViewById <Button>(Resource.Id.buttonTrackEvent).Click += delegate
            {
                MetricsManager.TrackEvent("My custom event.");
            };
        }
Esempio n. 14
0
 /// <summary>
 /// Initalize the hockey application crashes tracing
 /// </summary>
 public void InitHockeyInsights()
 {
     //instantiate the hockey application for crashes reporting
     CrashManager.Register(this, _hockeyAppId);
     MetricsManager.Register(this, this, _hockeyAppId);
     MetricsManager.EnableUserMetrics(); //metrics for user activities
 }
Esempio n. 15
0
        public static void HockeyAppRegister(Context context)
        {
            string HOCKEYAPP_APPID = "2cc7cd8bfee64eccba506378485ce46f";

            CrashManager.Register(context, HOCKEYAPP_APPID);
            MetricsManager.Register(((Activity)context).Application, HOCKEYAPP_APPID);
        }
Esempio n. 16
0
        protected override void OnCreate(Bundle bundle)
        {
            TabLayoutResource = Resource.Layout.Tabbar;
            ToolbarResource   = Resource.Layout.Toolbar;

            base.OnCreate(bundle);

            global::Xamarin.Forms.Forms.Init(this, bundle);
            LoadApplication(new App());

            // 註冊程式異常崩壞的回報機制
            CrashManager.Register(this, HocKeyApp_ID);

            // 檢查是否有新版本推出,讓使用者可以選擇是否要升級
            CheckForUpdates();

            // 訊息中心訂閱者,當使用者在核心PCL內按下按鈕之後,訊息中心將會收到這個訊息通知,並且進行處理
            MessagingCenter.Subscribe <我要回報>(this, "是的,請說", (sender) =>
            {
                #region 讓使用者填寫意見,並記錄到 HocKeyApp
                FeedbackManager.Register(this, HocKeyApp_ID);
                FeedbackManager.ShowFeedbackActivity(ApplicationContext);
                #endregion
            });
        }
 protected override void OnCreate(Bundle savedInstanceState)
 {
     ActivityExtensions.CustomTypeface = ActivityExtensions.CustomTypeface ?? Typeface.CreateFromAsset(Application.Context.Assets, "Roboto-Regular.ttf");
     base.OnCreate(savedInstanceState);
     ImageService.Instance.Config.SchedulerMaxParallelTasks = 10;
     CrashManager.Register(this, "46de58f4a58f4f41a124f33d98c6f30d");
     // Create your application here
 }
Esempio n. 18
0
        public void Init()
        {
#if !DEBUG
            CrashManager.Register(_context, Secrets.AndroidHockeyId, new HockeyListener());
            MetricsManager.Register(_app, Secrets.AndroidHockeyId);
            MetricsManager.EnableUserMetrics();
#endif
        }
        public async Task InitAsync(Context context)
        {
            _userId = await _userService.GetUserIdAsync();

            _appId = await _appIdService.GetAppIdAsync();

            CrashManager.Register(context, HockeyAppId, this);
        }
Esempio n. 20
0
        static void configureHockeyApp(Context context, Application application)
        {
            CrashManager.Register(context, PrivateKeys.HockeyApiKey_Droid);

            // UpdateManager.Register(this, PrivateKeys.HockeyApiKey_Droid);

            MetricsManager.Register(context, application, PrivateKeys.HockeyApiKey_Droid);
        }
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            CrashManager.Register(this);

            global::Xamarin.Forms.Forms.Init(this, bundle);
            LoadApplication(new App());
        }
Esempio n. 22
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            global::Xamarin.Forms.Forms.Init(this, bundle);
            CrashManager.Register(this, "49f5777393654680bbe45710cc4ab87e");

            LoadApplication(new App());
        }
Esempio n. 23
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            CrashManager.Register(this, LoggerConfig.HockeyAppDroid);

            global::Xamarin.Forms.Forms.Init(this, bundle);
            LoadApplication(new XFHockeyApp.App());
        }
Esempio n. 24
0
        protected override void OnResume()
        {
            base.OnResume();

            // Code for HockeyApp
            CrashManager.Register(this);
            HockeyLog.LogLevel = 3;
            MetricsManager.Register(Application);
        }
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            CrashManager.Register(this, HOCKEYAPP_APPID);

            // Set our view from the "main" layout resource
            // SetContentView (Resource.Layout.YourMainView);
        }
Esempio n. 26
0
        public App()
        {
            _logger.Info("Starting application.");
            CommandLineOptions = new Options();
            Parser.Default.ParseArguments(Environment.GetCommandLineArgs(), CommandLineOptions);

            // crash handling
            CrashManager = new CrashManager(_logger);
            DispatcherUnhandledException += CrashManager.OnDispatcherUnhandledException;
        }
Esempio n. 27
0
 public Startup(
     IEventAggregator events,
     ICaptureEngine captureEngine,
     CrashManager crashManager)
 {
     this.events        = events;
     this.captureEngine = captureEngine;
     captureEngine.UnhandledException += (s, e) => crashManager.HandleException(e.ExceptionObject as Exception);
     Application.Current.Exit         += CurrentOnExit;
 }
Esempio n. 28
0
 public VpdbClient(ISettingsManager settingsManager, IVersionManager versionManager, IMessageManager messageManager,
                   IScreen screen, ILogger logger, CrashManager crashManager)
 {
     _settingsManager = settingsManager;
     _versionManager  = versionManager;
     _messageManager  = messageManager;
     _logger          = logger;
     _screen          = screen;
     _crashManager    = crashManager;
 }
Esempio n. 29
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            global::Xamarin.Forms.Forms.Init(this, bundle);
            Microsoft.WindowsAzure.MobileServices.CurrentPlatform.Init();
            LoadApplication(new App());

            CrashManager.Register(this);
            CheckForUpdates();
        }
Esempio n. 30
0
        protected override void OnCreate(Bundle bundle)
        {
            var dataAccess = IoCManager.Resolve <IDataAccess>();

            if (Settings.ShouldDeleteDbOnLaunch)
            {
                File.Delete(dataAccess.DatabasePath);
                Settings.ShouldDeleteDbOnLaunch = false;
            }

            dataAccess.CreateDatabase(0); // ensures the database exists and is up to date

            IoCManager.RegisterType <IImageDimension, AndroidImageDimensions>();
            IoCManager.RegisterType <IAppCloser, AndroidAppCloser>();

            TabLayoutResource = Resource.Layout.Tabbar;
            ToolbarResource   = Resource.Layout.Toolbar;

            SetTheme(Resource.Style.MainTheme);
            Window.SetStatusBarColor(Android.Graphics.Color.Black);
            base.OnCreate(bundle);

            // Init Navigation
            NavigationService.Instance.RegisterViewModels(typeof(MainPage).Assembly);
            IoCManager.RegisterInstance(typeof(INavigationService), NavigationService.Instance);
            IoCManager.RegisterInstance(typeof(IViewCreator), NavigationService.Instance);

            // init other inversion of control classes
            IoCManager.RegisterInstance(typeof(IFabSizeCalculator), new AndroidFabSizeCalculator());
            IoCManager.RegisterType <IAudioPlayer, DroidAudioPlayer>();
            IoCManager.RegisterInstance(typeof(INotificationPlayer), new DroidNotificationPlayer());
            IoCManager.RegisterInstance(typeof(ILocationManager), new LocationManager());
            IoCManager.RegisterInstance(typeof(IKeyProvider), new AndroidKeyProvider());
            IoCManager.RegisterInstance(typeof(IBarsColorsChanger), new DroidBarsColorsChanger(this));
            IoCManager.RegisterInstance(typeof(IDbChangedHandler), new DbChangedHandler());
            IoCManager.RegisterInstance(typeof(INetworkAccessChecker), new DroidNetworkAccessChecker());
            IoCManager.RegisterInstance(typeof(IStorageSizeProvider), new DroidStorageSizeProvider());

            // setup crash reporting
            IKeyProvider keyProvider = IoCManager.Resolve <IKeyProvider>();

            CrashManager.Register(this, keyProvider.GetKeyByName("hockeyapp.android"));

            // init forms and third party libraries
            CachedImageRenderer.Init(enableFastRenderer: true);
            Forms.Init(this, bundle);
            SvgImageViewRenderer.Init();
            CarouselViewRenderer.Init();

            UserDialogs.Init(() => (Activity)Forms.Context);

            DesignMode.IsEnabled = false;
            LoadApplication(new App());
        }