difuse-phone-android/README.md

143 lines
7.2 KiB
Markdown
Raw Normal View History

2019-11-05 15:52:54 +00:00
[![pipeline status](https://gitlab.linphone.org/BC/public/linphone-android/badges/master/pipeline.svg)](https://gitlab.linphone.org/BC/public/linphone-android/commits/master)
2018-06-06 07:24:22 +00:00
2019-11-05 15:52:54 +00:00
Linphone is an open source softphone for voice and video over IP calling and instant messaging.
It is fully SIP-based, for all calling, presence and IM features.
2021-04-22 08:58:00 +00:00
General description is available from [linphone web site](https://www.linphone.org/technical-corner/linphone).
2019-11-05 15:52:54 +00:00
### License
Copyright © Belledonne Communications
Linphone is dual licensed, and is available either :
2020-09-22 12:22:16 +00:00
- under a [GNU/GPLv3 license](https://www.gnu.org/licenses/gpl-3.0.en.html), for free (open source). Please make sure that you understand and agree with the terms of this license before using it (see LICENSE file for details).
2019-11-05 15:52:54 +00:00
2020-09-22 12:22:16 +00:00
- under a proprietary license, for a fee, to be used in closed source applications. Contact [Belledonne Communications](https://www.linphone.org/contact) for any question about costs and services.
2019-11-05 15:52:54 +00:00
### Documentation
- Supported features and RFCs : https://www.linphone.org/technical-corner/linphone/features
- Linphone public wiki : https://wiki.linphone.org/xwiki/wiki/public/view/Linphone/
2016-11-30 14:02:24 +00:00
2021-04-22 08:58:00 +00:00
- Tutorials : https://gitlab.linphone.org/BC/public/tutorials/-/tree/master/android/kotlin
2018-11-16 10:18:12 +00:00
# What's new
2016-11-30 14:02:24 +00:00
2021-04-22 08:58:00 +00:00
App has been totally rewritten in Kotlin using modern components such as Navigation, Data Binding, View Models, coroutines, etc...
Check the [CHANGELOG](./CHANGELOG.md) file for a more detailled list.
The first linphone-android release that will be based on this will be 4.5.0, using 5.0.0 SDK.
We're also taking a fresh start regarding translations so less languages will be available for a while.
If you want to contribute, you are welcome to do so, check the [Translations](#Translations) section below.
2018-11-16 10:18:12 +00:00
2021-04-22 08:58:00 +00:00
org.linphone.legacy flavor (old java wrapper if you didn't migrate your app code to the new one yet) is no longer supported starting 5.0.0 SDK.
2019-03-20 11:01:49 +00:00
2021-04-22 08:58:00 +00:00
The sample project has been removed, we now recommend you to take a look at our [tutorials](https://gitlab.linphone.org/BC/public/tutorials/-/tree/master/android/kotlin).
2016-11-30 14:02:24 +00:00
2019-02-14 11:10:28 +00:00
# Building the app
2021-04-22 08:58:00 +00:00
If you have Android Studio, simply open the project, wait for the gradle synchronization and then build/install the app.
2019-02-14 11:15:48 +00:00
It will download the linphone library from our Maven repository as an AAR file so you don't have to build anything yourself.
2019-02-14 11:10:28 +00:00
2019-02-14 11:15:48 +00:00
If you don't have Android Studio, you can build and install the app using gradle:
2019-02-14 11:10:28 +00:00
```
2019-02-14 11:15:48 +00:00
./gradlew assembleDebug
2019-02-14 11:10:28 +00:00
```
2019-02-14 11:15:48 +00:00
will compile the APK file (assembleRelease to instead if you want to build a release package), and then
2019-02-14 11:10:28 +00:00
```
./gradlew installDebug
```
2019-02-14 11:15:48 +00:00
to install the generated APK in the previous step (use installRelease instead if you built a release package).
2019-02-14 11:10:28 +00:00
2019-02-14 11:15:48 +00:00
APK files are stored within ```./app/build/outputs/apk/debug/``` and ```./app/build/outputs/apk/release/``` directories.
2019-02-14 11:10:28 +00:00
2021-04-22 08:58:00 +00:00
When building a release AppBundle, use releaseAppBundle target instead of release.
Also make sure you have a NDK installed and that you have an environment variable named ```ANDROID_NDK_HOME``` that contains the path to the NDK.
This is to be able to include native libraries symbols into app bundle for the Play Store.
2018-11-15 14:06:20 +00:00
## Building a local SDK
2016-11-30 14:02:24 +00:00
1. Clone the linphone-sdk repository from out gitlab:
2016-11-30 14:02:24 +00:00
```
2018-11-20 09:48:23 +00:00
git clone https://gitlab.linphone.org/BC/public/linphone-sdk.git --recursive
2016-11-30 14:02:24 +00:00
```
2018-11-15 14:06:20 +00:00
2. Follow the instructions in the linphone-sdk/README file to build the SDK.
2016-11-30 14:02:24 +00:00
2020-04-06 11:14:21 +00:00
3. Create or edit the gradle.properties file in $GRADLE_USER_HOME (usually ~/.gradle/) and add the absolute path to your linphone-sdk build directory, for example:
```
LinphoneSdkBuildDir=/home/<username>/linphone-sdk/build/
```
4. Rebuild the app in Android Studio.
2016-11-30 14:02:24 +00:00
2018-11-26 13:13:07 +00:00
## Native debugging
1. Install LLDB from SDK Tools in Android-studio.
2. In Android-studio go to Run->Edit Configurations->Debugger.
3. Select 'Dual' or 'Native' and add the path to linphone-sdk debug libraries (build/libs-debug/ for example).
2018-11-26 13:13:07 +00:00
4. Open native file and put your breakpoint on it.
2019-03-20 11:01:49 +00:00
5. Make sure you are using the debug AAR in the app/build.gradle script and not the release one (to have faster builds by default the release AAR is used even for debug APK flavor).
6. Debug app.
2018-11-26 13:13:07 +00:00
2020-09-22 12:22:16 +00:00
## Known issues
- If you encounter the `couldn't find "libc++_shared.so"` crash when the app starts, simply clean the project in Android Studio (under Build menu) and build again.
Also check you have built the SDK for the right CPU architecture using the `-DLINPHONESDK_ANDROID_ARCHS=armv7,arm64,x86,x86_64` cmake parameter.
- Push notification might not work when app has been started by Android Studio consecutively to an install. Remove the app from the recent activity view and start it again using the launcher icon to resolve this.
2020-02-20 13:08:07 +00:00
## Troubleshouting
2021-04-22 08:58:00 +00:00
When submitting an issue on our [Github repository](https://github.com/BelledonneCommunications/linphone-android), please follow the template and attach the matching library logs:
2020-02-20 13:08:07 +00:00
2020-09-22 12:22:16 +00:00
1. To enable them, go to Settings -> Advanced and toggle `Debug Mode`. If they are already enabled, clear them first using the `Reset logs` button on the About page.
2020-09-22 12:22:16 +00:00
2. Then restart the app, reproduce the issue and upload the logs using the `Send logs` button on the About page.
2020-02-20 13:08:07 +00:00
2020-09-22 12:22:16 +00:00
3. Finally paste the link to the uploaded logs (link is already in the clipboard after a sucessful upload).
2020-02-20 13:08:07 +00:00
2019-02-14 11:15:48 +00:00
## Create an APK with a different package name
2016-11-30 14:02:24 +00:00
2021-04-22 08:58:00 +00:00
Before the 4.1 release, there were a lot of files to edit to change the package name.
Now, simply edit the app/build.gradle file and change the value returned by method ```getPackageName()```
2018-11-15 14:06:20 +00:00
The next build will automatically use this value everywhere thanks to ```manifestPlaceholders``` feature of gradle and Android.
2016-11-30 14:02:24 +00:00
2021-04-22 08:58:00 +00:00
You may have already noticed that the app installed by Android Studio has ```org.linphone.debug``` package name.
2019-11-05 15:52:54 +00:00
If you build the app as release, the package name will be ```org.linphone```.
2016-11-30 14:02:24 +00:00
2018-11-15 14:06:20 +00:00
## Firebase push notifications
2016-11-30 14:02:24 +00:00
2018-11-15 14:06:20 +00:00
Now that Google Cloud Messaging has been deprecated and will be completely removed on April 11th 2019, the only official way of using push notifications is through Firebase.
2018-11-15 14:10:00 +00:00
2021-04-22 08:58:00 +00:00
However to make Firebase push notifications work, the project needs to have a ```app/google-services.json``` file that contains the configuration.
2020-04-06 11:14:21 +00:00
We have archived our own, so you can build your linphone-android application and still receive push notifications from our free SIP service (sip.linphone.org).
If you delete it, you won't receive any push notification.
2016-11-30 14:02:24 +00:00
2020-04-06 11:14:21 +00:00
If you have your own push server, replace this file by yours.
2019-01-18 10:46:07 +00:00
## Translations
2021-04-22 08:58:00 +00:00
We no longer use transifex for the translation process, instead we have deployed our own instance of [Weblate](https://weblate.linphone.org/).
2019-01-18 10:46:07 +00:00
Due to the full app rewrite we can't re-use previous translations, so we'll be very happy if you want to contribute.
2019-01-18 10:46:07 +00:00
# CONTRIBUTIONS
In order to submit a patch for inclusion in linphone's source code:
2019-11-05 15:52:54 +00:00
1. First make sure your patch applies to latest git sources before submitting: patches made to old versions can't and won't be merged.
2021-09-10 15:15:13 +00:00
2. Fill out and send us an email with the link of pullrequest and the [Contributor Agreement](https://linphone.org/sites/default/files/bc-contributor-agreement_0.pdf) for your patch to be included in the git tree.
2018-11-15 14:10:00 +00:00
2020-02-20 13:08:07 +00:00
The goal of this agreement to grant us peaceful exercise of our rights on the linphone source code, while not losing your rights on your contribution.