Help Center/ Meeting/ Client SDK Reference/ Android SDK/ Typical Scenarios/ Scenario 4: Scheduling a Meeting
Updated on 2024-07-30 GMT+08:00

Scenario 4: Scheduling a Meeting

Description

After logging in to Huawei Cloud Meeting using an account, you can schedule a meeting. When scheduling the meeting, you can add participants in addition to setting mandatory meeting parameters.

Service Process

Process the meeting scheduling information entered on the UI, call the bookConf API, and then implement hwmCallback and onConfListChanged of BizNotificationHandler.

  1. Call the API.

    1. Create a BookConfParam object.
    2. Call the bookConf API to schedule a meeting. The data in the preceding step is used as input parameters.

  2. Implement the callback function.

    Implement the hwmCallback function.

  3. Implement the notification function.

    Implement the onConfListChanged function.

Sample Code

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
            // Set a callback to receive the meeting scheduling result.
            HwmCallback<ConfInfo> completeHandler = new HwmCallback<ConfInfo>() {
	    @Override
	    public void onSuccess(ConfInfo result) {
		dismissLoading();
		DemoUtil.showToast("Meeting scheduled");
	    }

	    @Override
	    public void onFailed(int retCode, String desc) {
		dismissLoading();
		dismiss();
		String err = ErrorMessageFactory.create(Utils.getApp(), retCode);
		if (TextUtils.isEmpty(err)) {
		    err = Utils.getApp().getString(R.string.hwmconf_book_conf_fail);
		}
		DemoUtil.showToast("Failed to schedule the meeting: " + retCode +", desc: "+ err);
	    }
        };

        boolean needWithMember = true;
        List<AttendeeModel> attendeeInfos = new ArrayList<>();
        if (needWithMember) {
            // The following three methods are available:
            String name = getName();
            String number = getNumber();
            String thirdAccountId = getThirdAccountId();
            if (!TextUtils.isEmpty(thirdAccountId)) {
                attendeeInfos.add(AttendeeModel.buildAttendeeByThirdAccountId(thirdAccountId, name));
            } else if (number.startsWith("+99")) {
                // A SIP number is used to join the meeting.
                attendeeInfos.add(AttendeeModel.buildAttendeeBySipNumber(number, name));
            } else {
                // A mobile number or a fixed-line phone number is used to join the meeting.
                attendeeInfos.add(AttendeeModel.buildAttendeeByPhone(number, name));
            }
        }
        BookConfParam bookConfParam = new BookConfParam()
                .setConfSubject(getConfSubject())
                .setStartTime(1599574798)
                .setTimeZone(56)
                .setDuration(60)
                .setConfType(MeetingType.CONF_VIDEO)
                .setVmrIdFlag(false)
                .setVmrId("")
                .setNeedConfPwd(true)
                .setJoinConfRestrictionType(JoinConfPermissionType.PERMIT_EVERYONE)
                .setRecordOn(true)
                .setMailOn(true)
                .setSmsOn(true)
                .setEmailCalenderOn(true)
                .setAttendees(attendeeInfos);
        HWMBizSdk.getBizOpenApi().bookConf(bookConfParam, this.completeHandler);