# Initialize(android.content.Context, java.lang.String, us.zoom.sdk.ZoomSDKInitializeListener)' is deprecated

**URL:** <https://devforum.zoom.us/t/initialize-android-content-context-java-lang-string-us-zoom-sdk-zoomsdkinitializelistener-is-deprecated/22060>\
**Category:** Android\
**Created:** [June 22, 2020, 6:33pm UTC](https://devforum.zoom.us/t/initialize-android-content-context-java-lang-string-us-zoom-sdk-zoomsdkinitializelistener-is-deprecated/22060 "2020-06-22T18:33:44Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tobiak](https://avatars.discourse-cdn.com/v4/letter/t/a3d4f5/32.png) [@Tobiak](https://devforum.zoom.us/u/Tobiak)\
**Post date:** [June 22, 2020, 6:33pm UTC](https://devforum.zoom.us/t/initialize-android-content-context-java-lang-string-us-zoom-sdk-zoomsdkinitializelistener-is-deprecated/22060/1 "2020-06-22T18:33:44Z")

</div>

**Description**  
My app closes entirely each time I try to launch zoom. logcat refers me to this line in my code;  
zoomSDK.initialize(this, APP\_KEY, APP\_SECRET, WEB\_DOMAIN, this);

**Which version?**  
v4.6.21666.0429

**Screenshots**

 ![Screenshot 2020-06-22 at 17.47.56](https://us1.discourse-cdn.com/flex016/uploads/zoomdeveloper/original/2X/f/f4027ab3c76de971c288c8f95b233375afbba6b6.png)

---

<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:** [June 23, 2020, 5:28am UTC](https://devforum.zoom.us/t/initialize-android-content-context-java-lang-string-us-zoom-sdk-zoomsdkinitializelistener-is-deprecated/22060/2 "2020-06-23T05:28:50Z")

</div>

Hi @Tobiak,

Thanks for the post. Please use the new initialize interface as mentioned in our demo app: [https://github.com/zoom/zoom-sdk-android/blob/master/mobilertc-android-studio/sample/src/main/java/us/zoom/sdksample/initsdk/InitAuthSDKHelper.java#L46](https://github.com/zoom/zoom-sdk-android/blob/master/mobilertc-android-studio/sample/src/main/java/us/zoom/sdksample/initsdk/InitAuthSDKHelper.java#L46)

```auto
ZoomSDKInitParams initParams = new ZoomSDKInitParams();
            initParams.jwtToken = SDK_JWTTOKEN;
            initParams.enableLog = true;
            initParams.logSize = 50;
            initParams.domain=AuthConstants.WEB_DOMAIN;
            mZoomSDK.initialize(context, this, initParams);

```

Hope this helps. Thanks!

---

<div class="post-metadata">

**Author:** ![Tobiak](https://avatars.discourse-cdn.com/v4/letter/t/a3d4f5/32.png) [@Tobiak](https://devforum.zoom.us/u/Tobiak)\
**Post date:** [June 27, 2020, 8:59pm UTC](https://devforum.zoom.us/t/initialize-android-content-context-java-lang-string-us-zoom-sdk-zoomsdkinitializelistener-is-deprecated/22060/3 "2020-06-27T20:59:20Z")

</div>

Thank you for the reference. However, got into a tangle after trying to initialise this way. I am trying to initialise, collect inputs from users and parse to join meeting in this single activity. initParams app\_secret, app\_key and WEB\_DOMAIN are being retrieved from an interface “Constants.java”

```auto
**LiveConference.java code**

import us.zoom.sdk.JoinMeetingOptions;
import us.zoom.sdk.JoinMeetingParams;
import us.zoom.sdk.MeetingService;
import us.zoom.sdk.ZoomSDK;
import us.zoom.sdk.ZoomSDKInitParams;
import us.zoom.sdk.ZoomSDKInitializeListener;
import us.zoom.sdk.ZoomSDKRawDataMemoryMode;
import android.view.View;
import android.widget.EditText;
import android.widget.Toast;

public class LiveConference extends AppCompatActivity implements ZoomSDKInitializeListener, InitAuthSDKCallback {

    private EditText mEdtMeetingNo;
    private EditText mEdtMeetingname;
    private EditText mEdtMeetingPassword;
    //String defaultMeetingName = "Attendee";
    private ZoomSDK mZoomSDK;
    //private InitAuthSDKHelper mInitAuthSDKHelper;
    //private InitAuthSDKCallback mInitAuthSDKCallback;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        ZoomSDK zoomSDK = ZoomSDK.getInstance();
        Context context = this;

        mEdtMeetingNo = (EditText)findViewById(R.id.edtMeetingNo);
        mEdtMeetingname = (EditText)findViewById(R.id.edtMeetingname);
        mEdtMeetingPassword = (EditText)findViewById(R.id.edtMeetingPassword);

        ZoomSDKInitParams initParams = new ZoomSDKInitParams();
        initParams.jwtToken = SDK_JWTTOKEN;
        initParams.enableLog = true;
        initParams.appKey = APP_KEY;
        initParams.appSecret = APP_SECRET;
        initParams.logSize = 50;
        initParams.domain = WEB_DOMAIN;
        initParams.videoRawDataMemoryMode = ZoomSDKRawDataMemoryMode.ZoomSDKRawDataMemoryModeStack;
        mZoomSDK.initialize(context, this, initParams);
    }

    public void onClickBtnJoinMeeting(View view) {

        // Step 1: Get meeting number from input field.
        String meetingNo = mEdtMeetingNo.getText().toString().trim();
        String displayName = mEdtMeetingname.getText().toString().trim();
        String meetingPassword = mEdtMeetingPassword.getText().toString().trim();
        // Check if the meeting number is empty.
        if(meetingNo.length() == 0) {
            Toast.makeText(this, "You need to enter a meeting number.", Toast.LENGTH_LONG).show();
            return;
        }
        if(displayName.length() == 0) {
            Toast.makeText(this, "Please type your name or a username", Toast.LENGTH_LONG).show();
            return;
        }
        // Step 2: Get Zoom SDK instance.
        ZoomSDK zoomSDK = ZoomSDK.getInstance();
        // Check if the zoom SDK is initialized
        if(!zoomSDK.isInitialized()) {
            Toast.makeText(this, "Service has not been initialized successfully", Toast.LENGTH_LONG).show();
            return;
        }

        // Step 3: Get meeting service from zoom SDK instance.
        MeetingService meetingService = zoomSDK.getMeetingService();

        // Step 4: Configure meeting options.
        JoinMeetingOptions opts = new JoinMeetingOptions();

        // Some available options
        // opts.no_driving_mode = true;
        // opts.no_invite = true;
        // opts.no_meeting_end_message = true;
        // opts.no_titlebar = true;
        // opts.no_bottom_toolbar = true;
        // opts.no_dial_in_via_phone = true;
        // opts.no_dial_out_to_phone = true;
        // opts.no_disconnect_audio = true;
        // opts.no_share = true;
        // opts.invite_options = InviteOptions.INVITE_VIA_EMAIL + InviteOptions.INVITE_VIA_SMS;
        // opts.no_audio = true;
        // opts.no_video = true;
        // opts.meeting_views_options = MeetingViewsOptions.NO_BUTTON_SHARE;
        // opts.no_meeting_error_message = true;
        // opts.participant_id = "participant id";

        // Step 5: Setup join meeting parameters
        JoinMeetingParams params = new JoinMeetingParams();

        params.displayName = displayName;
        params.meetingNo = meetingNo;
        params.password = meetingPassword;

        // Step 6: Call meeting service to join meeting
        meetingService.joinMeetingWithParams(this, params, opts);
    }

    @Override
    public void onZoomSDKInitializeResult(int errorCode, int internalErrorCode) {

    }

    @Override
    public void onZoomAuthIdentityExpired() {

    }

    @Override
    public void onPointerCaptureChanged(boolean hasCapture) {

    }
}

```

I have initialized Context this way

Context context = this;

But the logcat error keeps referring to this line of my code that has;

mZoomSDK.initialize(context, this, initParams);  
}

**Logcat Error line reads;**

Caused by: java.lang.NullPointerException: Attempt to invoke virtual method ‘void us.zoom.sdk.ZoomSDK.initialize(android.content.Context, us.zoom.sdk.ZoomSDKInitializeListener, us.zoom.sdk.ZoomSDKInitParams)’ on a null object reference  
at com.myappy.LiveConference.onCreate(LiveConference.java:56)  
at android.app.Activity.performCreate(Activity.java:6787)  
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1146)  
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2619)  
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2727)  
at android.app.ActivityThread.-wrap12(ActivityThread.java)  
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1478)  
at android.os.Handler.dispatchMessage(Handler.java:102)  
at android.os.Looper.loop(Looper.java:154)  
at android.app.ActivityThread.main(ActivityThread.java:6125)  
at java.lang.reflect.Method.invoke(Native Method)  
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:893)  
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:783)

