Commit Graph

125 Commits

Author SHA1 Message Date
Lyubo Marinov 2356238887 [Android] Reduce boilerplate/duplication 2017-08-21 13:58:13 -05:00
Saúl Ibarra Corretgé ca80839094 [Android] Fix gradle and plugin versions with Android Studio 3.0 Canary 9 2017-08-08 14:48:43 -05:00
Saúl Ibarra Corretgé 1c1604bee7 [Android] Don't mute the microphone under any circumstance
It's a global action, and if we do that other applications won't be able to use
it. I experienced this with the system camera. We do, however, make sure to
enable it when we need to.

Note that enabling it doesn't mean we are *using* it. It just means we *can*,
and that we will get actual audio when we do.
2017-08-03 13:45:41 -05:00
Saúl Ibarra Corretgé 99fd325a51 [Android] Fix gradle warning
This setting is no longer used.
2017-08-03 13:45:41 -05:00
Saúl Ibarra Corretgé 4f6ec920cd [Android] Set targetApiVersion to 25
We keep being compatible with versions all the way down to 16 for now, but this
will disable internal compatibility shims when running on 25.
2017-08-03 13:45:41 -05:00
Saúl Ibarra Corretgé 0d33844d51 [Android] Use an appropriate Android support library version
It must match the compileSdkVersion major number.
2017-08-03 13:45:41 -05:00
Lyubo Marinov 504646fff0 Coding style 2017-08-03 13:45:41 -05:00
Saúl Ibarra Corretgé 122ebe48c7 [RN] Cache avatars and provide a default in case load fails
Avatars are cached to the filesystem and loaded from there when requested again.
The cache is cleaned after a conference ends and on application startup
(defensive move).

In addition, implement a fully local avatar system, which is used as a fallback
when loading a remote avatar fails. It can also be forced using a prop.

The fully local avatars use a user icon as a mask and apply a background color
qhich is picked by hashing the URI passed to the avatar. If no URI is passed a
random color is chosen.

A grace period of 1 second is also implemented so a default local avatar will be
rendered if an Avatar component is mounted but has no URI. If a URI is specified
later on, it will be loaded and displayed. In case loading the remote avatar
fails, the locally generated one will be used.
2017-08-03 13:45:41 -05:00
Lyubo Marinov 1ad8436cb5 [Android] Use loadURL in the app 2017-08-01 12:07:22 -05:00
Saúl Ibarra Corretgé bfa5f4c953 [Android] Fix resource leak when JitsiMeetView is destroyed
In iOS this is automagically done in the view destructor, bunt we don't have
that luxury in Java we have to do it manually.

The new disponse() method MUST be called when the Activity holding the view is
going to be destroyed, typically in the onDestroy() handler.
2017-07-28 10:50:12 -05:00
Saúl Ibarra Corretgé d00ee3d7b6 [Android] Add an example for loadURLObject 2017-07-28 09:19:07 -05:00
Lyubo Marinov 3546cf4915 Fixes jsdocs, formatting 2017-07-26 15:54:57 -05:00
Lyubo Marinov a2c2d3bee1 [RN] Alternative to JitsiMeetView.loadURL w/o URL
Introduces loadURLObject in JitsiMeetView on Android and iOS which
accepts a Bundle and NSDictionary, respectively, similar in structure to
the JS object accepted by the constructor of Web's ExternalAPI. At this
time, only the property url of the bundle/dictionary is supported.
However, it allows the public API of loadURLObject to be consumed. The
property url will be made optional in the future and other properties
will be supported from which a URL will be constructed.
2017-07-26 15:53:35 -05:00
Saúl Ibarra Corretgé 51934dac1b [Android] Fix gradle version with Android Studio 3.0 Canary 8 2017-07-26 17:30:45 +02:00
Lyubo Marinov f0ab835b46 [RN] Add loadURLString to JitsiMeetView
Initializing a new URL/NSURL instance is a chore especially when one
takes into account that the JavaScript side (1) is loading the URL
asynchronously and (2) is capable of parsing strings that may or may not
be represented as URL/NSURL.

The Android method loadURLString(String) may have been called
loadURL(String) to overload loadURL(URL) but I didn't want to do that
because:

1. It would not be compatible with existing source code such as
loadURL(null) which would have become ambiguous.

2. I wanted to achieve better convergence with the iOS API.
2017-07-25 19:07:01 -05:00
Saúl Ibarra Corretgé 4efbbe14b1 [Android] Require OpenGL ES 2.0
This was already an implicit requirement, as it's the only version implemented
in libwebrtc.

