Skip to content

Commit d758fd4

Browse files
committed
[Android][Audio]update gradle config and fix bugs.
1 parent 4ba6295 commit d758fd4

5 files changed

Lines changed: 31 additions & 37 deletions

File tree

Android/APIExample-Audio/app/build.gradle

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,15 @@
11
apply plugin: 'com.android.application'
2-
apply plugin: "androidx.navigation.safeargs"
32

43
def localSdkPath= "${rootProject.projectDir.absolutePath}/../../sdk"
54

65
android {
7-
compileSdkVersion 31
8-
buildToolsVersion "31.0.0"
6+
compileSdkVersion 32
7+
buildToolsVersion "32.0.0"
98

109
defaultConfig {
1110
applicationId "io.agora.api.example"
1211
minSdkVersion 19
13-
targetSdkVersion 29
12+
targetSdkVersion 32
1413
versionCode 1
1514
versionName "1.0"
1615

@@ -38,7 +37,6 @@ android {
3837
}
3938
}
4039

41-
ndkVersion '21.4.7075529'
4240
}
4341

4442
dependencies {
@@ -56,15 +54,15 @@ dependencies {
5654
implementation "io.agora.rtc:audio-beauty:${agora_sdk_version}"
5755
}
5856

59-
implementation 'androidx.appcompat:appcompat:1.1.0'
60-
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
57+
implementation 'androidx.appcompat:appcompat:1.5.0'
58+
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
6159

6260
// Java language implementation
63-
implementation "androidx.navigation:navigation-fragment:2.3.0-alpha06"
64-
implementation "androidx.navigation:navigation-ui:2.3.0-alpha06"
61+
implementation "androidx.navigation:navigation-fragment:2.5.0"
62+
implementation "androidx.navigation:navigation-ui:2.5.0"
6563

6664
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
67-
implementation 'androidx.recyclerview:recyclerview:1.1.0'
65+
implementation 'androidx.recyclerview:recyclerview:1.2.1'
6866
testImplementation 'junit:junit:4.12'
6967
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
7068
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'

Android/APIExample-Audio/app/src/main/java/io/agora/api/example/examples/basic/JoinChannelAudio.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,7 @@ else if (v.getId() == R.id.btn_speaker)
305305
speaker.setActivated(!speaker.isActivated());
306306
speaker.setText(getString(speaker.isActivated() ? R.string.speaker : R.string.earpiece));
307307
/**Turn off / on the speaker and change the audio playback route.*/
308-
engine.setDefaultAudioRoutetoSpeakerphone(speaker.isActivated());
308+
engine.setEnableSpeakerphone(speaker.isActivated());
309309
}
310310
}
311311

@@ -323,6 +323,8 @@ private void joinChannel(String channelId)
323323
int scenario = Constants.AudioScenario.valueOf(audioScenarioInput.getSelectedItem().toString()).ordinal();
324324
engine.setAudioScenario(scenario);
325325

326+
engine.setDefaultAudioRoutetoSpeakerphone(true);
327+
326328
ChannelMediaOptions option = new ChannelMediaOptions();
327329
option.autoSubscribeAudio = true;
328330
option.autoSubscribeVideo = true;

Android/APIExample-Audio/build.gradle

Lines changed: 3 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,7 @@
11
// Top-level build file where you can add configuration options common to all sub-projects/modules.
2-
3-
buildscript {
4-
repositories {
5-
mavenCentral()
6-
google()
7-
jcenter()
8-
9-
}
10-
dependencies {
11-
classpath 'com.android.tools.build:gradle:3.4.2'
12-
13-
// NOTE: Do not place your application dependencies here; they belong
14-
// in the individual module build.gradle files
15-
16-
classpath "androidx.navigation:navigation-safe-args-gradle-plugin:2.3.0-alpha06"
17-
}
18-
}
19-
20-
allprojects {
21-
repositories {
22-
mavenCentral()
23-
google()
24-
jcenter()
25-
maven { url 'https://jitpack.io' }
26-
}
2+
plugins {
3+
id 'com.android.application' version '7.2.0' apply false
4+
id 'com.android.library' version '7.2.0' apply false
275
}
286

297
task clean(type: Delete) {

Android/APIExample-Audio/gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
33
distributionPath=wrapper/dists
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists
6-
distributionUrl=https://services.gradle.org/distributions/gradle-6.5-bin.zip
6+
distributionUrl=https://services.gradle.org/distributions/gradle-7.3.3-bin.zip
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,18 @@
1+
pluginManagement {
2+
repositories {
3+
gradlePluginPortal()
4+
google()
5+
mavenCentral()
6+
}
7+
}
8+
dependencyResolutionManagement {
9+
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
10+
repositories {
11+
mavenCentral()
12+
google()
13+
jcenter()
14+
maven { url 'https://jitpack.io' }
15+
}
16+
}
117
rootProject.name='APIExample-Audio'
218
include ':app'

0 commit comments

Comments
 (0)