Esempio n. 1
0
        public override void OnCreate()
        {
            base.OnCreate();

            var config = new ImageLoaderConfiguration.Builder(this)
                         .MemoryCacheExtraOptions(DroidConstants.ImageSize, DroidConstants.ImageSize) // default = device screen dimensions
                         .DiskCacheExtraOptions(DroidConstants.ImageSize, DroidConstants.ImageSize, null)
                         .ThreadPoolSize(10)                                                          // default
                         .ThreadPriority(Thread.NormPriority - 2)                                     // default
                         .TasksProcessingOrder(QueueProcessingType.Fifo)                              // default
                         .MemoryCacheSize(20 * 1024 * 1024)
                         .MemoryCacheSizePercentage(30)                                               // default
                         .DiskCacheSize(50 * 1024 * 1024)
                         .DiskCacheFileCount(300)
                         .WriteDebugLogs()
                         .Build();

            ImageLoader.Instance.Init(config);
            Crittercism.Init(ApplicationContext, "1c2c97937d6f4d0aa6235204ae512f4000555300");

            GcmClient.CheckDevice(this);
            GcmClient.CheckManifest(this);
            GcmClient.Register(this, GcmBroadcastReceiver.SENDER_IDS);

            var handler = new ApplicationLifecycleHandler();

            RegisterActivityLifecycleCallbacks(handler);
            RegisterComponentCallbacks(handler);
        }
Esempio n. 2
0
        public override bool FinishedLaunching(UIApplication application, NSDictionary launchOptions)
        {
            // create a new window instance based on the screen size
            Window = new UIWindow(UIScreen.MainScreen.Bounds);

            // If you have defined a root view controller, set it here:
            // Window.RootViewController = myViewController;

            Stripe.StripeClient.DefaultPublishableKey = AppConstants.StripeAPIKey;

            MapServices.ProvideAPIKey("AIzaSyAiBwRUm_KZDv_sp3eI7F8hxkePqDTvY20");

            presenter = IsPad ? (IMvxTouchViewPresenter) new PadPresenter(this, Window) : (IMvxTouchViewPresenter) new PhonePresenter(this, Window);

            var setup = new Setup(this, presenter);

            setup.Initialize();

            //get last used language
            var language = NSUserDefaults.StandardUserDefaults.StringForKey(AppConstants.Language);

            if (string.IsNullOrEmpty(language))
            {
                Mvx.Resolve <IMvxTextProviderBuilder>().LoadResources(string.Empty);
            }
            else
            {
                Mvx.Resolve <IMvxTextProviderBuilder>().LoadResources(language);
            }

            var startup = Mvx.Resolve <IMvxAppStart>();

            startup.Start();

            // make the window visible
            Window.MakeKeyAndVisible();

            //customize navigation bar
            UINavigationBar.Appearance.BarTintColor        = UIColor.FromRGB(35, 137, 203);
            UINavigationBar.Appearance.TintColor           = UIColor.White;
            UINavigationBar.Appearance.TitleTextAttributes = new UIStringAttributes(new NSDictionary(UIStringAttributeKey.ForegroundColor, UIColor.White));
            UIApplication.SharedApplication.SetStatusBarStyle(UIStatusBarStyle.LightContent, false);


            //customize tab bar
            var textAttributes = new UITextAttributes();

            textAttributes.Font = UIFont.FromName("HelveticaNeue-Bold", 17f);
            textAttributes.Font = FontHelper.AdjustFontSize(textAttributes.Font);
            UITabBarItem.Appearance.SetTitleTextAttributes(textAttributes, UIControlState.Normal);

            //initialize Crittercism
            #if DEBUG
            #else
            Crittercism.Init("55fcbf338d4d8c0a00d07a12");
            #endif


            return(true);
        }
 private void Application_Startup(object sender, StartupEventArgs e)
 {
     //// Call the Init of the unhandled managed class library "Crittercism"
     Crittercism.Init("YOUR APP ID GOES HERE");
     //CRFilter filter=CRFilter.FilterWithString("doYouLoveCrittercism");
     //Crittercism.AddFilter(filter);
     Crittercism.LeaveBreadcrumb("Application_Startup");
 }
 static void Main()
 {
     Application.EnableVisualStyles();
     Application.SetCompatibleTextRenderingDefault(false);
     Crittercism.Init("YOUR APP ID GOES HERE");
     (new Form1()).Show();
     Application.Run();
 }
Esempio n. 5
0
 static void Main()
 {
     Application.EnableVisualStyles();
     Application.SetCompatibleTextRenderingDefault(false);
     Crittercism.Init("537a4e738039805d82000002");
     (new MainWindow()).Show();
     Application.Run();
 }
