Update Readme

This commit is contained in:
Erwan Croze 2017-02-24 15:20:31 +01:00
parent 8b8c67873b
commit da12ebdd0a
2 changed files with 23 additions and 11 deletions

View file

@ -4,7 +4,7 @@ Linphone is a free VoIP and video softphone based on the SIP protocol.
## To build liblinphone for Android, you must: ## To build liblinphone for Android, you must:
1. Download the Android sdk (API 23 at least) with platform-tools and tools updated to latest revision, then add both 'tools' and 'platform-tools' folders in your path. 1. Download the Android sdk (API 25 at least) with platform-tools and tools updated to latest revision, then add both 'tools' and 'platform-tools' folders in your path.
2. Download the Android ndk (version r11c or 13b) from google and add it to your path (no symlink !!!). 2. Download the Android ndk (version r11c or 13b) from google and add it to your path (no symlink !!!).
@ -60,7 +60,11 @@ You can speed up the compilation by using ccache (compiler cache, see [ccache.sa
## Firebase ## Firebase
To enable firebase in Linphone, just add your 'google-service.json' in project root and you key in 'res/values/non_localizable_custom.xml' To enable firebase in Linphone, just add your 'google-service.json' in project root, add your key at 'push_sender_id' and add 'firebase' at 'push_type' in 'res/values/non_localizable_custom.xml'
## Google
To enable google push in Linphone, remove 'google-service.json' file if it exist, add your key at 'push_sender_id' and add 'google' at 'push_type' in 'res/values/non_localizable_custom.xml'
# TROUBLESHOOTING # TROUBLESHOOTING

View file

@ -1,7 +1,14 @@
// Project information // Project information
buildDir = 'bin' buildDir = 'bin'
ext.linphonePackageName = "org.linphone"
File googleFile2 = new File('google-services.json') def getPackageName() {
return "org.linphone"
}
def firebaseEnable() {
File googleFile = new File('google-services.json')
return googleFile.exists()
}
buildscript { buildscript {
File googleFile = new File('google-services.json') File googleFile = new File('google-services.json')
@ -19,15 +26,14 @@ buildscript {
} }
apply plugin: 'com.android.application' apply plugin: 'com.android.application'
if (googleFile2.exists()) { if (firebaseEnable()) {
apply plugin: 'com.google.gms.google-services' apply plugin: 'com.google.gms.google-services'
} }
dependencies { dependencies {
File googleFile = new File('google-services.json')
compile fileTree(dir: 'libs', include: '*.jar') compile fileTree(dir: 'libs', include: '*.jar')
if (googleFile.exists()) { if (firebaseEnable()) {
compile 'com.google.firebase:firebase-messaging:9.0.0' compile 'com.google.firebase:firebase-messaging:9.0.0'
} else { } else {
compile 'com.android.support:support-v4:+' compile 'com.android.support:support-v4:+'
@ -38,7 +44,7 @@ android {
defaultConfig { defaultConfig {
compileSdkVersion 23 compileSdkVersion 23
buildToolsVersion "25.0.2" buildToolsVersion "25.0.2"
applicationId "org.linphone" applicationId getPackageName()
multiDexEnabled true multiDexEnabled true
} }
@ -67,10 +73,13 @@ android {
sourceSets { sourceSets {
main { main {
File googleFile = new File('google-services.json')
String firebase = '' String firebase = ''
if (!googleFile.exists()) { // Exclude firebase file if not enable
if (!firebaseEnable()) {
firebase = '**/Firebase*' firebase = '**/Firebase*'
println '[Push Notification] Firebase disabled'
} else {
println '[Push Notification] Firebase enabled'
} }
manifest.srcFile 'AndroidManifest.xml' manifest.srcFile 'AndroidManifest.xml'
java.srcDirs = ['submodules/linphone/mediastreamer2/java/src','submodules/linphone/java/j2se','submodules/linphone/java/common','submodules/linphone/java/impl','submodules/externals/axmlrpc/src/main/java','submodules/linphone/coreapi/help/java','src'] java.srcDirs = ['submodules/linphone/mediastreamer2/java/src','submodules/linphone/java/j2se','submodules/linphone/java/common','submodules/linphone/java/impl','submodules/externals/axmlrpc/src/main/java','submodules/linphone/coreapi/help/java','src']
@ -83,7 +92,6 @@ android {
java.exclude '**/mediastream/MediastreamerActivity.java' java.exclude '**/mediastream/MediastreamerActivity.java'
java.exclude firebase java.exclude firebase
println firebase
} }
// Move the tests to tests/java, tests/res, etc... // Move the tests to tests/java, tests/res, etc...