[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.
2017-05-22 13:33:42 +00:00
|
|
|
apply plugin: 'com.android.library'
|
2017-09-12 01:12:11 +00:00
|
|
|
apply plugin: 'maven-publish'
|
[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.
2017-05-22 13:33:42 +00:00
|
|
|
|
|
|
|
android {
|
|
|
|
compileSdkVersion rootProject.ext.compileSdkVersion
|
|
|
|
|
|
|
|
defaultConfig {
|
|
|
|
minSdkVersion rootProject.ext.minSdkVersion
|
|
|
|
targetSdkVersion rootProject.ext.targetSdkVersion
|
|
|
|
}
|
|
|
|
|
|
|
|
buildTypes {
|
|
|
|
debug {}
|
|
|
|
release {
|
|
|
|
minifyEnabled false
|
|
|
|
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
dependencies {
|
2018-09-21 15:01:16 +00:00
|
|
|
implementation fileTree(dir: 'libs', include: ['*.jar'])
|
[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.
2017-05-22 13:33:42 +00:00
|
|
|
|
2018-09-21 15:01:16 +00:00
|
|
|
implementation "com.android.support:support-v4:${rootProject.ext.supportLibVersion}"
|
|
|
|
implementation "com.android.support:appcompat-v7:${rootProject.ext.supportLibVersion}"
|
[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.
2017-05-22 13:33:42 +00:00
|
|
|
|
2019-01-24 15:37:55 +00:00
|
|
|
implementation 'com.amplitude:android-sdk:2.14.1'
|
2018-09-21 15:01:16 +00:00
|
|
|
implementation 'com.dropbox.core:dropbox-core-sdk:3.0.8'
|
|
|
|
api 'com.facebook.react:react-native:+'
|
|
|
|
|
|
|
|
implementation project(':react-native-background-timer')
|
|
|
|
implementation project(':react-native-calendar-events')
|
|
|
|
implementation(project(':react-native-fast-image')) {
|
|
|
|
exclude group: 'com.android.support'
|
|
|
|
}
|
|
|
|
implementation(project(":react-native-google-signin")) {
|
2018-08-10 10:30:00 +00:00
|
|
|
exclude group: 'com.google.android.gms'
|
2018-09-21 15:01:16 +00:00
|
|
|
exclude group: 'com.android.support'
|
2018-08-10 10:30:00 +00:00
|
|
|
}
|
2018-09-21 15:01:16 +00:00
|
|
|
implementation project(':react-native-immersive')
|
|
|
|
implementation project(':react-native-keep-awake')
|
|
|
|
implementation project(':react-native-linear-gradient')
|
|
|
|
implementation project(':react-native-sound')
|
|
|
|
implementation project(':react-native-vector-icons')
|
|
|
|
implementation project(':react-native-webrtc')
|
|
|
|
|
|
|
|
testImplementation 'junit:junit:4.12'
|
[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.
2017-05-22 13:33:42 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2018-09-21 15:01:16 +00:00
|
|
|
// Here we bundle all assets, resources and React files. We cannot use the
|
|
|
|
// react.gradle file provided by react-native because it's designed to be used
|
|
|
|
// in an application (it taps into applicationVariants, but the SDK is a library
|
|
|
|
// so we need libraryVariants instead).
|
|
|
|
android.libraryVariants.all { def variant ->
|
|
|
|
// Create variant and target names
|
|
|
|
def targetName = variant.name.capitalize()
|
|
|
|
def targetPath = variant.dirName
|
|
|
|
|
|
|
|
// React js bundle directories
|
|
|
|
def jsBundleDir = file("$buildDir/generated/assets/react/${targetPath}")
|
|
|
|
def resourcesDir = file("$buildDir/generated/res/react/${targetPath}")
|
|
|
|
|
|
|
|
def jsBundleFile = file("$jsBundleDir/index.android.bundle")
|
|
|
|
|
|
|
|
def currentBundleTask = tasks.create(
|
|
|
|
name: "bundle${targetName}JsAndAssets",
|
|
|
|
type: Exec) {
|
|
|
|
group = "react"
|
|
|
|
description = "bundle JS and assets for ${targetName}."
|
|
|
|
|
|
|
|
// Create dirs if they are not there (e.g. the "clean" task just ran)
|
|
|
|
doFirst {
|
|
|
|
jsBundleDir.deleteDir()
|
|
|
|
jsBundleDir.mkdirs()
|
|
|
|
resourcesDir.deleteDir()
|
|
|
|
resourcesDir.mkdirs()
|
|
|
|
}
|
|
|
|
|
|
|
|
// Set up inputs and outputs so gradle can cache the result
|
|
|
|
def reactRoot = file("${projectDir}/../../")
|
|
|
|
inputs.files fileTree(dir: reactRoot, excludes: ["android/**", "ios/**"])
|
|
|
|
outputs.dir jsBundleDir
|
|
|
|
outputs.dir resourcesDir
|
|
|
|
|
|
|
|
// Set up the call to the react-native cli
|
|
|
|
workingDir reactRoot
|
|
|
|
|
|
|
|
// Set up dev mode
|
|
|
|
def devEnabled = !targetName.toLowerCase().contains("release")
|
|
|
|
|
|
|
|
// Run the bundler
|
|
|
|
commandLine(
|
|
|
|
"node",
|
|
|
|
"node_modules/react-native/local-cli/cli.js",
|
|
|
|
"bundle",
|
|
|
|
"--platform", "android",
|
|
|
|
"--dev", "${devEnabled}",
|
|
|
|
"--reset-cache",
|
|
|
|
"--entry-file", "index.android.js",
|
|
|
|
"--bundle-output", jsBundleFile,
|
|
|
|
"--assets-dest", resourcesDir)
|
|
|
|
|
|
|
|
// Disable bundling on dev builds
|
|
|
|
enabled !devEnabled
|
[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.
2017-05-22 13:33:42 +00:00
|
|
|
}
|
|
|
|
|
2018-09-21 15:01:16 +00:00
|
|
|
currentBundleTask.ext.generatedResFolders = files(resourcesDir).builtBy(currentBundleTask)
|
|
|
|
currentBundleTask.ext.generatedAssetsFolders = files(jsBundleDir).builtBy(currentBundleTask)
|
|
|
|
variant.registerGeneratedResFolders(currentBundleTask.generatedResFolders)
|
|
|
|
|
2019-03-08 13:17:45 +00:00
|
|
|
def mergeAssetsTask = variant.mergeAssetsProvider.get()
|
|
|
|
def mergeResourcesTask = variant.mergeResourcesProvider.get()
|
|
|
|
|
|
|
|
mergeAssetsTask.dependsOn(currentBundleTask)
|
|
|
|
mergeResourcesTask.dependsOn(currentBundleTask)
|
|
|
|
|
|
|
|
mergeAssetsTask.doLast {
|
|
|
|
def assetsDir = mergeAssetsTask.outputDir
|
2017-06-22 13:46:18 +00:00
|
|
|
|
2018-10-16 09:40:24 +00:00
|
|
|
// Bundle fonts
|
2018-09-21 15:01:16 +00:00
|
|
|
//
|
|
|
|
copy {
|
2017-06-22 13:46:18 +00:00
|
|
|
from("${projectDir}/../../fonts/jitsi.ttf")
|
2018-09-21 15:01:16 +00:00
|
|
|
into("${assetsDir}/fonts")
|
[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.
2017-05-22 13:33:42 +00:00
|
|
|
}
|
2017-06-22 13:46:18 +00:00
|
|
|
|
2018-09-21 15:01:16 +00:00
|
|
|
// Bundle sounds
|
|
|
|
//
|
|
|
|
copy {
|
2019-01-13 19:34:38 +00:00
|
|
|
from("${projectDir}/../../sounds/incomingMessage.wav")
|
2018-09-21 15:01:16 +00:00
|
|
|
from("${projectDir}/../../sounds/joined.wav")
|
|
|
|
from("${projectDir}/../../sounds/left.wav")
|
|
|
|
from("${projectDir}/../../sounds/outgoingRinging.wav")
|
|
|
|
from("${projectDir}/../../sounds/outgoingStart.wav")
|
|
|
|
from("${projectDir}/../../sounds/recordingOn.mp3")
|
|
|
|
from("${projectDir}/../../sounds/recordingOff.mp3")
|
|
|
|
from("${projectDir}/../../sounds/rejected.wav")
|
|
|
|
into("${assetsDir}/sounds")
|
2018-04-05 19:12:24 +00:00
|
|
|
}
|
|
|
|
|
2018-09-21 15:01:16 +00:00
|
|
|
// Copy React assets
|
2017-06-22 13:46:18 +00:00
|
|
|
//
|
2018-09-21 15:01:16 +00:00
|
|
|
if (currentBundleTask.enabled) {
|
|
|
|
copy {
|
2019-03-08 13:17:45 +00:00
|
|
|
from(jsBundleFile)
|
2018-09-21 15:01:16 +00:00
|
|
|
into(assetsDir)
|
|
|
|
}
|
2017-06-22 13:46:18 +00:00
|
|
|
}
|
2018-09-21 15:01:16 +00:00
|
|
|
}
|
2017-06-22 13:46:18 +00:00
|
|
|
|
2019-03-08 13:17:45 +00:00
|
|
|
mergeResourcesTask.doLast {
|
2018-09-21 15:01:16 +00:00
|
|
|
// Copy React resources
|
|
|
|
//
|
|
|
|
if (currentBundleTask.enabled) {
|
|
|
|
copy {
|
|
|
|
from(resourcesDir)
|
2019-03-08 13:17:45 +00:00
|
|
|
into(mergeResourcesTask.outputDir)
|
2018-09-21 15:01:16 +00:00
|
|
|
}
|
|
|
|
}
|
[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.
2017-05-22 13:33:42 +00:00
|
|
|
}
|
|
|
|
}
|
2017-09-12 01:12:11 +00:00
|
|
|
|
2018-09-21 15:01:16 +00:00
|
|
|
|
2017-09-12 01:12:11 +00:00
|
|
|
publishing {
|
|
|
|
publications {
|
|
|
|
aarArchive(MavenPublication) {
|
|
|
|
groupId 'org.jitsi.react'
|
|
|
|
artifactId 'jitsi-meet-sdk'
|
2018-11-30 16:08:48 +00:00
|
|
|
version project.sdkVersion
|
2017-09-12 01:12:11 +00:00
|
|
|
|
|
|
|
artifact("${project.buildDir}/outputs/aar/${project.name}-release.aar") {
|
|
|
|
extension "aar"
|
|
|
|
}
|
|
|
|
pom.withXml {
|
|
|
|
def pomXml = asNode()
|
|
|
|
pomXml.appendNode('name', 'jitsi-meet-sdk')
|
|
|
|
pomXml.appendNode('description', 'Jitsi Meet SDK for Android')
|
|
|
|
def dependencies = pomXml.appendNode('dependencies')
|
|
|
|
configurations.getByName('releaseCompileClasspath').getResolvedConfiguration().getFirstLevelModuleDependencies().each {
|
|
|
|
// The (third-party) React Native modules that we depend on
|
|
|
|
// are in source code form and do not have groupId. That is
|
|
|
|
// why we have a dedicated groupId for them. But the other
|
|
|
|
// dependencies come through Maven and, consequently, have
|
|
|
|
// groupId.
|
|
|
|
def groupId = it.moduleGroup
|
|
|
|
def artifactId = it.moduleName
|
|
|
|
|
|
|
|
if (artifactId.startsWith('react-native-')
|
|
|
|
&& groupId.equals('jitsi-meet')) {
|
|
|
|
groupId = rootProject.ext.moduleGroupId
|
|
|
|
}
|
|
|
|
|
|
|
|
def dependency = dependencies.appendNode('dependency')
|
|
|
|
dependency.appendNode('groupId', groupId)
|
|
|
|
dependency.appendNode('artifactId', artifactId)
|
|
|
|
dependency.appendNode('version', it.moduleVersion)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
repositories {
|
2018-11-30 16:20:14 +00:00
|
|
|
maven { url "file:${rootProject.projectDir}/../../jitsi-maven-repository/releases" }
|
2017-09-12 01:12:11 +00:00
|
|
|
}
|
|
|
|
}
|