# onMeetingStatusChanged - always on MEETING\_STATUS\_CONNECTING

**URL:** <https://devforum.zoom.us/t/onmeetingstatuschanged-always-on-meeting-status-connecting/8309>\
**Category:** Android\
**Created:** [February 28, 2020, 3:20am UTC](https://devforum.zoom.us/t/onmeetingstatuschanged-always-on-meeting-status-connecting/8309 "2020-02-28T03:20:22Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![johntyty2](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/johntyty2/32/3342_2.png) [@johntyty2](https://devforum.zoom.us/u/johntyty2)\
**Post date:** [February 28, 2020, 3:20am UTC](https://devforum.zoom.us/t/onmeetingstatuschanged-always-on-meeting-status-connecting/8309/1 "2020-02-28T03:20:22Z")

</div>

**Description**  
I would like to get the meetingNo on onMeetingStatusChanged and send to another android app, but the meetingStatus only show MEETING\_STATUS\_CONNECTING, even when I am in the meeting. I think the meetingNo can only get when the meetingStatus is on METTING\_STATUS\_INMEETING, right?

**Which version?**  
v4.6.15086.0209

**To Reproduce(If applicable)**  
meetingService = zoomSDK.getMeetingService();  
meetingService.addListener(this);  
instantMeetingOptions = new InstantMeetingOptions();  
inMeetingService = zoomSDK.getInMeetingService();  
int ret = meetingService.startInstantMeeting(this, instantMeetingOptions);

**Screenshots**

 ![擷取](https://us1.discourse-cdn.com/flex016/uploads/zoomdeveloper/original/2X/4/4edfd1f15548622491c7ab7acd101a3eb87ecc71.png)

**Smartphone (please complete the following information):**

- Device: SAMSUNG GT-N7105
- OS: Android
- Version Android 7.1.2

**Additional context**  
Add any other context about the problem here.

---

<div class="post-metadata">

**Author:** ![carson.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/carson.zoom/32/785_2.png) [@carson.zoom](https://devforum.zoom.us/u/carson.zoom)\
**Post date:** [February 28, 2020, 3:57am UTC](https://devforum.zoom.us/t/onmeetingstatuschanged-always-on-meeting-status-connecting/8309/2 "2020-02-28T03:57:14Z")

</div>

Hi [johntyty2](https://devforum.zoom.us/u/johntyty2),

Thanks for using Zoom SDK. May I ask what is the location of this meeting? Is this reproducible with our demo app?

Thanks!

---

<div class="post-metadata">

**Author:** ![johntyty2](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/johntyty2/32/3342_2.png) [@johntyty2](https://devforum.zoom.us/u/johntyty2)\
**Post date:** [February 28, 2020, 4:09am UTC](https://devforum.zoom.us/t/onmeetingstatuschanged-always-on-meeting-status-connecting/8309/3 "2020-02-28T04:09:49Z")

</div>

Hi,

what do you mean the location of meeting?

> Is this reproducible with our demo app?  
> I’m not sure, because I didn’t try the demo app. 😅

Below is my implementation, hope it can help:  
public class MainActivity extends AppCompatActivity implements Constants,  
ZoomSDKInitializeListener,  
MeetingServiceListener,  
ZoomSDKAuthenticationListener {

```
private static final String TAG = MainActivity.class.getSimpleName();
MeetingService meetingService;
InMeetingService inMeetingService;
ZoomSDK zoomSDK;
InstantMeetingOptions instantMeetingOptions;

private EditText emailEdt;
private EditText passwordEdt;

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);

    emailEdt = findViewById(R.id.email);
    passwordEdt = findViewById(R.id.password);

    zoomSDK = ZoomSDK.getInstance();
    zoomSDK.initialize(this, APP_KEY, APP_SECRET, this);
}

@Override
protected void onStart() {
    super.onStart();
    zoomSDK.addAuthenticationListener(this);
}

@Override
protected void onStop() {
    super.onStop();
    meetingService.removeListener(this);
    zoomSDK.removeAuthenticationListener(this);
}

@Override
protected void onDestroy() {
    super.onDestroy();
    meetingService.leaveCurrentMeeting(true);
}

public void login(View view) {
    if (!zoomSDK.isInitialized()) {
        Toast.makeText(this, "ZoomSDK has not been initialized successfully", Toast.LENGTH_LONG).show();
        return;
    }

    String email = emailEdt.getText().toString();
    String password = passwordEdt.getText().toString();
    if (zoomSDK.loginWithZoom(email, password) != ZoomApiError.ZOOM_API_ERROR_SUCCESS) {
        Toast.makeText(this, "ZoomSDK has not been logged in successfully", Toast.LENGTH_LONG).show();
    }
}

public void startMeeting(View view) {
    if (zoomSDK.isLoggedIn()) {
        meetingService = zoomSDK.getMeetingService();
        meetingService.addListener(this);
        instantMeetingOptions = new InstantMeetingOptions();
        inMeetingService = zoomSDK.getInMeetingService();
        int ret = meetingService.startInstantMeeting(this, instantMeetingOptions);

        Log.d(TAG, String.format("[startMeeting] result of startInstantMeeting: %d", ret));
    } else {
        Toast.makeText(this, "Please Login First", Toast.LENGTH_LONG).show();
    }
}

@Override
public void onMeetingStatusChanged(MeetingStatus meetingStatus, int errorCode, int internalErrorCode) {
    Log.d(TAG, String.format("[onMeetingStatusChanged] meetingStatus: %s", meetingStatus.toString()));
    Log.d(TAG, String.format("[onMeetingStatusChanged] getCurrentMeetingID: %s", inMeetingService.getCurrentMeetingID()));
    Log.d(TAG, String.format("[onMeetingStatusChanged] MeetingNumber: %d", inMeetingService.getCurrentMeetingNumber()));
    Log.d(TAG, String.format("[onMeetingStatusChanged] MeetingTopic: %s", inMeetingService.getCurrentMeetingTopic()));
    Log.d(TAG, String.format("[onMeetingStatusChanged] MeetingUrl: %s", inMeetingService.getCurrentMeetingUrl()));
}

@Override
public void onZoomSDKLoginResult(long result) {
    if (result == ZoomAuthenticationError.ZOOM_AUTH_ERROR_SUCCESS) {
        Toast.makeText(this, "[onZoomSDKLoginResult] Login success", Toast.LENGTH_SHORT).show();
    } else {
        Toast.makeText(this, "[onZoomSDKLoginResult] Login failed result code = " + result, Toast.LENGTH_SHORT).show();
    }
}

@Override
public void onZoomSDKLogoutResult(long l) {

}

@Override
public void onZoomIdentityExpired() {

}

@Override
public void onZoomSDKInitializeResult(int errorCode, int internalErrorCode) {
    Log.d(TAG, String.format("[onZoomSDKInitializeResult] errorCode: %d, internalErrorCode: %d", errorCode, internalErrorCode));
    if (errorCode == ZoomAuthenticationError.ZOOM_AUTH_ERROR_SUCCESS) {
        zoomSDK.tryAutoLoginZoom();
    }
}

@Override
public void onZoomAuthIdentityExpired() {

}

public void logout(View view) {
    zoomSDK.logoutZoom();
}

```

}

---

<div class="post-metadata">

**Author:** ![johntyty2](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/johntyty2/32/3342_2.png) [@johntyty2](https://devforum.zoom.us/u/johntyty2)\
**Post date:** [February 28, 2020, 6:23am UTC](https://devforum.zoom.us/t/onmeetingstatuschanged-always-on-meeting-status-connecting/8309/4 "2020-02-28T06:23:04Z")

</div>

Hi,  
I just test to use joinMeeting, and it works perfect. However, I need to use startInstantMeeting.  
Please help. 😢

here’s the code for join meeting:

public class MainActivity extends AppCompatActivity implements  
Constants,  
ZoomSDKInitializeListener,  
MeetingServiceListener,  
ZoomSDKAuthenticationListener {

```
private static final String TAG = MainActivity.class.getSimpleName();
private EditText meetingNumberEt;
private MeetingService meetingService;
private InMeetingService inMeetingService;

@Override
protected void onDestroy() {
    super.onDestroy();
    meetingService.removeListener(this);
}

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);

    meetingNumberEt = findViewById(R.id.meetingNumber);

    ZoomSDK zoomSDK = ZoomSDK.getInstance();
    if(savedInstanceState == null) {
        zoomSDK.initialize(this, APP_KEY, APP_SECRET, this);
    }
}

@Override
public void onMeetingStatusChanged(MeetingStatus meetingStatus, int i, int i1) {
    Log.d(TAG, String.format("[onMeetingStatusChanged] meetingStatus: %s", meetingStatus.toString()));
    Log.d(TAG, String.format("[onMeetingStatusChanged] getCurrentMeetingID: %s", inMeetingService.getCurrentMeetingID()));
    Log.d(TAG, String.format("[onMeetingStatusChanged] MeetingNumber: %d", inMeetingService.getCurrentMeetingNumber()));
    Log.d(TAG, String.format("[onMeetingStatusChanged] MeetingTopic: %s", inMeetingService.getCurrentMeetingTopic()));
    Log.d(TAG, String.format("[onMeetingStatusChanged] MeetingUrl: %s", inMeetingService.getCurrentMeetingUrl()));
}

@Override
public void onZoomSDKLoginResult(long l) {

}

@Override
public void onZoomSDKLogoutResult(long l) {

}

@Override
public void onZoomIdentityExpired() {

}

@Override
public void onZoomSDKInitializeResult(int i, int i1) {
    Log.d(TAG, String.format("onZoomSDKInitializeResult: %d, %d", i, i1));
}

@Override
public void onZoomAuthIdentityExpired() {

}

public void joinMeeting(View view) {
    String meetingNo = meetingNumberEt.getText().toString().trim();
    if (meetingNo.length() == 0) {
        Toast.makeText(this, "You need to enter a meeting number/ vanity id which you want to join.", Toast.LENGTH_LONG).show();
        return;
    }

    ZoomSDK zoomSDK = ZoomSDK.getInstance();
    if(!zoomSDK.isInitialized()) {
        Toast.makeText(this, "ZoomSDK has not been initialized successfully", Toast.LENGTH_LONG).show();
        return;
    }

    meetingService = zoomSDK.getMeetingService();
    JoinMeetingOptions opts = new JoinMeetingOptions();

    JoinMeetingParams params = new JoinMeetingParams();
    params.displayName = "Guset";
    params.meetingNo = meetingNo;

    inMeetingService = zoomSDK.getInMeetingService();

    meetingService.addListener(this);
    meetingService.joinMeetingWithParams(this, params, opts);
}

```

}

---

<div class="post-metadata">

**Author:** ![carson.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/carson.zoom/32/785_2.png) [@carson.zoom](https://devforum.zoom.us/u/carson.zoom)\
**Post date:** [February 29, 2020, 2:10am UTC](https://devforum.zoom.us/t/onmeetingstatuschanged-always-on-meeting-status-connecting/8309/5 "2020-02-29T02:10:07Z")

</div>

Hi [johntyty2](https://devforum.zoom.us/t/onmeetingstatuschanged-always-on-meeting-status-connecting/8309/3),

Thanks for the reply and the code snippet. Regarding the location of the meeting, is the meeting host and participant locate in China?

Thanks!

---

<div class="post-metadata">

**Author:** ![johntyty2](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/johntyty2/32/3342_2.png) [@johntyty2](https://devforum.zoom.us/u/johntyty2)\
**Post date:** [March 2, 2020, 2:48am UTC](https://devforum.zoom.us/t/onmeetingstatuschanged-always-on-meeting-status-connecting/8309/7 "2020-03-02T02:48:53Z")

</div>

Hi Carson\_Chen,

The domain I used is [zoom.us](http://zoom.us).  
the meeting host and participant locale in Hong Kong.

---

<div class="post-metadata">

**Author:** ![johntyty2](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/johntyty2/32/3342_2.png) [@johntyty2](https://devforum.zoom.us/u/johntyty2)\
**Post date:** [March 2, 2020, 3:04am UTC](https://devforum.zoom.us/t/onmeetingstatuschanged-always-on-meeting-status-connecting/8309/8 "2020-03-02T03:04:34Z")

</div>

![擷取](https://us1.discourse-cdn.com/flex016/uploads/zoomdeveloper/original/2X/a/abb0f4129d1f7123e97916c7b8862a443d48268c.png)  
this is what I want to get after startInstantMeeting, however I can only get it from joinMeetingWithParams.  
Please help. 😢

---

<div class="post-metadata">

**Author:** ![johntyty2](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/johntyty2/32/3342_2.png) [@johntyty2](https://devforum.zoom.us/u/johntyty2)\
**Post date:** [March 2, 2020, 6:02am UTC](https://devforum.zoom.us/t/onmeetingstatuschanged-always-on-meeting-status-connecting/8309/9 "2020-03-02T06:02:50Z")

</div>

![擷取](https://us1.discourse-cdn.com/flex016/uploads/zoomdeveloper/original/2X/1/1d442229430c63cf20b902587f108ef4f322e00e.png)  
UPDATE!!!  
I found the status changed indeed ( use meetingService.getMeetingStatus to get), but the onMeetingStatusChanged method didn’t called.

---

<div class="post-metadata">

**Author:** ![carson.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/carson.zoom/32/785_2.png) [@carson.zoom](https://devforum.zoom.us/u/carson.zoom)\
**Post date:** [March 3, 2020, 4:11am UTC](https://devforum.zoom.us/t/onmeetingstatuschanged-always-on-meeting-status-connecting/8309/10 "2020-03-03T04:11:05Z")

</div>

Hi [johntyty2](https://devforum.zoom.us/t/onmeetingstatuschanged-always-on-meeting-status-connecting/8309/9),

Thanks for the reply. Based on your code snippet and the screenshots, it looks like everything is working now. I can see the logging output written in `onMeetingStatusChanged` is being printed out, which is expected.

Let me know if any other questions. Happy Zooming!