Esempio n. 6
0
 private void Application_Startup(object sender, StartupEventArgs e)
 {
     //// Call the Init of the unhandled managed class library "Crittercism"
     Crittercism.Init("537a4e738039805d82000002");
     //CRFilter filter=CRFilter.FilterWithString("doYouLoveCrittercism");
     //Crittercism.AddFilter(filter);
     Crittercism.LeaveBreadcrumb("Application_Startup");
     Crittercism.UserflowTimeOut += UserflowTimeOutHandler;
 }
    public override IEnumerator PerformFirstPass()
    {
        GameObject  gameObject  = Service.Get <GameObject>();
        Crittercism crittercism = gameObject.GetComponent <Crittercism>();

        if (crittercism == null)
        {
            crittercism = gameObject.AddComponent <Crittercism>();
        }
        Service.Set(crittercism);
        if (new DateTime(2018, 12, 21, 0, 0, 0).Date < DateTime.Now.Date || Service.Get <GameSettings>().OfflineMode)
        {
            crittercism.Init(postShudown: true, new NullErrorLogger());
            yield break;
        }
        StandaloneErrorLogger errorLogger = new StandaloneErrorLogger();

        crittercism.Init(postShudown: false, errorLogger);
    }
 public static void StartApp(bool optOutStatus)
 {
     // Convenient for the OptOutTest which must pass optOutStatus = true
     if (Crittercism.TestNetwork == null)
     {
         // First time being called by the test suite.
         Cleanup();
     }
     Crittercism.SetOptOutStatus(optOutStatus);
     Crittercism.Init(VALID_APPID);
 }
 public static void Main(string[] args)
 {
     Crittercism.Init("537a4e738039805d82000002");
     try {
         Console.WriteLine("ConsoleApp Demo");
         Help();
         CommandLoop();
     } catch (Exception e) {
         // Log a Crash .
         Crittercism.LogUnhandledException(e);
     }
     Crittercism.Shutdown();
 }
 public static void Main(string[] args)
 {
     Crittercism.Init("YOUR APP ID GOES HERE");
     try {
         Console.WriteLine("ConsoleApp Demo");
         Help();
         CommandLoop();
     } catch (Exception e) {
         // Log a Crash .
         Crittercism.LogUnhandledException(e);
     }
     Crittercism.Shutdown();
 }
Esempio n. 11
0
        private static void OnBeforeSceneLoadRuntimeMethod()
                #endif
        {
            if (isInitialized == false)
            {
#if !ENABLE_LOGS
                Debug.unityLogger.logEnabled = false;
                Ximmerse.InputSystem.XDevicePlugin.s_isLogEnabled = false;
#endif

                //init app config
                IApplicationConfig ApplicationConfig = new Config();

#if !UNITY_EDITOR_WIN
                //init analytics
                Analytics.Init(ApplicationConfig.GetPlatformConfig(ServiceType.Swrve));

                //init Crittercism
                Crittercism.Init(ApplicationConfig.GetPlatformConfig(ServiceType.Apteligent).Id);
                Crittercism.SetLogUnhandledExceptionAsCrash(false);
#endif

#if !UNITY_EDITOR
                //init KpiTracking
                KpiTracking.InitKpiTracking();
#endif

                //init remote logging
                                #if !RC_BUILD
                remoteLogger = new LogRemote(DefaultLogRemotePort);
                Log.Debug("remoteLogger = " + remoteLogger);

                SceneManager.sceneLoaded += OnSceneLoaded;
                                #endif

                                #if !SKU_CHINA
                DownloadController.PurgeCpipeCache();
                                #endif

                isInitialized = true;
            }
        }
Esempio n. 12
0
 // Code to execute when the application is launching (eg, from Start)
 // This code will not execute when the application is reactivated
 private void Application_Launching(object sender, LaunchingEventArgs e)
 {
     //// Call the Init of the unhandled managed class library "Crittercism"
     Crittercism.Init("YOUR APP ID GOES HERE");
     Crittercism.LeaveBreadcrumb("Start the application");
 }
