// Check the connectivity private void CheckConnect() { if (MyActivityRecordsController == null) { HiHealthOptions hiHealthOptions = HiHealthOptions.HiHealthOptionsBulider().Build(); AuthHuaweiId signInHuaweiId = HuaweiIdAuthManager.GetExtendedAuthResult(hiHealthOptions); MyActivityRecordsController = HuaweiHiHealth.GetActivityRecordsController(this, signInHuaweiId); } }
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(); }; }