The reason to add this is to (defensively) try to filter old devices which may
not implement it.

WebRTC's own Android demo app defines this.
2017-07-19 16:36:42 -05:00
Saúl Ibarra Corretgé 326ce4217f [Android] Fix gradle and plugin versions with Android Studio 3.0 Canary 6 2017-07-17 11:32:57 -05:00
Lyubo Marinov e54744e5ef [Android] Use target API 23 2017-07-16 02:26:09 -05:00
Saúl Ibarra Corretgé 96bfcafc97 [Android] Use target API 23
This reverts commit c9a29153dd.

Now that react-native-webrtc supports the permissions system in 23, use it since
it provides a more pleasant experience to users.

In addition, fix a bug in the previous code: the React Native view must be
loaded after we have acquired the permission to draw on top of other apps,
otherwise our app may crash while we accept the permission, since React may try
to draw.
2017-07-16 02:26:09 -05:00
Lyubo Marinov 9a295723cf Consistent formatting 2017-07-16 02:25:26 -05:00
Saúl Ibarra Corretgé 6fc1a3f45d [Android] Add comment on disabling JS packaging for dev builds 2017-07-10 17:42:39 +02:00
Lyubo Marinov 948d18f954 [Android] Fix "Minimum supported Gradle version is 4.1-milestone-1" 2017-07-06 15:20:09 -05:00
Saúl Ibarra Corretgé 01ac394e92 [Android] Fix compileSdkVersion
It must match the major number in buildToolsVersion.
2017-06-28 10:51:49 +02:00
Lyubo Marinov 8e4864004b Revert "Speed `react-native run-android` up (more)"
Reverts commit d117989b55 because it does
not bundle the fonts assets and the JS bundle.
2017-06-22 09:21:25 -05:00
Lyubo Marinov d117989b55 Speed `react-native run-android` up (more)
React Native's Gradle script does not bundle the JS bundle in the Debug
configuration. Copy that source code (and adapt it) into our sdk Gradle
script.
2017-06-20 13:14:30 -05:00
Lyubo Marinov 2fa7e777d6 Speed `react-native run-android` up 2017-06-20 10:32:44 -05:00
Saúl Ibarra Corretgé 617df1c69c [Android] Remove no longer used gradle options 2017-06-15 10:38:08 -05:00
Saúl Ibarra Corretgé c9a29153dd [RN] Lower Android target SDK version to 22
API level 22 is below 23 (aka Marshmallow), which included an overhaul in the
permissions system. React Native recommends 22 (it's the default when you create
a new app) and there have been reports when set higher [0] and [1].

This also fixes a critical bug, wherein Jitsi Meet wouldn't request permissions
for the camera and microphone.

Last, this change also allows us to get rid of the overlay checking code,
because it was only needed for API level 23 or higher.

[0]: https://github.com/facebook/react-native/pull/10479
[1]: https://github.com/facebook/react-native/issues/10587
2017-06-15 08:20:33 -05:00
Lyubo Marinov 4b2add7aa6 [Android] Allow multiple JitsiMeetViews 2017-06-10 03:34:11 -05:00
Lyubo Marinov 10e5e0fdf5 [iOS] Allow multiple JitsiMeetViews 2017-06-09 19:17:01 -05:00
Lyubo Marinov 5f64ccb97d [RN] Naming 2017-06-09 14:51:31 -05:00
Saúl Ibarra Corretgé 4687c1f465 [RN] Add ability to skip the welcome page
Also expose this in the native SDKs.
2017-06-09 14:10:10 -05:00
Lyubo Marinov a5cd118550 [Android] Naming 2017-06-09 10:55:14 -05:00
Saúl Ibarra Corretgé a266a71999 [RN] Add JitsiMeetViewAbstractListener to Android SDK 2017-06-09 09:57:06 -05:00
Saúl Ibarra Corretgé be8694f93e [RN] Remove duplicated font on Android
Copy it from the main fonts directory instead.
2017-06-09 16:05:27 +02:00
Lyubo Marinov 90466183d6 [RN] Consistency in Jitsi Meet SDK for Android 2017-06-09 00:03:23 -05:00
Saúl Ibarra Corretgé 84463d8cf0 [RN] Add workaround for loading different URLs on Android
Changing the props from native (Java) code was only added in 0.45, so add a
workaround until we get to updating our React Native dependency.
2017-06-09 00:03:23 -05:00
Saúl Ibarra Corretgé a075f24000 [RN] Add conference events to native SDKs
The current implementation doesn't use the API and Transport modules. This is
due to the fact that they are too tied to APP at the moment, which is web only.