Kindly help to mention I am trying to update same app’s iOS version to use Zoom’s latest SDK. Like to get Android sorted as soon as possible.

Regards.

---

<div class="post-metadata">

**Author:** ![Tobiak](https://avatars.discourse-cdn.com/v4/letter/t/a3d4f5/32.png) [@Tobiak](https://devforum.zoom.us/u/Tobiak)\
**Post date:** [July 2, 2020, 12:05pm UTC](https://devforum.zoom.us/t/initialize-android-content-context-java-lang-string-us-zoom-sdk-zoomsdkinitializelistener-is-deprecated/22060/4 "2020-07-02T12:05:11Z")

</div>

Hello Team, any help with this yet? I have explored the Example2 as well and still experience error.

**Log:**  
2020-07-02 12:37:10.874 7795-7795/? A/art: art/runtime/java\_vm\_ext.cc:472] JNI DETECTED ERROR IN APPLICATION: GetStringUTFChars received NULL jstring  
2020-07-02 12:37:10.874 7795-7795/? A/art: art/runtime/java\_vm\_ext.cc:472] in call to GetStringUTFChars  
2020-07-02 12:37:10.874 7795-7795/? A/art: art/runtime/java\_vm\_ext.cc:472] from int com.zipow.videobox.mainboard.Mainboard.initMainboard(java.lang.String, java.lang.String, byte, java.lang.String, int)  
2020-07-02 12:37:10.874 7795-7795/? A/art: art/runtime/java\_vm\_ext.cc:472] “main” prio=5 tid=1 Runnable  
2020-07-02 12:37:10.874 7795-7795/? A/art: art/runtime/java\_vm\_ext.cc:472] | group=“main” sCount=0 dsCount=0 obj=0x749a1850 self=0x757d34a95a00  
2020-07-02 12:37:10.874 7795-7795/? A/art: art/runtime/java\_vm\_ext.cc:472] | sysTid=7795 nice=-10 cgrp=default sched=0/0 handle=0x757d39e20b40  
2020-07-02 12:37:10.874 7795-7795/? A/art: art/runtime/java\_vm\_ext.cc:472] | state=R schedstat=( 1520203585 528085192 2084 ) utm=69 stm=83 core=1 HZ=100  
2020-07-02 12:37:10.874 7795-7795/? A/art: art/runtime/java\_vm\_ext.cc:472] | stack=0x7ffee89ea000-0x7ffee89ec000 stackSize=8MB  
2020-07-02 12:37:10.874 7795-7795/? A/art: art/runtime/java\_vm\_ext.cc:472] | held mutexes= “mutator lock”(shared held)

