コード例 #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();
        }
コード例 #2
0
        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;
        }
コード例 #3
0
    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);
    }
コード例 #4
0
    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);
        }));
    }
コード例 #5
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);
        }
コード例 #6
0
 public void Init()
 {
     HiAnalyticsTools.EnableLog();
     m_analytics = HiAnalytics.GetInstance();
 }