Пример #1
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            Xamarin.Essentials.Platform.Init(this, savedInstanceState);
            // Set our view from the "main" layout resource
            BottomNavigationView navigation = FindViewById <BottomNavigationView>(Resource.Id.navigation);

            navigation.SetOnNavigationItemSelectedListener(this);

            // Enable Analytics Kit Log
            HiAnalyticsTools.EnableLog();
            // Generate the Analytics Instance
            instance = HiAnalytics.GetInstance(this);

            //You can also use Context initialization
            //Context context = this.ApplicationContext;
            //instance = HiAnalytics.GetInstance(context);

            // Enable collection capability
            instance.SetAnalyticsEnabled(true);

            instance.SetReportPolicies(new List <ReportPolicy> {
                ReportPolicy.OnAppLaunchPolicy
            });

            GetAAID();

            FindViewById(Resource.Id.true_button).Click  += AnswerButton_Click;
            FindViewById(Resource.Id.false_button).Click += AnswerButton_Click;
            txtQuestion = FindViewById <TextView>(Resource.Id.txtQuestion);

            RefreshUi();
        }
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            Xamarin.Essentials.Platform.Init(this, savedInstanceState);
            SetContentView(Resource.Layout.activity_main);

            //var config = AGConnectServicesConfig.FromContext(ApplicationContext);
            //config.OverlayWith(new HmsLazyInputStream(this));
            //AGConnectInstance.Initialize(ApplicationContext);

            if (CheckPermission(new string[] { Android.Manifest.Permission.Internet }, 100))
            {
                HiAnalyticsTools.EnableLog();
                _hiAnalyticsInstance = HiAnalytics.GetInstance(this);
                _hiAnalyticsInstance.SetAnalyticsEnabled(true);
            }

            _custom_scan_btn  = FindViewById <Button>(Resource.Id.custom_scan_btn);
            _classic_scan_btn = FindViewById <Button>(Resource.Id.classic_scan_btn);
            _push_btn         = FindViewById <Button>(Resource.Id.push_btn);
            _map_btn          = FindViewById <Button>(Resource.Id.map_btn);

            _map_btn.Click          += OnMapButtonClicked;
            _push_btn.Click         += OnPushButtonClicked;
            _custom_scan_btn.Click  += OnCustomScanButtonClicked;
            _classic_scan_btn.Click += OnClassicScanButtonClicked;
        }
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            instance = HiAnalytics.GetInstance(this);

            FindViewById(Resource.Id.save_setting_button).Click += Submit_Click;
        }
    void InitilizeAnalyticsInstane()
    {
        AndroidJavaClass  jc       = new AndroidJavaClass("com.unity3d.player.UnityPlayer");
        AndroidJavaObject activity = jc.GetStatic <AndroidJavaObject>("currentActivity");

        HiAnalyticsTools.EnableLog();
        instance = HiAnalytics.GetInstance(activity);
        instance.SetAnalyticsEnabled(true);
    }
Пример #5
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            SetContentView(Resource.Layout.activity_result);

            instance = HiAnalytics.GetInstance(this);


            FindViewById <TextView>(Resource.Id.txtScore).Text    += QuizData.Result + "/" + QuizData.Questions.Count * 10;
            FindViewById <Button>(Resource.Id.submitButton).Click += SubmitButton_Click;
        }
    void InitilizeAnalyticsInstane()
    {
        AndroidJavaClass  jc       = new AndroidJavaClass("com.unity3d.player.UnityPlayer");
        AndroidJavaObject activity = jc.GetStatic <AndroidJavaObject>("currentActivity");

        activity.Call("runOnUiThread", new AndroidJavaRunnable(() =>
        {
            HiAnalyticsTools.EnableLog();
            hiAnalyticsInstance = HiAnalytics.GetInstance(activity);
            hiAnalyticsInstance.SetAnalyticsEnabled(true);
        }));
    }
        public override void OnStart()
        {
            base.OnStart();
            //Create Context
            Context context = Android.App.Application.Context;

            //Generate the Analytics Instance
            instance = HiAnalytics.GetInstance(context);
            //Enable collection capability
            instance.SetAnalyticsEnabled(true);
            //Customizes a page start event.
            instance.PageStart("Order Page", "OrderFragment");
        }
