2020-08-17 11:03:43 +03:00
# Jitsi in Element Android
2022-05-30 15:34:32 +03:00
<!-- - TOC -->
2022-05-30 15:35:11 +03:00
* [Native Jitsi SDK ](#native-jitsi-sdk )
* [How to build the Jitsi Meet SDK ](#how-to-build-the-jitsi-meet-sdk )
* [Jitsi version ](#jitsi-version )
* [Run the build script ](#run-the-build-script )
* [Link with the new generated library ](#link-with-the-new-generated-library )
* [Sanity tests ](#sanity-tests )
* [Export the build library ](#export-the-build-library )
2022-05-30 15:34:32 +03:00
<!-- - END -->
2023-12-13 13:01:40 +03:00
Native Jitsi support has been added to Element Android by the PR [#1914 ](https://github.com/element-hq/element-android/pull/1914 ). The description of the PR contains some documentation about the behaviour in each possible room configuration.
2020-08-17 11:03:43 +03:00
2023-12-13 13:01:40 +03:00
Also, ensure to have a look on [the documentation from Element Web ](https://github.com/element-hq/element-web/blob/develop/docs/jitsi.md )
2020-08-17 11:03:43 +03:00
The official documentation about how to integrate the Jitsi SDK in an Android app is available here: https://jitsi.github.io/handbook/docs/dev-guide/dev-guide-android-sdk.
2022-05-30 15:34:32 +03:00
## Native Jitsi SDK
2020-08-17 11:03:43 +03:00
The Jitsi SDK is built by ourselves with the flag LIBRE_BUILD, to be able to be integrated on the F-Droid version of Element Android.
2023-12-13 13:01:40 +03:00
The generated maven repository is then host in the project https://github.com/element-hq/jitsi_libre_maven
2020-08-17 11:03:43 +03:00
2022-05-30 15:34:32 +03:00
### How to build the Jitsi Meet SDK
2020-08-17 11:03:43 +03:00
2022-05-30 15:34:32 +03:00
#### Jitsi version
2020-08-17 11:03:43 +03:00
2024-09-18 17:54:43 +03:00
Update the script `./tools/jitsi/build_jitsi_libs.sh` with the tag of the project `https://github.com/jitsi/jitsi-meet` .
2020-08-17 11:03:43 +03:00
2022-03-29 14:26:41 +03:00
Latest tag can be found from this page: https://github.com/jitsi/jitsi-meet-release-notes/blob/master/CHANGELOG-MOBILE-SDKS.md
2024-09-18 17:41:30 +03:00
Currently we are building the version with the tag `mobile-sdk-10.2.0` .
2020-08-17 11:03:43 +03:00
2022-05-30 15:34:32 +03:00
#### Run the build script
2020-08-17 11:03:43 +03:00
At the root of the Element Android, run the following script:
```shell script
2024-09-18 17:54:43 +03:00
./tools/jitsi/build_jitsi_libs.sh
2020-08-17 11:03:43 +03:00
```
It will build the Jitsi Meet Android library and put every generated files in the folder `/tmp/jitsi`
2022-05-30 15:34:32 +03:00
#### Link with the new generated library
2020-08-17 11:03:43 +03:00
- Update the file `./build.gradle` to use the previously created local Maven repository. Currently we have this line:
```groovy
2024-09-18 17:41:30 +03:00
url "https://github.com/element-hq/jitsi_libre_maven/raw/main/mobile-sdk-10.2.0"
2020-08-17 11:03:43 +03:00
```
You can uncomment and update the line starting with `// url "file://...` and comment the line starting with `url` , to test the library using the locally generated Maven repository.
2021-02-10 14:15:32 +03:00
- Update the dependency of the Jitsi Meet library in the file `./vector/build.gradle` . Currently we have this line:
2020-08-17 11:03:43 +03:00
```groovy
2024-09-18 17:41:30 +03:00
api('org.jitsi.react:jitsi-meet-sdk:10.2.0')
2020-08-17 11:03:43 +03:00
```
- Perform a gradle sync and build the project
- Perform test
2022-05-30 15:34:32 +03:00
#### Sanity tests
2020-08-17 11:03:43 +03:00
In order to validate that the upgrade of the Jitsi and WebRTC dependency does not break anything, the following sanity tests have to be performed, using two devices:
- Make 1-1 audio call (so using WebRTC)
- Make 1-1 video call (so using WebRTC)
- Create and join a conference call with audio only (so using Jitsi library). Leave the conference. Join it again.
- Create and join a conference call with audio and video (so using Jitsi library) Leave the conference. Join it again.
2022-05-30 15:34:32 +03:00
#### Export the build library
2020-08-17 11:03:43 +03:00
If all the tests are passed, you can export the generated Jitsi library to our Maven repository.
2023-12-13 13:01:40 +03:00
- Clone the project https://github.com/element-hq/jitsi_libre_maven.
2020-08-17 11:03:43 +03:00
- Create a new folder with the version name.
- Copy every generated files form `/tmp/jitsi` to the folder you have just created.
2023-12-13 13:01:40 +03:00
- Commit and push the change on https://github.com/element-hq/jitsi_libre_maven.
2020-08-17 11:03:43 +03:00
- Update the file `./build.gradle` to use the previously created Maven repository. Currently we have this line:
```groovy
2024-09-18 17:41:30 +03:00
url "https://github.com/element-hq/jitsi_libre_maven/raw/main/mobile-sdk-10.2.0"
2020-08-17 11:03:43 +03:00
```
- Build the project and perform the sanity tests again.
2022-05-30 22:07:26 +03:00
- Create a PR for project Element Android and add a changelog file `<PR_NUMBER>.misc` to notify about the library upgrade.