Skip to content

Commit 9edff1a

Browse files
committed
1.2.0-conference-kotlin
1 parent df577da commit 9edff1a

29 files changed

+773
-392
lines changed

sample-conference-kotlin/app/build.gradle

+17-18
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
buildscript {
22
repositories {
33
google()
4-
jcenter()
4+
mavenCentral()
55
}
66
}
77

@@ -13,30 +13,29 @@ apply plugin: 'com.google.gms.google-services'
1313
apply from: "../artifacts.gradle"
1414

1515
repositories {
16-
google()
17-
jcenter()
16+
repositories {
17+
google()
18+
mavenCentral()
19+
}
1820
maven {
1921
url "https://github.com/QuickBlox/quickblox-android-sdk-releases/raw/master/"
2022
}
21-
flatDir { dirs 'libs' }
2223
}
2324

2425
android {
2526
def versionQACode = 1
2627

27-
compileSdkVersion 30
28-
buildToolsVersion "30.0.3"
29-
flavorDimensions dimensionDefault
30-
3128
defaultConfig {
29+
compileSdk 34
3230
applicationId "com.quickblox.sample.conference.kotlin"
3331
minSdkVersion 21
34-
targetSdkVersion 30
35-
versionCode 110000
36-
versionName "1.1.0"
32+
targetSdkVersion 34
33+
versionCode 120000
34+
versionName "1.2.0"
3735
multiDexEnabled true
3836
}
3937

38+
flavorDimensions dimensionDefault
4039
productFlavors {
4140
dev {
4241
dimension dimensionDefault
@@ -63,14 +62,15 @@ android {
6362
release {
6463
signingConfig signingConfigs.debug
6564
minifyEnabled true
65+
shrinkResources true
6666
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
67-
consumerProguardFiles 'proguard-rules.pro'
6867
resValue "string", "versionName", "QuickBlox Conference Kotlin\nBuild version " + defaultConfig.getVersionName()
6968
}
7069
}
7170

7271
buildFeatures {
7372
viewBinding true
73+
buildConfig true
7474
}
7575

7676
signingConfigs {
@@ -83,24 +83,23 @@ android {
8383
}
8484

8585
compileOptions {
86-
sourceCompatibility JavaVersion.VERSION_1_8
87-
targetCompatibility JavaVersion.VERSION_1_8
86+
sourceCompatibility JavaVersion.VERSION_17
87+
targetCompatibility JavaVersion.VERSION_17
8888
}
8989

9090
kotlinOptions {
91-
jvmTarget = '1.8'
91+
jvmTarget = '17'
9292
}
93+
namespace 'com.quickblox.sample.conference.kotlin'
9394
}
9495

9596
dependencies {
96-
implementation "com.quickblox:quickblox-android-sdk-conference:$qbSdkVersion"
97+
implementation "com.quickblox:quickblox-android-sdk-conference:$rootProject.qbSdkVersion"
9798
implementation "com.quickblox:quickblox-android-sdk-messages:$rootProject.qbSdkVersion"
9899
implementation "com.quickblox:quickblox-android-sdk-chat:$rootProject.qbSdkVersion"
99100
implementation "com.quickblox:quickblox-android-sdk-content:$rootProject.qbSdkVersion"
100101

101-
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlinVersion"
102102
implementation "com.google.android.material:material:$rootProject.materialAndroidXVersion"
103-
104103
implementation "androidx.appcompat:appcompat:$rootProject.appcompatAndroidXVersion"
105104
implementation "androidx.constraintlayout:constraintlayout:$rootProject.constraintLayoutVersion"
106105
implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:$rootProject.lifecycleViewmodelAndroidXVersion"
Original file line numberDiff line numberDiff line change
@@ -1,63 +1,53 @@
11
# Add project specific ProGuard rules here.
2-
# You can control the set of applied configuration files using the
3-
# proguardFiles setting in build.gradle.
2+
# By default, the flags in this file are appended to flags specified
3+
4+
# You can edit the include path and order by changing the proguardFiles
5+
# directive in build.gradle.
46
#
57
# For more details, see
6-
# http://developer.android.com/guide/developing/tools/proguard.html
8+
# http://developer.android.com/guide/developing/tools/proguard.html
79

810
# If your project uses WebView with JS, uncomment the following
911
# and specify the fully qualified class name to the JavaScript interface
1012
# class:
1113
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
1214
# public *;
1315
#}
16+
#-dontusemixedcaseclassnames
17+
#-dontskipnonpubliclibraryclasses
18+
#-verbose
19+
#
1420

15-
# Uncomment this to preserve the line number information for
16-
# debugging stack traces.
17-
#-keepattributes SourceFile,LineNumberTable
18-
19-
# If you keep the line number information, uncomment this to
20-
# hide the original source file name.
21-
#-renamesourcefileattribute SourceFile
21+
##---------------Begin: proguard configuration for Gson ----------
22+
# Gson uses generic type information stored in a class file when working with fields. Proguard
23+
# removes such information by default, so configure it to keep all of it.
24+
-keepattributes EnclosingMethod
25+
-keepattributes InnerClasses
2226
-keepattributes Signature
27+
-keepattributes Exceptions
2328

24-
# For using GSON @Expose annotation
29+
# for using GSON @Expose annotation
2530
-keepattributes *Annotation*
2631

27-
# Gson specific classes
28-
-keep class sun.misc.Unsafe { *; }
29-
#-keep class com.google.gson.stream.** { *; }
30-
31-
# Application classes that will be serialized/deserialized over Gson
32-
-keep class com.quickblox.core.account.model.** { *; }
33-
34-
-keep class com.quickblox.auth.parsers.** { *; }
35-
-keep class com.quickblox.auth.model.** { *; }
36-
-keep class com.quickblox.core.parser.** { *; }
37-
-keep class com.quickblox.core.model.** { *; }
38-
-keep class com.quickblox.core.server.** { *; }
39-
-keep class com.quickblox.core.rest.** { *; }
40-
-keep class com.quickblox.core.error.** { *; }
41-
-keep class com.quickblox.core.Query { *; }
42-
43-
-keep class com.quickblox.content.model.** { *; }
44-
45-
-keep class com.quickblox.users.parsers.** { *; }
46-
-keep class com.quickblox.users.model.** { *; }
32+
# quickblox sdk
33+
-keep class com.quickblox.** { *; }
4734

48-
-keep class com.quickblox.messages.parsers.** { *; }
49-
-keep class com.quickblox.messages.QBPushNotifications { *; }
50-
-keep class com.quickblox.messages.model.** { *; }
51-
-keep class com.quickblox.messages.services.** { *; }
52-
53-
-keep class com.quickblox.chat.parser.** { *; }
54-
-keep class com.quickblox.chat.model.** { *; }
55-
56-
-keep class org.jivesoftware.** { *; }
35+
# smack xmpp library
5736
-keep class org.jxmpp.** { *; }
37+
-keep class org.jivesoftware.** { *; }
38+
-dontwarn org.jivesoftware.**
39+
40+
# webrtc
5841
-keep class org.webrtc.** { *; }
59-
-keep class com.quickblox.conference.** { *; }
6042

43+
# glide
6144
-keep class com.bumptech.** { *; }
6245

63-
-dontwarn org.jivesoftware.smackx.**
46+
# google gms
47+
-keep class com.google.android.gms.** { *; }
48+
49+
#json
50+
-keep class org.json.** { *; }
51+
-keep class com.google.gson.reflect.TypeToken
52+
-keep class * extends com.google.gson.reflect.TypeToken
53+
-keep public class * implements java.lang.reflect.Type

sample-conference-kotlin/app/src/main/AndroidManifest.xml

+23-7
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,26 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3-
package="com.quickblox.sample.conference.kotlin">
2+
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
43

54
<uses-permission android:name="android.permission.INTERNET" />
65
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
76
<uses-permission android:name="android.permission.CAMERA" />
8-
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
7+
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
8+
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"
9+
android:maxSdkVersion="32" />
910
<uses-permission android:name="android.permission.RECORD_AUDIO" />
1011
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
1112
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
1213

14+
<uses-permission android:name="android.permission.READ_MEDIA_IMAGES" />
15+
<uses-permission android:name="android.permission.READ_MEDIA_VIDEO" />
16+
17+
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_CAMERA" />
18+
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_MICROPHONE" />
19+
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_MEDIA_PROJECTION" />
20+
21+
<uses-feature android:name="android.hardware.camera" />
22+
<uses-feature android:name="android.hardware.camera.autofocus" />
23+
1324
<application
1425
android:name=".App"
1526
android:allowBackup="false"
@@ -21,6 +32,7 @@
2132

2233
<activity
2334
android:name=".presentation.screens.splash.SplashActivity"
35+
android:exported="true"
2436
android:screenOrientation="portrait">
2537
<intent-filter>
2638
<action android:name="android.intent.action.MAIN" />
@@ -99,16 +111,20 @@
99111

100112
<service
101113
android:name=".data.service.CallService"
102-
android:foregroundServiceType="camera|microphone|mediaProjection"
103-
android:launchMode="singleTask" />
114+
android:exported="false"
115+
android:foregroundServiceType="camera|microphone|mediaProjection" />
104116

105-
<service android:name=".data.push.FcmPushListenerServiceImpl">
117+
<service
118+
android:name=".data.push.FcmPushListenerServiceImpl"
119+
android:exported="false">
106120
<intent-filter>
107121
<action android:name="com.google.firebase.MESSAGING_EVENT" />
108122
</intent-filter>
109123
</service>
110124

111-
<service android:name="com.quickblox.messages.services.fcm.QBFcmPushInstanceIDService">
125+
<service
126+
android:name="com.quickblox.messages.services.fcm.QBFcmPushInstanceIDService"
127+
android:exported="false">
112128
<intent-filter>
113129
<action android:name="com.google.firebase.INSTANCE_ID_EVENT" />
114130
</intent-filter>

sample-conference-kotlin/app/src/main/java/com/quickblox/sample/conference/kotlin/App.kt

+3-3
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,15 @@ import com.quickblox.conference.ConferenceConfig
77
import com.quickblox.sample.conference.kotlin.domain.user.USER_DEFAULT_PASSWORD
88
import dagger.hilt.android.HiltAndroidApp
99

10-
//Chat settings range
10+
// chat settings range
1111
private const val MAX_PORT_VALUE = 65535
1212
private const val MIN_PORT_VALUE = 1000
1313
private const val MIN_SOCKET_TIMEOUT = 300
1414
private const val MAX_SOCKET_TIMEOUT = 60000
1515
private const val CHAT_PORT = 5223
1616
private const val SOCKET_TIMEOUT = 300
1717

18-
//App credentials
18+
// app credentials
1919
private const val APPLICATION_ID = ""
2020
private const val AUTH_KEY = ""
2121
private const val AUTH_SECRET = ""
@@ -61,7 +61,7 @@ class App : Application() {
6161
QBSettings.getInstance().init(applicationContext, APPLICATION_ID, AUTH_KEY, AUTH_SECRET)
6262
QBSettings.getInstance().accountKey = ACCOUNT_KEY
6363

64-
// Uncomment and put your Api and Chat servers endpoints if you want to point the sample
64+
// uncomment and put your Api and Chat servers endpoints if you want to point the sample
6565
// against your own server.
6666

6767
// QBSettings.getInstance().setEndpoints("https://your.api.endpoint.com", "your.chat.endpoint.com", ServiceZone.PRODUCTION);

sample-conference-kotlin/app/src/main/java/com/quickblox/sample/conference/kotlin/data/call/CallRepositoryImpl.kt

+3-9
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
package com.quickblox.sample.conference.kotlin.data.call
22

33
import android.content.Context
4-
import android.os.Handler
5-
import android.os.Looper
64
import com.quickblox.conference.ConferenceClient
75
import com.quickblox.conference.ConferenceSession
86
import com.quickblox.conference.WsException
@@ -18,17 +16,13 @@ import com.quickblox.videochat.webrtc.QBRTCTypes
1816
class CallRepositoryImpl(private val context: Context) : CallRepository {
1917
override fun createSession(userId: Int, callback: DataCallBack<ConferenceSession, Exception>) {
2018
val conferenceType = QBRTCTypes.QBConferenceType.QB_CONFERENCE_TYPE_VIDEO
21-
ConferenceClient.getInstance(context).createSession(userId, conferenceType, object : ConferenceEntityCallback<ConferenceSession> {
19+
ConferenceClient.getInstance(context).createSession(userId, conferenceType, object : ConferenceEntityCallback<ConferenceSession> {
2220
override fun onSuccess(session: ConferenceSession) {
23-
Handler(Looper.getMainLooper()).post {
24-
callback.onSuccess(session, null)
25-
}
21+
callback.onSuccess(session, null)
2622
}
2723

2824
override fun onError(exception: WsException) {
29-
Handler(Looper.getMainLooper()).post {
30-
callback.onError(exception)
31-
}
25+
callback.onError(exception)
3226
}
3327
})
3428
}

sample-conference-kotlin/app/src/main/java/com/quickblox/sample/conference/kotlin/data/device/NotificationRepositoryImpl.kt

+5-1
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,10 @@ class NotificationRepositoryImpl(private val context: Context, private val resou
6666
val intent = Intent(context, SplashActivity::class.java)
6767
intent.putExtra(EXTRA_FCM_MESSAGE, message)
6868
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP)
69-
return PendingIntent.getActivity(context, 0, intent, PendingIntent.FLAG_UPDATE_CURRENT)
69+
var intentFlag = 0
70+
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
71+
intentFlag = PendingIntent.FLAG_IMMUTABLE
72+
}
73+
return PendingIntent.getActivity(context, 0, intent, intentFlag)
7074
}
7175
}

0 commit comments

Comments
 (0)