Skip to content

Dev/4.5.2 #450

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 25 commits into from
Apr 23, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
5ac4b05
[Android] update gradle to 8.4
alienzh Mar 11, 2025
5da4388
[Android] Fxs The worker thread calls writeLog and sendCustomReportMe…
alienzh Mar 11, 2025
585ced9
[Android] update ci.
alienzh Mar 11, 2025
b06df45
[Android] update ci.
alienzh Mar 11, 2025
a739c07
[Android] update ci.
alienzh Mar 11, 2025
f5a106f
[Android] update startForegroundService.
alienzh Mar 25, 2025
10e1760
[Android] update ci.
alienzh Mar 25, 2025
bf2ec32
[Android] update ci.
alienzh Mar 25, 2025
6655e03
[Android] update audio notification.
alienzh Mar 26, 2025
8e6908f
update 4.5.2
alienzh Mar 26, 2025
710cb7f
Merge branch 'dev/android_update_compilesdk' into dev/4.5.2
alienzh Mar 26, 2025
ba20dab
[Android] update .h file
alienzh Mar 26, 2025
2d03af4
Fix screen sharing issue
Mar 27, 2025
22b849b
fix local composite issues
Mar 27, 2025
0b6475b
[Android] bugfisx
alienzh Mar 27, 2025
794cc42
Modify the copy.
Mar 27, 2025
e3e166a
Add certificate error prompt for facial capture feature.
Mar 27, 2025
932e07e
Fix media encryption bug
Mar 27, 2025
74bef6e
Merge branch 'dev/4.5.2' of https://github.com/AgoraIO/API-Examples i…
Mar 27, 2025
6d424f3
[Android] fix compose Audio Route change
alienzh Mar 27, 2025
0e603ae
Fix the bug that encrypted videos do not interoperate between iOS and…
Mar 27, 2025
1052d2b
Merge branch 'dev/4.5.2' of https://github.com/AgoraIO/API-Examples i…
Mar 27, 2025
5d97099
[Android] update beauty
alienzh Mar 27, 2025
b88e9f4
[windows]fix rte player url
HugoChaan Apr 11, 2025
deef6ba
update to 4.5.2.
Apr 22, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions .github/ci/build/build_android.sh
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ echo pwd: `pwd`
echo sdk_url: $sdk_url
unzip_name=Agora_Native_SDK_for_Android_FULL_DEFAULT
zip_name=Agora_Native_SDK_for_Android_FULL_DEFAULT.zip
if [ -z "$sdk_url" ]; then
if [ -z "$sdk_url" ] || [ "$sdk_url" = "none" ]; then
echo "sdk_url is empty"
echo unzip_name: $unzip_name
echo zip_name: $zip_name
Expand Down Expand Up @@ -85,12 +85,11 @@ if [ $compile_project = true ]; then
export ANDROID_HOME=/usr/lib/android_sdk
echo ANDROID_HOME: $ANDROID_HOME
cd ./$unzip_name/rtc/samples/API-Example || exit 1
if [ -z "$sdk_url" ]; then
if [ -z "$sdk_url" ] || [ "$sdk_url" = "none" ]; then
./cloud_build.sh false || exit 1
else
./cloud_build.sh true || exit 1
fi

fi


35 changes: 19 additions & 16 deletions Android/APIExample-Audio/app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
apply plugin: 'com.android.application'

apply plugin: 'org.jetbrains.kotlin.android'

def sdkVersionFile = file("../gradle.properties")
def properties = new Properties()
Expand All @@ -11,13 +11,13 @@ println("${rootProject.project.name} agoraSdkVersion: ${agoraSdkVersion}")
def localSdkPath= "${rootProject.projectDir.absolutePath}/../../sdk"

