forked from jitsi/jitsi-meet
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[RN] Add initial Jitsi Meet SDK for Android
Dames en heren, welcome to Jitsi Meet SDK for Android, the Jitsi Meet library for Android. The Jitsi Meet SDK encapsulates React Native and all the dependencies Jitsi Meet has so other aopplications can integrate it easily. Unlike iOS, creating "fat" libraries is not allways (if at all) possible on Android, however, effort was put into making the integration as easy as possible. While React Native can be embedded in native applications, I don't think it was designed to be embedded as part of an Android library, hidden away from the application using it. This surfaced as a number of issues which had to be addressed specifically due to our use-case: - Activity lifecycle methods must be linked with the React Native engine, so the library provides wrapper methods. - Custom fonts have to be manually added as assets, since the provided gradle script doesn't work properly in a library target. - The RN packager has to be manually triggered since the gradle script will no longer do it for us. At this stage, the Jitsi Meet application is just a small single activity application which uses the Jitsi Meet SDK to create a single activity which represents the entire application. Events and external conference handling are forthcoming. PS: Yours truly would like to add that it was a lot more fun to work on the iOS side of things.
- Loading branch information
Showing
22 changed files
with
747 additions
and
330 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,134 @@ | ||
# Jitsi Meet for Android | ||
|
||
This directory contains the source code for Jitsi Meet for Android (the | ||
application) and the Jitsi Meet SDK for Android. | ||
|
||
## Jitsi Meet SDK | ||
|
||
Jitsi Meet SDK is an Android library which embodies the Jitsi Meet experience, | ||
gift-wrapped so other applications can use it. Example use: | ||
|
||
```java | ||
package org.jitsi.example; | ||
|
||
import android.support.v7.app.AppCompatActivity; | ||
import android.os.Bundle; | ||
|
||
import org.jitsi.meet.sdk.*; | ||
|
||
|
||
public class CustomActivity extends AppCompatActivity { | ||
private JitsiMeetView jitsiMeetView; | ||
|
||
@Override | ||
public void onBackPressed() { | ||
if (!JitsiMeetView.onBackPressed()) { | ||
// Invoke the default handler if it wasn't handled by React. | ||
super.onBackPressed(); | ||
} | ||
} | ||
|
||
@Override | ||
protected void onCreate(Bundle savedInstanceState) { | ||
super.onCreate(savedInstanceState); | ||
|
||
jitsiMeetView = new JitsiMeetView(this); | ||
jitsiMeetView.loadURL(null); | ||
|
||
setContentView(jitsiMeetView); | ||
} | ||
|
||
@Override | ||
public void onNewIntent(Intent intent) { | ||
JitsiMeetView.onNewIntent(intent); | ||
} | ||
|
||
@Override | ||
protected void onDestroy() { | ||
super.onDestroy(); | ||
JitsiMeetView.onHostDestroy(this); | ||
} | ||
|
||
@Override | ||
protected void onPause() { | ||
super.onPause(); | ||
JitsiMeetView.onHostPause(this); | ||
} | ||
|
||
@Override | ||
protected void onResume() { | ||
super.onResume(); | ||
JitsiMeetView.onHostResume(this); | ||
} | ||
|
||
} | ||
``` | ||
|
||
Alternatively, you can use the `JitsiMeetBaseActivity` class, which already has | ||
all activity lifecycle methods hooked up: | ||
|
||
```java | ||
package org.jitsi.example; | ||
|
||
import org.jitsi.meet.sdk.*; | ||
|
||
|
||
public class MainActivity extends JitsiMeetBaseActivity { | ||
} | ||
|
||
``` | ||
|
||
### JitsiMeetBaseActivity | ||
|
||
This class encapsulates a high level API in the form of an Android activity | ||
which displays a single `JitsiMeetView` views. | ||
|
||
#### loadURL(url) | ||
|
||
See JitsiMeetView.loadURL. | ||
|
||
|
||
### JitsiMeetView | ||
|
||
The `JitsiMeetView` class is the core of Jitsi Meet SDK. It's designed to | ||
display a Jitsi Meet conference view (or a welcome page). | ||
|
||
#### loadURL(url) | ||
|
||
Loads the given URL and joins the conference which is being pointed to. If null, | ||
it will load the welcome page. | ||
|
||
#### onBackPressed() | ||
|
||
Helper method which should be called from the activity's `onBackPressed` method. | ||
If this function returns `true` it means the action was handled and thus no | ||
extra processing is required, otherwise the application should call the parent's | ||
`onBackPressed` method. | ||
|
||
This is a static method. | ||
|
||
#### onHostDestroy(activity) | ||
|
||
Helper method which should be called from the activity's `onDestroy` method. | ||
|
||
This is a static method. | ||
|
||
#### onHostPause(activity) | ||
|
||
Helper method which should be called from the activity's `onPause` method. | ||
|
||
This is a static method. | ||
|
||
#### onHostResume(activity) | ||
|
||
Helper method which should be called from the activity's `onResume` method. | ||
|
||
This is a static method. | ||
|
||
#### onNewIntent(intent) | ||
|
||
Helper method for integrating the *deep linking* functionality. If your | ||
application's activity is launched in "singleTask" mode this method should | ||
be called from the activity's `onNewIntent` method. | ||
|
||
This is a static method. |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.