diff --git a/AdvancedExample/app/build.gradle b/AdvancedExample/app/build.gradle index 4f01916..49a6668 100644 --- a/AdvancedExample/app/build.gradle +++ b/AdvancedExample/app/build.gradle @@ -40,5 +40,5 @@ dependencies { implementation 'androidx.legacy:legacy-support-v4:1.0.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.35.0' + implementation 'com.google.ads.interactivemedia.v3:interactivemedia:3.35.1' } diff --git a/AdvancedExample/build.gradle b/AdvancedExample/build.gradle index cb3f981..e15036c 100644 --- a/AdvancedExample/build.gradle +++ b/AdvancedExample/build.gradle @@ -6,6 +6,6 @@ buildscript { mavenCentral() } dependencies { - classpath 'com.android.tools.build:gradle:8.3.2' + classpath 'com.android.tools.build:gradle:8.7.0' } } diff --git a/AdvancedExample/gradle.properties b/AdvancedExample/gradle.properties index 5465fec..03e4bb6 100644 --- a/AdvancedExample/gradle.properties +++ b/AdvancedExample/gradle.properties @@ -1,2 +1,6 @@ android.enableJetifier=true -android.useAndroidX=true \ No newline at end of file +android.useAndroidX=true + +# Prevents the GitHub actions build from failing with a +# "java.lang.OutOfMemoryError: Java heap space" error. +org.gradle.jvmargs=-Xmx2048m \ No newline at end of file diff --git a/ExoPlayerExample/build.gradle b/ExoPlayerExample/build.gradle index 72e8e2f..2e50183 100644 --- a/ExoPlayerExample/build.gradle +++ b/ExoPlayerExample/build.gradle @@ -6,7 +6,7 @@ buildscript { mavenCentral() } dependencies { - classpath 'com.android.tools.build:gradle:8.3.2' + classpath 'com.android.tools.build:gradle:8.7.0' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files diff --git a/ExoPlayerExample/gradle.properties b/ExoPlayerExample/gradle.properties index 5465fec..03e4bb6 100644 --- a/ExoPlayerExample/gradle.properties +++ b/ExoPlayerExample/gradle.properties @@ -1,2 +1,6 @@ android.enableJetifier=true -android.useAndroidX=true \ No newline at end of file +android.useAndroidX=true + +# Prevents the GitHub actions build from failing with a +# "java.lang.OutOfMemoryError: Java heap space" error. +org.gradle.jvmargs=-Xmx2048m \ No newline at end of file diff --git a/ExoPlayerExample/gradle/wrapper/gradle-wrapper.properties b/ExoPlayerExample/gradle/wrapper/gradle-wrapper.properties index 5af0f53..348c409 100644 --- a/ExoPlayerExample/gradle/wrapper/gradle-wrapper.properties +++ b/ExoPlayerExample/gradle/wrapper/gradle-wrapper.properties @@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-all.zip diff --git a/audioplayerexample/app/build.gradle b/audioplayerexample/app/build.gradle index 1b2e9e2..7edaadb 100644 --- a/audioplayerexample/app/build.gradle +++ b/audioplayerexample/app/build.gradle @@ -49,6 +49,6 @@ dependencies { implementation "androidx.media3:media3-exoplayer:$media3_version" implementation "androidx.media3:media3-session:$media3_version" - implementation 'com.google.guava:guava:32.1.3-android' - implementation 'com.google.ads.interactivemedia.v3:interactivemedia:3.35.0' + implementation 'com.google.guava:guava:33.0.0-android' + implementation 'com.google.ads.interactivemedia.v3:interactivemedia:3.35.1' } diff --git a/audioplayerexample/build.gradle b/audioplayerexample/build.gradle index cb3f981..e15036c 100644 --- a/audioplayerexample/build.gradle +++ b/audioplayerexample/build.gradle @@ -6,6 +6,6 @@ buildscript { mavenCentral() } dependencies { - classpath 'com.android.tools.build:gradle:8.3.2' + classpath 'com.android.tools.build:gradle:8.7.0' } } diff --git a/audioplayerexample/gradle.properties b/audioplayerexample/gradle.properties index dbb7bf7..03e4bb6 100644 --- a/audioplayerexample/gradle.properties +++ b/audioplayerexample/gradle.properties @@ -1,2 +1,6 @@ android.enableJetifier=true android.useAndroidX=true + +# Prevents the GitHub actions build from failing with a +# "java.lang.OutOfMemoryError: Java heap space" error. +org.gradle.jvmargs=-Xmx2048m \ No newline at end of file diff --git a/basicexample/app/build.gradle b/basicexample/app/build.gradle index 172d41a..15b98c2 100644 --- a/basicexample/app/build.gradle +++ b/basicexample/app/build.gradle @@ -36,5 +36,5 @@ dependencies { implementation 'androidx.appcompat:appcompat:1.7.0' implementation 'androidx.browser:browser:1.8.0' implementation 'androidx.media:media:1.7.0' - implementation 'com.google.ads.interactivemedia.v3:interactivemedia:3.35.0' + implementation 'com.google.ads.interactivemedia.v3:interactivemedia:3.35.1' } diff --git a/basicexample/app/src/main/java/com/google/ads/interactivemedia/v3/samples/videoplayerapp/MyActivity.java b/basicexample/app/src/main/java/com/google/ads/interactivemedia/v3/samples/videoplayerapp/MyActivity.java index 04352db..a678a63 100644 --- a/basicexample/app/src/main/java/com/google/ads/interactivemedia/v3/samples/videoplayerapp/MyActivity.java +++ b/basicexample/app/src/main/java/com/google/ads/interactivemedia/v3/samples/videoplayerapp/MyActivity.java @@ -16,7 +16,6 @@ import com.google.ads.interactivemedia.v3.api.AdEvent; import com.google.ads.interactivemedia.v3.api.AdsLoader; import com.google.ads.interactivemedia.v3.api.AdsManager; -import com.google.ads.interactivemedia.v3.api.AdsManagerLoadedEvent; import com.google.ads.interactivemedia.v3.api.AdsRenderingSettings; import com.google.ads.interactivemedia.v3.api.AdsRequest; import com.google.ads.interactivemedia.v3.api.ImaSdkFactory; @@ -95,88 +94,85 @@ public void onAdError(AdErrorEvent adErrorEvent) { } }); adsLoader.addAdsLoadedListener( - new AdsLoader.AdsLoadedListener() { - @Override - public void onAdsManagerLoaded(AdsManagerLoadedEvent adsManagerLoadedEvent) { - // Ads were successfully loaded, so get the AdsManager instance. AdsManager has - // events for ad playback and errors. - adsManager = adsManagerLoadedEvent.getAdsManager(); - - // Attach event and error event listeners. - adsManager.addAdErrorListener( - new AdErrorEvent.AdErrorListener() { - /** An event raised when there is an error loading or playing ads. */ - @Override - public void onAdError(AdErrorEvent adErrorEvent) { - Log.e(LOGTAG, "Ad Error: " + adErrorEvent.getError().getMessage()); - String universalAdIds = - Arrays.toString(adsManager.getCurrentAd().getUniversalAdIds()); - Log.i( - LOGTAG, - "Discarding the current ad break with universal " - + "ad Ids: " - + universalAdIds); - adsManager.discardAdBreak(); + adsManagerLoadedEvent -> { + // Ads were successfully loaded, so get the AdsManager instance. AdsManager has + // events for ad playback and errors. + adsManager = adsManagerLoadedEvent.getAdsManager(); + + // Attach event and error event listeners. + adsManager.addAdErrorListener( + new AdErrorEvent.AdErrorListener() { + /** An event raised when there is an error loading or playing ads. */ + @Override + public void onAdError(AdErrorEvent adErrorEvent) { + Log.e(LOGTAG, "Ad Error: " + adErrorEvent.getError().getMessage()); + String universalAdIds = + Arrays.toString(adsManager.getCurrentAd().getUniversalAdIds()); + Log.i( + LOGTAG, + "Discarding the current ad break with universal " + + "ad Ids: " + + universalAdIds); + adsManager.discardAdBreak(); + } + }); + adsManager.addAdEventListener( + new AdEvent.AdEventListener() { + /** Responds to AdEvents. */ + @Override + public void onAdEvent(AdEvent adEvent) { + if (adEvent.getType() != AdEvent.AdEventType.AD_PROGRESS) { + Log.i(LOGTAG, "Event: " + adEvent.getType()); } - }); - adsManager.addAdEventListener( - new AdEvent.AdEventListener() { - /** Responds to AdEvents. */ - @Override - public void onAdEvent(AdEvent adEvent) { - if (adEvent.getType() != AdEvent.AdEventType.AD_PROGRESS) { - Log.i(LOGTAG, "Event: " + adEvent.getType()); - } - // These are the suggested event types to handle. For full list of - // all ad event types, see AdEvent.AdEventType documentation. - switch (adEvent.getType()) { - case LOADED: - // AdEventType.LOADED is fired when ads are ready to play. - - // This sample app uses the sample tag - // single_preroll_skippable_ad_tag_url that requires calling - // AdsManager.start() to start ad playback. - // If you use a different ad tag URL that returns a VMAP or - // an ad rules playlist, the adsManager.init() function will - // trigger ad playback automatically and the IMA SDK will - // ignore the adsManager.start(). - // It is safe to always call adsManager.start() in the - // LOADED event. - adsManager.start(); - break; - case CONTENT_PAUSE_REQUESTED: - // AdEventType.CONTENT_PAUSE_REQUESTED is fired when you - // should pause your content and start playing an ad. - pauseContentForAds(); - break; - case CONTENT_RESUME_REQUESTED: - // AdEventType.CONTENT_RESUME_REQUESTED is fired when the ad - // you should play your content. - resumeContent(); - break; - case ALL_ADS_COMPLETED: - // Calling adsManager.destroy() triggers the function - // VideoAdPlayer.release(). - adsManager.destroy(); - adsManager = null; - break; - case CLICKED: - // When the user clicks on the Learn More button, the IMA SDK fires - // this event, pauses the ad, and opens the ad's click-through URL. - // When the user returns to the app, the IMA SDK calls the - // VideoAdPlayer.playAd() function automatically. - break; - default: - break; - } + // These are the suggested event types to handle. For full list of + // all ad event types, see AdEvent.AdEventType documentation. + switch (adEvent.getType()) { + case LOADED: + // AdEventType.LOADED is fired when ads are ready to play. + + // This sample app uses the sample tag + // single_preroll_skippable_ad_tag_url that requires calling + // AdsManager.start() to start ad playback. + // If you use a different ad tag URL that returns a VMAP or + // an ad rules playlist, the adsManager.init() function will + // trigger ad playback automatically and the IMA SDK will + // ignore the adsManager.start(). + // It is safe to always call adsManager.start() in the + // LOADED event. + adsManager.start(); + break; + case CONTENT_PAUSE_REQUESTED: + // AdEventType.CONTENT_PAUSE_REQUESTED is fired when you + // should pause your content and start playing an ad. + pauseContentForAds(); + break; + case CONTENT_RESUME_REQUESTED: + // AdEventType.CONTENT_RESUME_REQUESTED is fired when the ad + // you should play your content. + resumeContent(); + break; + case ALL_ADS_COMPLETED: + // Calling adsManager.destroy() triggers the function + // VideoAdPlayer.release(). + adsManager.destroy(); + adsManager = null; + break; + case CLICKED: + // When the user clicks on the Learn More button, the IMA SDK fires + // this event, pauses the ad, and opens the ad's click-through URL. + // When the user returns to the app, the IMA SDK calls the + // VideoAdPlayer.playAd() function automatically. + break; + default: + break; } - }); - AdsRenderingSettings adsRenderingSettings = - ImaSdkFactory.getInstance().createAdsRenderingSettings(); - // Add any ads rendering settings here. - // This init() only loads the UI rendering settings locally. - adsManager.init(adsRenderingSettings); - } + } + }); + AdsRenderingSettings adsRenderingSettings = + ImaSdkFactory.getInstance().createAdsRenderingSettings(); + // Add any ads rendering settings here. + // This init() only loads the UI rendering settings locally. + adsManager.init(adsRenderingSettings); }); // When the play button is clicked, request ads and hide the button. diff --git a/basicexample/build.gradle b/basicexample/build.gradle index 72e8e2f..2e50183 100644 --- a/basicexample/build.gradle +++ b/basicexample/build.gradle @@ -6,7 +6,7 @@ buildscript { mavenCentral() } dependencies { - classpath 'com.android.tools.build:gradle:8.3.2' + classpath 'com.android.tools.build:gradle:8.7.0' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files diff --git a/basicexample/gradle.properties b/basicexample/gradle.properties index 5465fec..03e4bb6 100644 --- a/basicexample/gradle.properties +++ b/basicexample/gradle.properties @@ -1,2 +1,6 @@ android.enableJetifier=true -android.useAndroidX=true \ No newline at end of file +android.useAndroidX=true + +# Prevents the GitHub actions build from failing with a +# "java.lang.OutOfMemoryError: Java heap space" error. +org.gradle.jvmargs=-Xmx2048m \ No newline at end of file diff --git a/umpexample/app/build.gradle b/umpexample/app/build.gradle index 9aa3700..ce7fa9f 100644 --- a/umpexample/app/build.gradle +++ b/umpexample/app/build.gradle @@ -36,6 +36,6 @@ dependencies { implementation 'androidx.appcompat:appcompat:1.7.0' implementation 'androidx.browser:browser:1.8.0' implementation 'androidx.media:media:1.7.0' - implementation 'com.google.ads.interactivemedia.v3:interactivemedia:3.35.0' + implementation 'com.google.ads.interactivemedia.v3:interactivemedia:3.35.1' implementation 'com.google.android.ump:user-messaging-platform:3.0.0' } diff --git a/umpexample/build.gradle b/umpexample/build.gradle index 72e8e2f..2e50183 100644 --- a/umpexample/build.gradle +++ b/umpexample/build.gradle @@ -6,7 +6,7 @@ buildscript { mavenCentral() } dependencies { - classpath 'com.android.tools.build:gradle:8.3.2' + classpath 'com.android.tools.build:gradle:8.7.0' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files diff --git a/umpexample/gradle.properties b/umpexample/gradle.properties index 5465fec..03e4bb6 100644 --- a/umpexample/gradle.properties +++ b/umpexample/gradle.properties @@ -1,2 +1,6 @@ android.enableJetifier=true -android.useAndroidX=true \ No newline at end of file +android.useAndroidX=true + +# Prevents the GitHub actions build from failing with a +# "java.lang.OutOfMemoryError: Java heap space" error. +org.gradle.jvmargs=-Xmx2048m \ No newline at end of file