コード例 #1
0
        private void InitDataController()
        {
            // Obtain and set the read & write permissions for DtContinuousStepsDelta and DtInstantaneousHeight.
            // Use the obtained permissions to obtain the data controller object.
            HiHealthOptions hiHealthOptions = HiHealthOptions.HiHealthOptionsBulider()
                                              .AddDataType(DataType.DtContinuousStepsDelta, HiHealthOptions.AccessRead)
                                              .AddDataType(DataType.DtContinuousStepsDelta, HiHealthOptions.AccessWrite)
                                              .AddDataType(DataType.DtInstantaneousHeight, HiHealthOptions.AccessRead)
                                              .AddDataType(DataType.DtInstantaneousHeight, HiHealthOptions.AccessWrite)
                                              .Build();
            AuthHuaweiId signInHuaweiId = HuaweiIdAuthManager.GetExtendedAuthResult(hiHealthOptions);

            MyDataController = HuaweiHiHealth.GetDataController(this, signInHuaweiId);
        }
コード例 #2
0
        private void Init()
        {
            HiHealthOptions hiHealthOptions = HiHealthOptions.HiHealthOptionsBulider().Build();
            AuthHuaweiId    signInHuaweiId  = HuaweiIdAuthManager.GetExtendedAuthResult(hiHealthOptions);

            MyActivityRecordsController = HuaweiHiHealth.GetActivityRecordsController(this, signInHuaweiId);
            MyDataController            = HuaweiHiHealth.GetDataController(this, signInHuaweiId);

            LogInfoView = (TextView)FindViewById(Resource.Id.activity_records_controller_log_info);
            LogInfoView.MovementMethod = ScrollingMovementMethod.Instance;

            BeginActivity  = (Button)FindViewById(Resource.Id.records_controller_begin_activity);
            EndActivity    = (Button)FindViewById(Resource.Id.records_controller_end_activity);
            AddActivity    = (Button)FindViewById(Resource.Id.records_controller_add_activity);
            GetActivity    = (Button)FindViewById(Resource.Id.records_controller_get_activity);
            DeleteActivity = (Button)FindViewById(Resource.Id.records_controller_delete_activity);

            BeginActivity.Click  += delegate { BeginActivityRecord(); };
            EndActivity.Click    += delegate { EndActivityRecord(); };
            AddActivity.Click    += delegate { AddActivityRecord(); };
            GetActivity.Click    += delegate { GetActivityRecord(); };
            DeleteActivity.Click += delegate { DeleteActivityRecord(); };
        }