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

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

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

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!

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”

**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.

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.

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.