0

I am able to run Jitsi video calling android sdk successfully when I add the main video calling activity as the launcher activity of the application, video is getting connected smooth and no worries . However when I changed to the code to calling the same activity from another activity it throws an activity not found exception .

Here is my manifest file

<activity
        android:name=".activity.JitsiVideoCallActivity"
        android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|screenSize|smallestScreenSize"
        android:label="@string/app_name"
        android:resizeableActivity="true"
        android:supportsPictureInPicture="true"
        android:windowSoftInputMode="adjustResize">


        <intent-filter>
            <action android:name="android.intent.action.VIEW" />

            <category android:name="android.intent.category.BROWSABLE" />
            <category android:name="android.intent.category.DEFAULT" />

            <data
                android:host="beta.hipchat.me"
                android:scheme="https" />
            <data
                android:host="beta.meet.jit.si"
                android:scheme="https" />
            <data
                android:host="chaos.hipchat.me"
                android:scheme="https" />
            <data
                android:host="enso.me"
                android:scheme="https" />
            <data
                android:host="hipchat.me"
                android:scheme="https" />
            <data
                android:host="meet.jit.si"
                android:scheme="https" />
        </intent-filter>
        <intent-filter>
            <action android:name="android.intent.action.VIEW" />

            <category android:name="android.intent.category.BROWSABLE" />
            <category android:name="android.intent.category.DEFAULT" />

            <data android:scheme="org.jitsi.meet" />
        </intent-filter>
    </activity>

This is my activity which is supposed to do the video call

public class JitsiVideoCallActivity extends AppCompatActivity {

private JitsiMeetView view;
private static final String ADD_PEOPLE_CONTROLLER_QUERY = null;

@Override
protected void onCreate(Bundle savedInstanceState) {

    super.onCreate(savedInstanceState);

    view = new JitsiMeetView(this);
    Bundle config = new Bundle();
    config.putBoolean("startWithAudioMuted", false);
    config.putBoolean("startWithVideoMuted", false);
    Bundle urlObject = new Bundle();
    urlObject.putBundle("config", config);
    urlObject.putString("url", "https://meet.jit.si/wizcounsel");
    view.loadURLObject(urlObject);
    setContentView(view);


}

This is how I launch the intent

@OnClick(R.id.call)
void call() {
    if (ContextCompat.checkSelfPermission(this, Manifest.permission.RECORD_AUDIO)
            != PackageManager.PERMISSION_GRANTED) {
        // Permission is not granted
        askForAudioPermission();
    } else
        startActivity(new Intent(this, JitsiMeetActivity.class),);
}

I have added JAVA 8 compatibility in my app level gradle file and dependencies on both the gradle files

What I have tried changing launch mode to singletask App crashes Making the video call activity the launcher App works Extend AppCombactActivity and / or JitsiMee Activity App crashes

This is my crash log

E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.star.star*, PID: 26197
android.content.ActivityNotFoundException: Unable to find explicit activity class {com.star.star/org.jitsi.meet.sdk.JitsiMeetActivity}; have you declared this activity in your AndroidManifest.xml?

If any more info is needed , let me know, thanks in advance, Kindly help

Royce Raju Beena
  • 711
  • 4
  • 20

2 Answers2

0

initialize it in oncreate method.In any activity.

void connectCall() {
    URL serverURL;
    try {
        serverURL = new URL("https://meet.jit.si");
    } catch (MalformedURLException e) {
        e.printStackTrace();
        throw new RuntimeException("Invalid server URL!");
    }
    JitsiMeetConferenceOptions defaultOptions
            = new JitsiMeetConferenceOptions.Builder()
            .setServerURL(serverURL)
            .build();
    JitsiMeet.setDefaultConferenceOptions(defaultOptions);
}

now call this method where you want. Example onclick listener

 public void onVideoCall(String text) {

    if (text.length() > 0) {
        // Build options object for joining the conference. The SDK will merge the default
        // one we set earlier and this one when joining.
        JitsiMeetConferenceOptions options
                = new JitsiMeetConferenceOptions.Builder()
                .setRoom(text)
                .setWelcomePageEnabled(false)
                .build();
        // Launch the new activity with the given options. The launch() method takes care
        // of creating the required Intent and passing the options.
        JitsiMeetActivity.launch(activity, options);
    }
Zeeshan Ali
  • 667
  • 8
  • 16
0

I think you forgot to register your activity in AndroidManifest.xml. You should register your activity in <application> tag as below.

 <activity
        android:name=".YourActivity"/>
Inshal Irshad
  • 227
  • 3
  • 17