Esempio n. 13
0
        protected override void OnCreate(Bundle bundle)
        {
            // Initialize Crittercism
            Crittercism.Init(ApplicationContext, "YOUR APP ID GOES HERE");

            base.OnCreate(bundle);

            SetContentView(Resource.Layout.Main);

            Button ButtonLeaveBreadcrumb = FindViewById <Button>(Resource.Id.ButtonBreadcrumb);

            ButtonLeaveBreadcrumb.Click += delegate(object sender, EventArgs e) {
                Crittercism.LeaveBreadcrumb("My Breadcrumb");
            };

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

            ButtonSetUserName.Click += delegate {
                Crittercism.SetUserName("MrsCritter");
            };

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

            ButtonSetMetadata.Click += delegate {
                Crittercism.SetMetadata("Game Level", "5");
            };

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

            ButtonCrash.Click += delegate(object sender, EventArgs e) {
                CrashInnerException();
                //CrashDivideByZero();
                //CrashNullReference();
                //CrashIndexOutOfRange();
                //CrashCustomException();
            };

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

            ButtonHandledException.Click += delegate(object sender, EventArgs e) {
                try {
                    CrashInnerException();
                } catch (System.Exception error) {
                    Crittercism.LogHandledException(error);
                }
            };

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

            ButtonLogNetworkRequest.Click += delegate(object sender, EventArgs e) {
                Random   random  = new Random();
                string[] methods = { "GET", "POST", "HEAD" };
                string   method  = methods[random.Next(methods.Length)];
                string[] urls    = { "http://www.critterwebservice.com",
                                     "http://www.crittersearchengine.com/?ilove=critters",
                                     "http://www.critterdatingservice.com/nutlovers",
                                     "http://www.crittergourmetfood.com/nutsandberries.htm",
                                     "http://www.critterworldnews.com/summerfun",
                                     "http://www.crittermoviereviews.com/starring=mrscritter",
                                     "http://www.critterburrowdecor.com" };
                string   url           = urls[random.Next(urls.Length)];
                int[]    responseCodes = { 200, 202, 400, 404 };
                int      responseCode  = responseCodes[random.Next(responseCodes.Length)];
                Crittercism.LogNetworkRequest(
                    method,
                    url,
                    (long)(1000 * random.NextDouble()),
                    random.Next(10000),
                    random.Next(1000),
                    responseCode,
                    0);
            };

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

            ButtonBeginTransaction.Click += delegate(object sender, EventArgs e) {
                Crittercism.BeginUserflow("Exercise");
            };

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

            ButtonEndTransaction.Click += delegate(object sender, EventArgs e) {
                Crittercism.EndUserflow("Exercise");
            };

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

            ButtonFailTransaction.Click += delegate(object sender, EventArgs e) {
                Crittercism.FailUserflow("Exercise");
            };

            Button ButtonSetTransactionValue = FindViewById <Button>(Resource.Id.ButtonSetTransactionValue);
            Button ButtonGetTransactionValue = FindViewById <Button>(Resource.Id.ButtonGetTransactionValue);

            ButtonSetTransactionValue.Click += delegate(object sender, EventArgs e) {
                Random random = new Random();
                Crittercism.SetUserflowValue("Exercise", random.Next(1000));
            };
            ButtonGetTransactionValue.Click += delegate(object sender, EventArgs e) {
                int value = Crittercism.GetUserflowValue("Exercise");
                ButtonGetTransactionValue.Text = value.ToString();
            };
        }
Esempio n. 14
0
        // class-level declarations

        public override bool FinishedLaunching(UIApplication application, NSDictionary launchOptions)
        {
            // Initialize Crittercism
            Crittercism.Init("YOUR APP ID GOES HERE");
            return(true);
        }
        /// <summary>
        /// Invoked when the application is launched normally by the end user.  Other entry points
        /// will be used when the application is launched to open a specific file, to display
        /// search results, and so forth.
        /// </summary>
        /// <param name="e">Details about the launch request and process.</param>
        protected async override void OnLaunched(LaunchActivatedEventArgs e)
        {
#if DEBUG
            if (System.Diagnostics.Debugger.IsAttached)
            {
                this.DebugSettings.EnableFrameRateCounter = true;
            }
#endif

            Frame rootFrame = Window.Current.Content as Frame;

            // Do not repeat app initialization when the Window already has content,
            // just ensure that the window is active
            if (rootFrame == null)
            {
                // Create a Frame to act as the navigation context and navigate to the first page
                rootFrame = new Frame();

                //Associate the frame with a SuspensionManager key
                SuspensionManager.RegisterFrame(rootFrame, "AppFrame");

                // TODO: change this value to a cache size that is appropriate for your application
                rootFrame.CacheSize = 1;

                if (e.PreviousExecutionState == ApplicationExecutionState.Terminated)
                {
                    // Restore the saved session state only when appropriate
                    try
                    {
                        await SuspensionManager.RestoreAsync();
                    }
                    catch (SuspensionManagerException)
                    {
                        // Something went wrong restoring state.
                        // Assume there is no state and continue
                    }
                }

                // Place the frame in the current Window
                Window.Current.Content = rootFrame;
            }

            if (rootFrame.Content == null)
            {
#if WINDOWS_PHONE_APP
                // Removes the turnstile navigation for startup.
                if (rootFrame.ContentTransitions != null)
                {
                    this.transitions = new TransitionCollection();
                    foreach (var c in rootFrame.ContentTransitions)
                    {
                        this.transitions.Add(c);
                    }
                }

                rootFrame.ContentTransitions = null;
                rootFrame.Navigated         += this.RootFrame_FirstNavigated;
#endif

                // When the navigation stack isn't restored navigate to the first page,
                // configuring the new page by passing required information as a navigation
                // parameter
                if (!rootFrame.Navigate(typeof(HubPage), e.Arguments))
                {
                    throw new Exception("Failed to create initial page");
                }
            }

            // Ensure the current window is active
            Window.Current.Activate();

            Crittercism.Init("YOUR APP ID GOES HERE");
        }
Esempio n. 16
0
 // Code to execute when the application is launching (eg, from Start)
 // This code will not execute when the application is reactivated
 private void Application_Launching(object sender, LaunchingEventArgs e)
 {
     //// Call the Init of the unhandled managed class library "Crittercism"
     Crittercism.Init("537a4e738039805d82000002");
     Crittercism.LeaveBreadcrumb("Start the application");
 }
 public void InitWithInvalidAppIdTest()
 {
     Crittercism.Init("junk_appid");
     Assert.IsFalse(Crittercism.initialized);
 }