Once API is refactored and moved into the Redux store this will be adjusted,
though it's unlikely that the lowest level React Native module (ExternalAPI)
changes drastically.

This commit also introduces a stopgap limitation of only allowing a single
instance for JitsiMeetView objects on both Android and iOS. React Native doesn't
really play well with having multiple instances of the same modules on the same
bridge, since they behave a bit like singletons. Even if we were to use multiple
bridges, some features depend on system-level global state, such as the
AVAudioSession mode or Android's immersive mode. Further attempts will be made
at lifting this limitation in the future, though.
2017-06-09 00:03:23 -05:00
Saúl Ibarra Corretgé ddea60efe9 [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-06-09 00:03:23 -05:00
Saúl Ibarra Corretgé bac191f96c [RN] Rename jitsi-meet-react to jitsi-meet 2017-05-16 12:38:36 -05:00
Lyubo Marinov 6c0ad4966e [Android] Go back to minSdkVersion 16 2017-04-19 13:55:44 -05:00
Saúl Ibarra Corretgé 5d50792a56 [RN] Make AudioMode more resilient on Android
Some devices may give an error stating that INTERACT_ACROSS_USERS_FULL
permission is neeced. This permission can only be achieved by signing the
application with the same key as the system, which is never going to happen so
deal with it by catching any exceptions setting the mode may cause and failing
as gracefully as we can.

Ref:
http://stackoverflow.com/questions/34172575/audiomanager-setmode-securityexception-on-huawei-android-4
2017-04-19 13:55:44 -05:00
Lyubo Marinov b211ce02a8 [RN] Increment short app version from 1.3 to 1.4
Now that Apple have approved build 1.3.204 for release in the App Store,
the short app version needs to be incremented; otherwise, no new builds
can be uploaded to TestFlight and, respectively, for release in the App
Store.
2017-04-09 12:00:58 -05:00
Saúl Ibarra Corretgé 13e3375e8a [RN] Use proximity sensor when in audio-only mode
When the audio-only mode is enabled, turn on the proximity sensor to dim the
screen and disable touch controls when there is an object nearby.
2017-04-05 22:06:30 -05:00
Lyubo Marinov 45e09af692 react-native 0.42.0 2017-03-07 15:09:39 -06:00
Lyubo Marinov e89c2b242d Android plugin for Gradle 2.2.3
Recent versions of the Android plugin for Gradle started to automatically
download the SDK build tools dependency if it is not installed already.
So it is no longer necessary to have the developer of the Android app
install the SDK build tools dependency in advance.
2017-02-23 13:14:19 -06:00
Yana Stamcheva 0dbbc5d8b6 [Android] Circular app/launcher icon(s) 2017-02-17 13:54:01 -06:00
Lyubomir Marinov dba1bcb0e3 [RN] Increment short app version from 1.2 to 1.3
Now that Apple have approved build 1.2.199 for release in the App Store,
the short app version needs to be incremented; otherwise, no new builds
can be uploaded to TestFlight and, respectively, for release in the App
Store.
2017-02-17 09:32:24 -06:00
Saúl Ibarra Corretgé 36f5b0218d [RN] Fix running timers in the background
Turns out React Native's timers (setTimeout / setInterval) don't run while the
app is in the background: https://github.com/facebook/react-native/issues/167

This patch replaces the global timer functions with those from the
react-native-background-timer package, which work in the background.

These timers won't magically make an application work in the background, but
they will run if an application already happens to run in the background. That's
our case while in a conference, so these timers will run, allowing XMPP pings to
be sent and the conference to stay up as long as the user desires.
2017-02-15 11:50:54 -06:00
Lyubomir Marinov 2ad869a036 Comply w/ coding style
- Use 1 name for 1 abstraction. Instead of useFullScreen and enabled use
  fullScreen.
- Comments are correct English sentences so no double spaces between
  senteces, no capitalization of the work On midsentence.
- Write as little source code as possible if readability is preserved.
- Utilize Facebook's Flow.
- The name of a private function must start with _ and the jsdoc should
  state that the function is private.
2017-02-06 15:32:03 -06:00
Saúl Ibarra Corretgé 7a8c84e990 [RN] Implement full screen mode while in a conference
The implementation varies across platforms, with the same goal: allow the app to
use the entire screen real state while in a conference.

On Android we use immersive mode, which  will hide the status and navigation bars.

https://developer.android.com/training/system-ui/immersive.html

On iOS the status bar is hidden, with a slide effect.
2017-02-06 13:51:17 -06:00
Lyubomir Marinov 0de01e93dd react-native 0.41.2 2017-02-06 12:24:38 -06:00
Lyubomir Marinov 94f3d4b279 [RN] Expand domains supported by Universal Links 2017-01-31 22:47:47 -06:00
Lyubomir Marinov fdc96044ad [RN] App-specific URL scheme 2017-01-31 22:47:47 -06:00
Lyubomir Marinov 18bc99d6b5 Split long methods into multiple shorter ones 2017-01-26 23:35:56 -06:00
Lyubomir Marinov bab94a207d Remove unnecessary source code 2017-01-26 21:08:50 -06:00
Lyubomir Marinov ef39baab47 Comply w/ coding style
- Maximum of 80 characters per line.
- Group first and then sort in alphabetical order.
- Fields should begin with a lowercase letter.
2017-01-26 21:07:35 -06:00
Saúl Ibarra Corretgé 2edaaac7bf [RN] Implement AudioMode module on Android
This module chooses the most appropriate audio default based on the specified
mode.
2017-01-26 19:18:10 -06:00
Saúl Ibarra Corretgé 113e50c074 [RN] Bump Andoroid minimum and target SDK versions
Use a minimum SDK version of 19, that is Anroid 4.4 (KitKat) and a target SDK of
23, that is, Android 6.0 (Marshmallow).
2017-01-26 19:18:10 -06:00
Lyubomir Marinov ae726cfdc0 react-native 0.40.0 2017-01-22 12:32:08 -06:00
Saúl Ibarra Corretgé 1a04e5a9af [RN] Use a translucent status bar on Android 2017-01-21 15:42:13 -06:00
Lyubomir Marinov cac68dbaba [RN] Increment short app version from 1.1 to 1.2
Now that Apple have approved build 1.1.185 for release in the App Store,
the short app version needs to be incremented; otherwise, no new builds
can be uploaded to TestFlight and, respectively, for release in the App
Store.
2017-01-20 15:01:01 -06:00
Lyubomir Marinov d1f6679f2d [RN] Remove Crashlytics 2017-01-17 21:54:17 -06:00
Saúl Ibarra Corretgé acbfe5cb09 [RN] Keep device screen on while in a conference 2017-01-16 19:12:43 -06:00
Lyubomir Marinov a887beed3a [RN] Increment short app version from 1.0 to 1.1
Now that Apple have approved build 1.0.178 for release in the App Store,
the short app version needs to be incremented; otherwise, no new builds
can be uploaded to TestFlight and, respectively, for release in the App
Store.
2017-01-06 10:34:46 -06:00
Lyubomir Marinov 4fef8a3b79 [RN] Prevent unhandled JS errors from killing the process in Release 2017-01-05 15:06:41 -06:00
yanas 5fce7f6ba2 Updates the react native font. 2016-12-21 15:00:24 -06:00
Lyubomir Marinov d939ae5fb2 Rename the package of the Android app 2016-12-06 17:23:39 -06:00
Lyubomir Marinov 727df551e6 Merge branch 'android-version' 2016-12-06 14:26:50 -06:00
damencho e5dc7058c1 Adds android version variable.
The variables in gradle.properties can be overridden on command line like: -Pversion=1.
2016-12-06 13:57:38 -06:00
Yana Stamcheva fc3e0147e0 [Android] Launcher icons 2016-11-08 10:38:13 -06:00
Lyubomir Marinov d875b35b32 [Android] Crashlytics 2016-10-30 18:12:33 -05:00
Matt Laux c18caf52d0 Fix Android launcher intent so that app appears in drawer. 2016-10-19 10:59:09 -05:00
Lyubomir Marinov 1ff0bdbcfd Fix the in-app icons on Android
Bundle our custom icon font jitsi.ttf in the Android app (which we
already do for the iOS app).

Additionally, remove icon font files which are not in use.
2016-10-19 09:10:11 -05:00
Lyubomir Marinov 7f3ff13c18 Merge jitsi-meet-react's mobile support
As a step toward merging jitsi-meet-react with jitsi-meet to share as
much source code as possible between mobile and Web, merge the part of
jitsi-meet-react's source tree which supports mobile inside the
jitsi-meet source tree and leave jitsi-meet-react's Web support in the
source code revision history but don't have it in master anymore because
it's different from jitsi-meet's Web support. In other words, the two
projects are mechanically merged at the file level and don't really
share source code between mobile and Web.
2016-10-12 10:31:52 -05:00