diff --git a/AdvancedExample/app/build.gradle b/AdvancedExample/app/build.gradle index e0dcc70f..24374351 100644 --- a/AdvancedExample/app/build.gradle +++ b/AdvancedExample/app/build.gradle @@ -38,7 +38,7 @@ dependencies { implementation 'androidx.appcompat:appcompat:1.6.1' implementation 'androidx.recyclerview:recyclerview:1.3.2' implementation 'androidx.legacy:legacy-support-v4:1.0.0' - implementation 'androidx.mediarouter:mediarouter:1.6.0' + implementation 'androidx.mediarouter:mediarouter:1.7.0' implementation 'com.android.support.constraint:constraint-layout:2.0.4' - implementation 'com.google.ads.interactivemedia.v3:interactivemedia:3.31.0' + implementation 'com.google.ads.interactivemedia.v3:interactivemedia:3.33.0' } diff --git a/AdvancedExample/build.gradle b/AdvancedExample/build.gradle index f0e99bbd..834093d7 100644 --- a/AdvancedExample/build.gradle +++ b/AdvancedExample/build.gradle @@ -6,6 +6,6 @@ buildscript { mavenCentral() } dependencies { - classpath 'com.android.tools.build:gradle:8.1.2' + classpath 'com.android.tools.build:gradle:8.2.2' } } diff --git a/ExoPlayerExample/app/build.gradle b/ExoPlayerExample/app/build.gradle index a02eb358..619031da 100644 --- a/ExoPlayerExample/app/build.gradle +++ b/ExoPlayerExample/app/build.gradle @@ -32,7 +32,7 @@ repositories { } dependencies { - def media3_version = "1.1.1" + def media3_version = "1.3.0" implementation "androidx.media3:media3-ui:$media3_version" implementation "androidx.media3:media3-exoplayer:$media3_version" diff --git a/ExoPlayerExample/app/src/main/java/com/google/ads/interactivemedia/v3/samples/exoplayerexample/MyActivity.java b/ExoPlayerExample/app/src/main/java/com/google/ads/interactivemedia/v3/samples/exoplayerexample/MyActivity.java index 092fc268..34501d69 100644 --- a/ExoPlayerExample/app/src/main/java/com/google/ads/interactivemedia/v3/samples/exoplayerexample/MyActivity.java +++ b/ExoPlayerExample/app/src/main/java/com/google/ads/interactivemedia/v3/samples/exoplayerexample/MyActivity.java @@ -7,7 +7,6 @@ import android.util.Log; import android.widget.TextView; import androidx.media3.common.MediaItem; -import androidx.media3.common.util.Util; import androidx.media3.datasource.DataSource; import androidx.media3.datasource.DefaultDataSource; import androidx.media3.exoplayer.ExoPlayer; @@ -35,6 +34,7 @@ public class MyActivity extends Activity { private ImaAdsLoader adsLoader; @Override + @androidx.media3.common.util.UnstableApi protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_my); @@ -70,9 +70,10 @@ public AdEvent.AdEventListener buildAdEventListener() { } @Override + @androidx.media3.common.util.UnstableApi public void onStart() { super.onStart(); - if (Util.SDK_INT > 23) { + if (VERSION.SDK_INT > 23) { initializePlayer(); if (playerView != null) { playerView.onResume(); @@ -81,9 +82,10 @@ public void onStart() { } @Override + @androidx.media3.common.util.UnstableApi public void onResume() { super.onResume(); - if (Util.SDK_INT <= 23 || player == null) { + if (VERSION.SDK_INT <= 23 || player == null) { initializePlayer(); if (playerView != null) { playerView.onResume(); @@ -94,7 +96,7 @@ public void onResume() { @Override public void onPause() { super.onPause(); - if (Util.SDK_INT <= 23) { + if (VERSION.SDK_INT <= 23) { if (playerView != null) { playerView.onPause(); } @@ -105,7 +107,7 @@ public void onPause() { @Override public void onStop() { super.onStop(); - if (Util.SDK_INT > 23) { + if (VERSION.SDK_INT > 23) { if (playerView != null) { playerView.onPause(); } @@ -127,6 +129,7 @@ private void releasePlayer() { player = null; } + @androidx.media3.common.util.UnstableApi private void initializePlayer() { // Set up the factory for media sources, passing the ads loader and ad view providers. DataSource.Factory dataSourceFactory = new DefaultDataSource.Factory(this); diff --git a/ExoPlayerExample/build.gradle b/ExoPlayerExample/build.gradle index e41eeaf4..911c594a 100644 --- a/ExoPlayerExample/build.gradle +++ b/ExoPlayerExample/build.gradle @@ -6,7 +6,7 @@ buildscript { mavenCentral() } dependencies { - classpath 'com.android.tools.build:gradle:8.1.2' + classpath 'com.android.tools.build:gradle:8.2.2' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files diff --git a/audioplayerexample/app/build.gradle b/audioplayerexample/app/build.gradle index fbc176db..a9aab471 100644 --- a/audioplayerexample/app/build.gradle +++ b/audioplayerexample/app/build.gradle @@ -22,7 +22,7 @@ android { } defaultConfig { applicationId "com.google.ads.interactivemedia.v3.samples.audioplayerexample" - minSdkVersion 21 + minSdkVersion 29 targetSdkVersion 34 versionCode 1 versionName "1.0" @@ -43,12 +43,12 @@ repositories { dependencies { implementation(platform("org.jetbrains.kotlin:kotlin-bom:1.8.0")) implementation 'androidx.appcompat:appcompat:1.6.1' - implementation 'androidx.media:media:1.6.0' - def media3_version = "1.1.1" + implementation 'androidx.media:media:1.7.0' + def media3_version = "1.3.0" implementation "androidx.media3:media3-ui:$media3_version" implementation "androidx.media3:media3-exoplayer:$media3_version" implementation "androidx.media3:media3-session:$media3_version" implementation 'com.google.guava:guava:28.1-android' - implementation 'com.google.ads.interactivemedia.v3:interactivemedia:3.31.0' + implementation 'com.google.ads.interactivemedia.v3:interactivemedia:3.33.0' } diff --git a/audioplayerexample/app/src/main/AndroidManifest.xml b/audioplayerexample/app/src/main/AndroidManifest.xml index 8af5ada7..9c9f80e7 100644 --- a/audioplayerexample/app/src/main/AndroidManifest.xml +++ b/audioplayerexample/app/src/main/AndroidManifest.xml @@ -20,6 +20,7 @@ + @@ -38,6 +39,7 @@ + android:exported="false" + android:foregroundServiceType="mediaPlayback"/> diff --git a/audioplayerexample/app/src/main/java/com/google/ads/interactivemedia/v3/samples/audioplayerexample/AudioPlayerService.java b/audioplayerexample/app/src/main/java/com/google/ads/interactivemedia/v3/samples/audioplayerexample/AudioPlayerService.java index 6ef71892..e04009b8 100644 --- a/audioplayerexample/app/src/main/java/com/google/ads/interactivemedia/v3/samples/audioplayerexample/AudioPlayerService.java +++ b/audioplayerexample/app/src/main/java/com/google/ads/interactivemedia/v3/samples/audioplayerexample/AudioPlayerService.java @@ -8,6 +8,7 @@ import android.app.Service; import android.content.Context; import android.content.Intent; +import android.content.pm.ServiceInfo; import android.graphics.Bitmap; import android.os.Binder; import android.os.IBinder; @@ -127,7 +128,10 @@ public void onNotificationStarted( int notificationId, Notification notification, boolean ongoing) { // This must be called within 5 seconds of the notification being displayed and // before the main app has been killed. - startForeground(notificationId, notification); + startForeground( + notificationId, + notification, + ServiceInfo.FOREGROUND_SERVICE_TYPE_MEDIA_PLAYBACK); } @Override diff --git a/audioplayerexample/build.gradle b/audioplayerexample/build.gradle index f0e99bbd..834093d7 100644 --- a/audioplayerexample/build.gradle +++ b/audioplayerexample/build.gradle @@ -6,6 +6,6 @@ buildscript { mavenCentral() } dependencies { - classpath 'com.android.tools.build:gradle:8.1.2' + classpath 'com.android.tools.build:gradle:8.2.2' } } diff --git a/basicexample/app/build.gradle b/basicexample/app/build.gradle index 01976283..574febff 100644 --- a/basicexample/app/build.gradle +++ b/basicexample/app/build.gradle @@ -34,7 +34,7 @@ repositories { dependencies { implementation(platform("org.jetbrains.kotlin:kotlin-bom:1.8.0")) implementation 'androidx.appcompat:appcompat:1.6.1' - implementation 'androidx.browser:browser:1.6.0' - implementation 'androidx.media:media:1.6.0' - implementation 'com.google.ads.interactivemedia.v3:interactivemedia:3.31.0' + implementation 'androidx.browser:browser:1.8.0' + implementation 'androidx.media:media:1.7.0' + implementation 'com.google.ads.interactivemedia.v3:interactivemedia:3.33.0' } diff --git a/basicexample/build.gradle b/basicexample/build.gradle index e41eeaf4..911c594a 100644 --- a/basicexample/build.gradle +++ b/basicexample/build.gradle @@ -6,7 +6,7 @@ buildscript { mavenCentral() } dependencies { - classpath 'com.android.tools.build:gradle:8.1.2' + classpath 'com.android.tools.build:gradle:8.2.2' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files diff --git a/umpexample/app/build.gradle b/umpexample/app/build.gradle index 860659c5..105386de 100644 --- a/umpexample/app/build.gradle +++ b/umpexample/app/build.gradle @@ -34,8 +34,8 @@ repositories { dependencies { implementation(platform("org.jetbrains.kotlin:kotlin-bom:1.8.0")) implementation 'androidx.appcompat:appcompat:1.6.1' - implementation 'androidx.browser:browser:1.6.0' - implementation 'androidx.media:media:1.6.0' - implementation 'com.google.ads.interactivemedia.v3:interactivemedia:3.31.0' - implementation 'com.google.android.ump:user-messaging-platform:2.1.0' + implementation 'androidx.browser:browser:1.8.0' + implementation 'androidx.media:media:1.7.0' + implementation 'com.google.ads.interactivemedia.v3:interactivemedia:3.33.0' + implementation 'com.google.android.ump:user-messaging-platform:2.2.0' } diff --git a/umpexample/build.gradle b/umpexample/build.gradle index e41eeaf4..911c594a 100644 --- a/umpexample/build.gradle +++ b/umpexample/build.gradle @@ -6,7 +6,7 @@ buildscript { mavenCentral() } dependencies { - classpath 'com.android.tools.build:gradle:8.1.2' + classpath 'com.android.tools.build:gradle:8.2.2' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files