android {
compileSdkVersion 32
buildToolsVersion "32.0.0"
namespace "io.agora.api.example"
compileSdk 35

defaultConfig {
applicationId "io.agora.api.example.audio"
minSdkVersion 21
targetSdkVersion 32
minSdkVersion 24
targetSdkVersion 35
versionCode 1
versionName "1.0"

Expand Down Expand Up @@ -50,11 +50,12 @@ android {
}

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
}
kotlinOptions {
jvmTarget = "17"
}



sourceSets {
main {
Expand All @@ -67,6 +68,7 @@ android {

buildFeatures{
viewBinding true
buildConfig true
}

applicationVariants.all {
Expand Down Expand Up @@ -96,18 +98,19 @@ dependencies {
// implementation "io.agora.rtc:drm:${agoraSdkVersion}"
}

implementation 'androidx.appcompat:appcompat:1.5.0'
implementation 'androidx.appcompat:appcompat:1.7.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
implementation "org.jetbrains.kotlin:kotlin-stdlib:1.8.22"

// Java language implementation
implementation "androidx.navigation:navigation-fragment:2.5.0"
implementation "androidx.navigation:navigation-ui:2.5.0"
implementation "androidx.navigation:navigation-fragment:2.7.0"
implementation "androidx.navigation:navigation-ui:2.7.0"

implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'androidx.recyclerview:recyclerview:1.2.1'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
implementation 'androidx.recyclerview:recyclerview:1.3.2'
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.2.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.6.1'

implementation 'io.github.luizgrp.sectionedrecyclerviewadapter:sectionedrecyclerviewadapter:1.2.0'
implementation 'de.javagl:obj:0.2.1'
Expand Down
9 changes: 8 additions & 1 deletion Android/APIExample-Audio/app/proguard-rules.pro
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,11 @@

-keep class io.agora.**{*;}
-dontwarn javax.**
-dontwarn com.google.devtools.build.android.**
-dontwarn com.google.devtools.build.android.**

# OkHttp
-dontwarn org.bouncycastle.jsse.**
-dontwarn org.conscrypt.**
-dontwarn org.openjsse.**
-dontwarn okhttp3.internal.platform.**
-dontwarn org.codehaus.mojo.animal_sniffer.**
8 changes: 3 additions & 5 deletions Android/APIExample-Audio/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,20 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="io.agora.api.example">
xmlns:tools="http://schemas.android.com/tools">

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.BLUETOOTH"/>
<uses-permission android:name="android.permission.BLUETOOTH_CONNECT"/>
<uses-permission android:name="android.permission.READ_PHONE_STATE" />

<permission-group android:name="io.agora.api.example.audio.andpermission"/>

<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
<!-- <uses-permission android:name="android.permission.POST_NOTIFICATIONS" />-->
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_MICROPHONE" />

<application
android:name=".MainApplication"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
import android.content.pm.ServiceInfo;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Color;
import android.graphics.drawable.Icon;
import android.os.Build;
import android.os.Bundle;
import android.os.Handler;
Expand Down Expand Up @@ -322,11 +324,14 @@ public void onPause() {

private void startRecordingService() {
if (joined) {
Intent intent = new Intent(requireContext(), LocalRecordingService.class);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
requireContext().startForegroundService(intent);
} else {
requireContext().startService(intent);
Context context = getContext();
if (context != null) {
Intent intent = new Intent(context, LocalRecordingService.class);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
context.startForegroundService(intent);
} else {
context.startService(intent);
}
}
}
}
Expand All @@ -347,8 +352,11 @@ public void onResume() {
}

private void stopRecordingService() {
Intent intent = new Intent(requireContext(), LocalRecordingService.class);
requireContext().stopService(intent);
Context context = getContext();
if (context != null) {
Intent intent = new Intent(context, LocalRecordingService.class);
requireContext().stopService(intent);
}
}

@Override
Expand Down Expand Up @@ -665,8 +673,8 @@ public void onAudioRouteChanged(int routing) {
* And the android:foregroundServiceType should be microphone.
*/
public static class LocalRecordingService extends Service {
private static final int NOTIFICATION_ID = 1234567800;
private static final String CHANNEL_ID = "audio_channel_id";
private static final int NOTIFICATION_ID = 1234567900;
private static final String CHANNEL_ID = "api_audio_channel_id";


@Override
Expand Down Expand Up @@ -707,32 +715,38 @@ private Notification getDefaultNotification() {
icon = R.mipmap.ic_launcher;
}

if (Build.VERSION.SDK_INT >= 26) {
Intent intent = new Intent(this, MainActivity.class);
intent.setAction("io.agora.api.example.ACTION_NOTIFICATION_CLICK");
intent.addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP | Intent.FLAG_ACTIVITY_CLEAR_TOP);
int requestCode = (int) System.currentTimeMillis();

PendingIntent activityPendingIntent = PendingIntent.getActivity(
this, requestCode, intent, PendingIntent.FLAG_UPDATE_CURRENT | PendingIntent.FLAG_IMMUTABLE
);

Notification.Builder builder;
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
NotificationChannel mChannel = new NotificationChannel(CHANNEL_ID, name, NotificationManager.IMPORTANCE_DEFAULT);
NotificationManager mNotificationManager = (NotificationManager) this.getSystemService(Context.NOTIFICATION_SERVICE);
mNotificationManager.createNotificationChannel(mChannel);
}

PendingIntent activityPendingIntent;
Intent intent = new Intent();
intent.setClass(this, MainActivity.class);
if (Build.VERSION.SDK_INT >= 23) {
activityPendingIntent = PendingIntent.getActivity(this, 0, intent, PendingIntent.FLAG_ONE_SHOT | PendingIntent.FLAG_IMMUTABLE);
builder = new Notification.Builder(this, CHANNEL_ID);
} else {
activityPendingIntent = PendingIntent.getActivity(this, 0, intent, PendingIntent.FLAG_ONE_SHOT);
builder = new Notification.Builder(this);
}

Notification.Builder builder = new Notification.Builder(this)
.addAction(icon, "Back to app", activityPendingIntent)
.setContentText("Agora Recording ...")
builder.setContentTitle("Agora Recording ...")
.setContentText("Tap here to return to the app.")
.setContentIntent(activityPendingIntent)
.setAutoCancel(true)
.setOngoing(true)
.setPriority(Notification.PRIORITY_HIGH)
.setSmallIcon(icon)
.setTicker(name)
.setVisibility(Notification.VISIBILITY_PUBLIC)
.setWhen(System.currentTimeMillis());
if (Build.VERSION.SDK_INT >= 26) {
builder.setChannelId(CHANNEL_ID);
}

Icon iconObj = Icon.createWithResource(this, icon);
Notification.Action action = new Notification.Action.Builder(iconObj, "Return to the app", activityPendingIntent).build();
builder.addAction(action);

return builder.build();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
import java.util.regex.Pattern;

import dalvik.system.DexFile;
import io.agora.api.example.BuildConfig;

public class ClassUtils
{
Expand Down Expand Up @@ -160,7 +159,7 @@ public static List<String> getSourcePaths(Context context) throws PackageManager
}
}

if (BuildConfig.DEBUG)
if (io.agora.api.example.BuildConfig.DEBUG)
{ // Search instant run support only debuggable
sourcePaths.addAll(tryLoadInstantRunDexFile(applicationInfo));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ public class PermissonUtils {

public static String[] getCommonPermission() {
List<String> permissionList = new ArrayList<>();
permissionList.add(Manifest.permission.READ_EXTERNAL_STORAGE);
permissionList.add(Manifest.permission.WRITE_EXTERNAL_STORAGE);
permissionList.add(Manifest.permission.RECORD_AUDIO);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) {
permissionList.add(Manifest.permission.READ_PHONE_STATE);
Expand Down
8 changes: 2 additions & 6 deletions Android/APIExample-Audio/build.gradle
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.
plugins {
id 'com.android.application' version '7.2.0' apply false
id 'com.android.library' version '7.2.0' apply false
}

task clean(type: Delete) {
delete rootProject.buildDir
id 'com.android.application' version '8.5.0' apply false
id 'org.jetbrains.kotlin.android' version '1.9.24' apply false
}
13 changes: 13 additions & 0 deletions Android/APIExample-Audio/cloud_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,19 @@
# cache gradle to /tmp/.gradle
ls ~/.gradle || (mkdir -p /tmp/.gradle && ln -s /tmp/.gradle ~/.gradle && touch ~/.gradle/ln_$(date "+%y%m%d%H") && ls ~/.gradle)

## use open jdk 17
SYSTEM=$(uname -s)
if [ "$SYSTEM" = "Linux" ];then
if [ ! -d "/tmp/jdk-17.0.2" ];then
curl -O https://download.java.net/java/GA/jdk17.0.2/dfd4a8d0985749f896bed50d7138ee7f/8/GPL/openjdk-17.0.2_linux-x64_bin.tar.gz
tar zxf openjdk-17.0.2_linux-x64_bin.tar.gz
mv jdk-17.0.2 /tmp/
fi
export JAVA_HOME=/tmp/jdk-17.0.2
export PATH=$JAVA_HOME/bin:$PATH
java --version
fi

#change android maven to china repos
sed -ie "s#google()#maven { url \"https\://maven.aliyun.com/repository/public\" }\n google()#g" settings.gradle
sed -ie "s#https://services.gradle.org/distributions#https://mirrors.cloud.tencent.com/gradle#g" gradle/wrapper/gradle-wrapper.properties
Expand Down
4 changes: 3 additions & 1 deletion Android/APIExample-Audio/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,10 @@ org.gradle.jvmargs=-Xmx1536m
android.useAndroidX=true
# Automatically convert third-party libraries to use AndroidX
android.enableJetifier=true
android.nonTransitiveRClass=false
android.nonFinalResIds=false

# read enable simple filter section on README first before set this flag to TRUE
simpleFilter = false

rtc_sdk_version = 4.5.1
rtc_sdk_version = 4.5.2
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https://mirrors.cloud.tencent.com/gradle/gradle-7.3.3-bin.zip
distributionUrl=https://mirrors.cloud.tencent.com/gradle/gradle-8.7-bin.zip
1 change: 1 addition & 0 deletions Android/APIExample-Compose/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@
.externalNativeBuild
.cxx
local.properties
/.idea
19 changes: 7 additions & 12 deletions Android/APIExample-Compose/app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ val localSdkPath = "${rootProject.projectDir.absolutePath}/../../sdk"

android {
namespace = "io.agora.api.example.compose"
compileSdk = 34
compileSdk = 35

defaultConfig {
applicationId = "io.agora.api.example.compose"
minSdk = 24
targetSdk = 34
targetSdk = 35
versionCode = 1
versionName = "1.0"

Expand Down Expand Up @@ -53,6 +53,7 @@ android {

buildFeatures {
buildConfig = true
compose = true
}
buildTypes {
debug {
Expand All @@ -69,17 +70,14 @@ android {
}
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
kotlinOptions {
jvmTarget = "1.8"
}
buildFeatures {
compose = true
jvmTarget = "17"
}
composeOptions {
kotlinCompilerExtensionVersion = "1.5.1"
kotlinCompilerExtensionVersion = "1.5.14"
}
packaging {
resources {
Expand Down Expand Up @@ -136,8 +134,5 @@ dependencies {
} else {
implementation("io.agora.rtc:full-sdk:${agoraSdkVersion}")
implementation("io.agora.rtc:full-screen-sharing:${agoraSdkVersion}")
// implementation(libs.agora.full.sdk)
// implementation(libs.agora.full.screen.sharing)
}

}
Loading
Loading