Here is what my Params look like:

ZoomSDKInitParams initParams = new ZoomSDKInitParams();  
initParams.jwtToken = SDK\_JWTTOKEN;  
initParams.enableLog = true;  
initParams.appKey = APP\_KEY;  
initParams.appSecret = APP\_SECRET;  
initParams.logSize = 50;  
initParams.domain = WEB\_DOMAIN;  
initParams.videoRawDataMemoryMode = ZoomSDKRawDataMemoryMode.ZoomSDKRawDataMemoryModeStack;  
zoomSDK.initialize(this,this, initParams);

Is it neccessary to provide initParams.jwtToken = SDK\_JWTTOKEN; " when I have appsecret, appkey and domain?

**My Constants.Java has parameter values:**  
public interface Constants {

```
// TODO Change it to your web domain
public final static String WEB_DOMAIN = "zoom.us";

// TODO Change it to your APP Key
public final static String APP_KEY = "GC ****************K*****";

// TODO Change it to your APP Secret
public final static String APP_SECRET = "gsx *********************";

// TODO change it to your user ID
public final static String USER_ID = "";

// TODO change it to your token
public final static String ZOOM_TOKEN = "";

//TODO change it to your JWT token
public final static String SDK_JWTTOKEN = "";

// TODO Change it to your exist meeting ID to start meeting
public final static String MEETING_ID = "";

// Change it to your zoom access token(ZAK)
public final static String ZOOM_ACCESS_TOKEN = "Your zoom access token(ZAK) from REST API";

```

}

What could be wrong? kindly help.

---

<div class="post-metadata">

**Author:** ![Tobiak](https://avatars.discourse-cdn.com/v4/letter/t/a3d4f5/32.png) [@Tobiak](https://devforum.zoom.us/u/Tobiak)\
**Post date:** [July 4, 2020, 8:51pm UTC](https://devforum.zoom.us/t/initialize-android-content-context-java-lang-string-us-zoom-sdk-zoomsdkinitializelistener-is-deprecated/22060/5 "2020-07-04T20:51:37Z")

</div>

This issue has been resolved. The error occurs with a virtual device, I have been running app using BlueStacks (Samsung virtual Device). Had to clear enough memory on available Android device to allow successful installation and run (apk size 111MB).

Thank you.

---

<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:** [July 8, 2020, 6:41am UTC](https://devforum.zoom.us/t/initialize-android-content-context-java-lang-string-us-zoom-sdk-zoomsdkinitializelistener-is-deprecated/22060/6 "2020-07-08T06:41:51Z")

</div>

Hi @Tobiak,

Thanks for the follow up and glad to hear that you have found the solution.

---

<div class="post-metadata">

**Author:** ![DeveloperBot](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/developerbot/32/12632_2.png) [@DeveloperBot](https://devforum.zoom.us/u/DeveloperBot)\
**Post date:** [August 21, 2020, 10:36pm UTC](https://devforum.zoom.us/t/initialize-android-content-context-java-lang-string-us-zoom-sdk-zoomsdkinitializelistener-is-deprecated/22060/7 "2020-08-21T22:36:34Z")

</div>