Пример #8
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            Xamarin.Essentials.Platform.Init(this, savedInstanceState);
            SetContentView(Resource.Layout.activity_main);

            FetchApplyButton         = FindViewById <Button>(Resource.Id.FetchApply);
            FetchSaveButton          = FindViewById <Button>(Resource.Id.FetchSave);
            ClearButton              = FindViewById <Button>(Resource.Id.Clear);
            DeveloperMode            = FindViewById <Switch>(Resource.Id.DeveloperMode);
            ResultLog                = (TextView)FindViewById(Resource.Id.log_info);
            ResultLog.MovementMethod = ScrollingMovementMethod.Instance;

            //Set User attributes defined in AGConnect Console
            instance = HiAnalytics.GetInstance(this);
            instance.SetUserProfile("favorite_color", "Black");
            instance.SetUserProfile("favorite_food", "banana");

            AGCRemoteConfig = AGConnectConfig.Instance;

            if (AGCRemoteConfig != null)
            {
                Log.Info("RC", "AGConnectConfig instance cratead successfully.");
            }

            FetchApplyButton.Click += delegate { FetchApply(); };
            FetchSaveButton.Click  += delegate { LoadLastFetchedConfig(); };
            ClearButton.Click      += delegate {
                AGCRemoteConfig.ClearAll();
                Logger("All Values Cleared", TAG);
                ApplyDefualtByMap();
                ShowAllValues();
            };

            DeveloperMode.CheckedChange += delegate(object sender, CompoundButton.CheckedChangeEventArgs e)
            {
                AGCRemoteConfig.SetDeveloperMode(e.IsChecked);
                if (e.IsChecked)
                {
                    Toast.MakeText(this, "DeveloperMode Enabled", ToastLength.Long).Show();
                }
                else
                {
                    Toast.MakeText(this, "DeveloperMode Disabled", ToastLength.Long).Show();
                }
            };

            ApplyDefualtByFile();
            ShowAllValues();
            GetToken();
        }
Пример #9
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            // Set our view from the "main" layout resource
            SetContentView(Resource.Layout.activity_main);

            // Bind UI components.
            btnAppsFlyerTag   = FindViewById <Button>(Resource.Id.btnAppsFlyerTag);
            btnHiAnalyticsTag = FindViewById <Button>(Resource.Id.btnHiAnalyticsTag);
            btnFirebaseTag    = FindViewById <Button>(Resource.Id.btnFirebaseTag);

            // Set OnClickListener for Buttons.
            btnAppsFlyerTag.SetOnClickListener(this);
            btnHiAnalyticsTag.SetOnClickListener(this);
            btnFirebaseTag.SetOnClickListener(this);

            // Obtain the HiAnalytics instance.
            instance = HiAnalytics.GetInstance(this);
            HiAnalyticsTools.EnableLog();

            // Obtain the FirebaseAnalytics instance.
            mFirebaseAnalytics = FirebaseAnalytics.GetInstance(this);

            // Obtain the AppsFlyer instance.
            AppsFlyerLib.Instance.Init(AppsFlyer_Dev_Key, new AppsFlyerConversionDelegate(this), this.Application);
            AppsFlyerLib.Instance.Start(this.Application, AppsFlyer_Dev_Key);
            AppsFlyerLib.Instance.SetDebugLog(true);

            // Find the classpaths for DTM console.
            string classpathCustomTag = Java.Lang.Class.FromType(typeof(Interfaces.CustomTag)).Name;

            Log.Debug("MainActivity", "ClassPathFor_CustomTag: " + classpathCustomTag);
            string classpathCustomVariable = Java.Lang.Class.FromType(typeof(Interfaces.CustomDTMVariable)).Name;

            Log.Debug("MainActivity", "ClassPathFor_CustomVariable: " + classpathCustomVariable);
        }
 public AnalyticTest()
 {
     HiAnalyticsTools.enableLog();
     instance = HiAnalytics.getInstance(new Context());
 }
Пример #11
0
 public void Init()
 {
     HiAnalyticsTools.EnableLog();
     m_analytics = HiAnalytics.GetInstance();
 }