Wise Android SDK (Java)

1. Prerequisites

  • Project specifications:

    • Minimum API: 23

    • Compile API: 33

    • Recommended target API: 33

  • Send an email to info@wiseapp.live to get your VENDOR_ID and NAMESPACE to be used in the Android Integration steps below

2. Android SDK Integration

  1. Gradle version older than 7.x.x

    If you are on gradle version older than 7.x.x, add the below maven dependency to project level build.gradle file

    allprojects {
        repositories {
            google()
            mavenCentral()
            jcenter()
    
            **// START Wise SDK
            maven {
                url "<https://wise-maven.s3.ap-south-1.amazonaws.com/android/releases>"
            }
            // END Wise SDK**
        }
    }

    Gradle version greater than 7.x.x If you are using gradle plugin 7.x.x, add the maven depency to settings.gradle file located under project’s root directory

    dependencyResolutionManagement {
        repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
        repositories {
            google()
            mavenCentral()
            jcenter() // Warning: this repository is going to shut down soon
    
            **// START Wise SDK
            maven {
                url "<https://wise-maven.s3.ap-south-1.amazonaws.com/android/releases>"
            }
            // END Wise SDK**
        }
    }
  2. Download Zoom SDK and import them as modules in your project. After unzipping the downloaded file, you will find two folders mobilertc and commonlib inside.

    Download zoom-sdk-android-5.15.5.15204

  3. Import the Zoom SDK by navigating to File → New → Import Module and select the folder. You need to do this step for both mobilertc and commonlib folders.

  4. Open app/build.gradle and add Wise and Zoom SDK dependencies and sync the project.

dependencies {
    ....

    // wise sdk
    implementation "com.wise.sdk:core:1.1.6"
    
    // zoom sdk
    implementation project(path: ':mobilertc')
    implementation project(path: ':commonlib')
}

3. SDK Initialisation

In order to use the Wise SDK, it should be initialised first. This step can be done in your Application class or before starting / joining a meeting.

  • Set your Vendor ID and Namespace

  • Enable tracking meeting attentiveness

  • Set Lens icon

  • Enable / Disable screen capture

public class DemoApplication extends Application {
    @Override
    public void onCreate() {
        super.onCreate();

        initSdk();
    }

    private void initSdk() {
        // set vendor Id and namespace
        // Send an email to info@wiseapp.live to get your VENDOR_ID and NAMESPACE
        // to be used in the Android Integration steps below
        WiseSDK.Companion.getInstance(this)
                .init("5f72e04f121699872486dc80", "YOUR_NAMESPACE");

        // Tracking attentiveness in lens
        WiseSDK.Companion.getInstance(this).trackAttentiveness(this);
    }
}

4. Joining a meeting

You can use joinMeeting() to join a meeting. The required {token} can be found in the {public link} of a classroom. To get the {public link} you should call /user/v2/classes/:classId API (documentation)

4.1 Join Meeting by Classroom ID

findViewById<Button>(R.id.btn_join_meeting).setOnClickListener {
            // goto meeting if it's in progress
            if (WiseSDK.Companion.getInstance(MainActivity.this).isMeetingInProgress()) {
                WiseSDK.Companion.getInstance(MainActivity.this).returnToMeeting();
            } else {
                // join meeting
                WiseSDK.Companion.getInstance(MainActivity.this)
                        .joinMeeting(
                                "CLASSROOM_ID", // clasroom id. ex: 371679331
                                true, // disable screen capture
                                MainActivity.this
                        );
            }
}

4.2 Join Meeting by Classroom Public ID

findViewById(R.id.btn_join_meeting).setOnClickListener(view -> {
            // goto meeting if it's in progress
            if (WiseSDK.Companion.getInstance(MainActivity.this).isMeetingInProgress()) {
                WiseSDK.Companion.getInstance(MainActivity.this).returnToMeeting();
            } else {
                // join meeting
                WiseSDK.Companion.getInstance(MainActivity.this)
                        .joinMeeting(
                                classPublicID, // ex: 6304b66a2802b943425937d880910329
                                "USER_ID", // user id
                                "Mr John",
                                MainActivity.this
                        );
            }
        });

5. Login using SSO Token

To login into SDK using SSO Token, pass tho SSO token to loginUsingSSOToken() method.

WiseSDK.Companion.getInstance(MainActivity.this).loginUsingSSOToken("YOUR_SSO_TOKEN", new WiseSDK.SSOTokenLoginListener() {
                @Override
                public void onSuccess() {
                    // sso login successful
                }
                @Override
                public void onError(int i, @Nullable String s) {
                    // Error occurred in SSO login
                }
            });

To logout from SSO, call logoutSSO() method.

WiseSDK.Companion.getInstance(MainActivity.this).logoutSSO() 

5. Meeting listeners

WiseSDKMeetingListener provides necessary callbacks to listen to meeting status.

interface WiseSDKMeetingListener {    
		// Called when vendor ID is verified
		fun onInitialised()

		// Throws an error when vendor ID is missing
    fun onVendorIdError()

    // When SDK throws and error. See below error codes for possible reason
    fun onSDKError(wiseErrorCode: Int, errorCode: Int, internalErrorCode: Int)

    // meeting initialisation started
    fun onMeetingConnecting()

    // Meeting started/joined successfully. This can be called multiple times
    fun onMeetingStarted(isInMeeting: Boolean)

    // Meeting ended successfully. This can be called multiple times. 
    // userId is the ID you pass while joining meeting
    fun onMeetingEnded(userId: String?)

    // Meeting ended by host
    fun onMeetingEndedByHost()

    // Meeting ended with an error
    fun onMeetingEndedWithError(message: String, errorCode: Int, internalErrorCode: Int)

    // Meeting requires a password or display name
    fun onMeetingNeedPasswordOrDisplayName()

    // Meeting not started by host
    fun onMeetingNotStartedByHostError()
}

6. Error Codes

In case of an error, onSDKError() will be triggered with an error code.

Error Code

Description

1

JWT Token error has occurred. This can be due to invalid vendor Id.

2

Zoom SDK failed to initialise.

3

Wise SDK failed to communicate with it’s servers.

4

Error fetching the SDK config

7. Proguard Rules

Add the below proguard rules to your proguard-rules.pro when minification is enabled.

# zoom sdk
-keep class  us.zoom.**{*;}
-keep class  com.zipow.**{*;}
-keep class  us.zipow.**{*;}
-keep class  org.webrtc.**{*;}
-keep class  us.google.protobuf.**{*;}
-keep class  com.google.crypto.tink.**{*;}
-keep class  androidx.security.crypto.**{*;}

# wise sdk
-keep class com.wise.sdk.data.** { *; }
-keep class com.wise.sdk.core.** { *; }
-keep class com.wise.sdk.network.result.** { *; }

Last updated