How to overwrite values from interface_config.js in an android application?

We use jitsi-meet-sdk (version 1.21.0) to build an Android App. The example on https://github.com/jitsi/jitsi-meet/blob/master/android/README.md works fine.

But now we want to overwrite values from interface_config.js (e.g. the TOOLBAR_BUTTONS). How can I do that with the Java-API?

This is our activity:

import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.util.Log;

import com.facebook.react.modules.core.PermissionListener;

import org.jitsi.meet.sdk.JitsiMeetActivityInterface;
import org.jitsi.meet.sdk.JitsiMeetView;
import org.jitsi.meet.sdk.JitsiMeetViewListener;
import org.jitsi.meet.sdk.ReactActivityLifecycleCallbacks;

import java.net.MalformedURLException;
import java.net.URL;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;

public class MainActivity extends AppCompatActivity implements JitsiMeetActivityInterface {
    private JitsiMeetView view;

    @Override
    protected void onActivityResult(
            int requestCode,
            int resultCode,
            Intent data) {
        ReactActivityLifecycleCallbacks.onActivityResult(
                this, requestCode, resultCode, data);
    }

    @Override
    public void onBackPressed() {
        ReactActivityLifecycleCallbacks.onBackPressed();
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        view = new JitsiMeetView(this);

        room = "ourRoom";
        url = "https://melt.jit.si";

        Bundle interfaceConfigOverwrite = new Bundle();
        interfaceConfigOverwrite.putString("DEFAULT_LOCAL_DISPLAY_NAME", "ich");
        interfaceConfigOverwrite.putBoolean("SHOW_JITSI_WATERMARK", true);
        interfaceConfigOverwrite.putBoolean("SHOW_WATERMARK_FOR_GUESTS", true);
        interfaceConfigOverwrite.putBoolean("SHOW_BRAND_WATERMARK", true);
        interfaceConfigOverwrite.putString("DEFAULT_REMOTE_DISPLAY_NAME","Konferenzteilnehmer");
        interfaceConfigOverwrite.putBoolean("LANG_DETECTION", true);
        interfaceConfigOverwrite.putBoolean("INVITATION_POWERED_BY", true);
        interfaceConfigOverwrite.putBoolean("MOBILE_APP_PROMO", true);
        interfaceConfigOverwrite.putString("SUPPORT_URL","http://www.example.com/");
        interfaceConfigOverwrite.putBoolean("RECENT_LIST_ENABLED", true);
        ArrayList<String> toolbarButtons=new ArrayList<>();
        toolbarButtons.add("microphone");
        toolbarButtons.add("camera");
        toolbarButtons.add("closedcaptions");
        toolbarButtons.add("desktop");
        toolbarButtons.add("fullscreen");
        interfaceConfigOverwrite.putStringArrayList("TOOLBAR_BUTTONS", toolbarButtons);

        Bundle config = new Bundle();
        config.putBoolean("startWithAudioMuted", true);

        Bundle options = new Bundle();

        options.putString("url", "https://melt.jit.si/ourRoom");
        options.putBundle("config", config);
        options.putBundle("interfaceconfig", interfaceConfigOverwrite);
        view.loadURLObject(options);

        view.setListener(new JitsiMeetViewListener() {
            @Override
            public void onConferenceFailed(Map<String, Object> map) {

            }

            @Override
            public void onConferenceJoined(Map<String, Object> map) {

            }

            @Override
            public void onConferenceLeft(Map<String, Object> map) {
                closeActivity();
            }

            @Override
            public void onConferenceWillJoin(Map<String, Object> map) {

            }

            @Override
            public void onConferenceWillLeave(Map<String, Object> map) {

            }

            @Override
            public void onLoadConfigError(Map<String, Object> map) {

            }
        });
        setContentView(view);
    }

    private void closeActivity() {
        this.finish();
    }

    @Override
    protected void onDestroy() {
        super.onDestroy();

        view.dispose();
        view = null;

        ReactActivityLifecycleCallbacks.onHostDestroy(this);
    }

    @Override
    public void onNewIntent(Intent intent) {
        ReactActivityLifecycleCallbacks.onNewIntent(intent);
    }

    @Override
    public void onRequestPermissionsResult(
            final int requestCode,
            final String[] permissions,
            final int[] grantResults) {
        ReactActivityLifecycleCallbacks.onRequestPermissionsResult(requestCode, permissions, grantResults);
    }

    @Override
    protected void onResume() {
        super.onResume();

        ReactActivityLifecycleCallbacks.onHostResume(this);
    }

    @Override
    protected void onStop() {
        super.onStop();

        ReactActivityLifecycleCallbacks.onHostPause(this);
    }

    @Override
    public void requestPermissions(String[] permissions, int requestCode, PermissionListener listener) {

    }
}

Currently mobile doesn’t load interface_config.js, that’s why you don’t see the changes happen.

Thanks for your reply. That was not what I wanted to hear :wink:

Our admin removed one entry in TOOLBAR_BUTTONS-array in interface_config.js on the server side (we have an own jitsi-installation). After that we saw different buttons in our app. It was not as we expected, but it was different. I have to ask my admin to get screenshots if necessary. Is this explainable for you?

Let’s say it more explicit: We want to remove everything that has to do with social media (e.g. livestreaming). Is this possible with the mobile-sdk?

You’d need to build the SDK yourself, but yeah, it’s possible. Not very ergonomic since you have to edit the code, but it’s possible.

Thanks for the reply. We’ll see how we deal with that.