ドキュメント

​
​

Development

User Acquisition

Monetization

産業

Unity Ads Monetization

SDK 4.20.0

サポート対象
​

Android API reference

Unity Ads Monetization

SDK 4.20.0

サポート対象
​

このページは選択した言語では使用できません。
Android developer guides
​
​
Android developer guides
  • Android SDK integration guide
  • Unity Ads privacy guide
  • Unity Ads SDK troubleshooting guide
  • Android developer API references
  1. Unity Ads SDK Android developer monetization
  2. Unity Ads SDK integration guide for Android developers

Implement interstitial ads in Android

Implement interstitial ads in your Android app. Load ad content, display it through Java code, and use a listener to manage ad events.
読み終わるまでの所要時間 2 分
最終更新 1ヶ月前

Interstitial ad load example

Use
LoadConfiguration.Builder
to construct a load request with the placement ID and mediation metadata, optionally including ad markup for bidding. Pass the built configuration to
InterstitialAd.load()
along with a
LoadListener
. The
onAdLoaded
callback receives the loaded
InterstitialAd
instance on success, or a
UnityAdsError
on failure. Retain the ad instance, as it's required to show the ad later.
Ads expire a set time after they load if they aren't shown. Set
onAdExpired
on the loaded ad instance to detect this and clear your reference. Calling
show()
on an expired ad fails. Do this in the same block where you store the ad, then use the callback to discard the stale reference and trigger a new
load()
call so a valid ad is ready the next time you need one.
InterstitialAd.load(loadConfig, (interstitialAd, error) -> { if (interstitialAd != null) { // Ad loaded successfully, ready to be shown this.interstitialAd = interstitialAd; interstitialAd.setOnAdExpired(expiredAd -> { this.interstitialAd = null; // reload here }); } else { // Handle load error }});
InterstitialAd.load(loadConfig, { interstitialAd, error -> if (interstitialAd != null) { // Ad loaded successfully, ready to be shown this.interstitialAd = interstitialAd interstitialAd.onAdExpired = AdExpiredListener { _ -> this.interstitialAd = null // reload here } } else { // Handle load error }})

Interstitial ad show example

Call
show()
on the retained
InterstitialAd
instance, passing the activity, a
ShowConfiguration
, and an
InterstitialShowListener
. The listener provides callbacks for each stage of the ad's lifecycle:
onStarted
when the ad displays,
onClicked
when the user interacts with it,
onCompleted
when it closes, and
onFailed
if an error occurs — with the error details available via the
UnityAdsError
argument.
loadedInterstitialAd.show(activity, new ShowConfiguration.Builder().build(), new InterstitialShowListener() { @Override public void onStarted(@NonNull InterstitialAd ad) { /* displayed */ } @Override public void onClicked(@NonNull InterstitialAd ad) { /* clicked */ } @Override public void onCompleted(@NonNull InterstitialAd ad, @NonNull ShowFinishState state) { /* hidden */ } @Override public void onFailed(@NonNull InterstitialAd ad, @NonNull UnityAdsError error) { /* failed */ } } );
loadedInterstitialAd.show(activity, ShowConfiguration.Builder().build(), object : InterstitialShowListener { override fun onStarted(ad: InterstitialAd) { /* displayed */ } override fun onClicked(ad: InterstitialAd) { /* clicked */ } override fun onCompleted(ad: InterstitialAd, state: ShowFinishState) { /* hidden */ } override fun onFailed(ad: InterstitialAd, error: UnityAdsError) { /* failed */ }})
Next steps: To improve your implementation, refer to the Implement rewarded ads in Android documentation.

Copyright © 2026 Unity Technologies
法規事項プライバシーポリシークッキーDocumentation Terms of Use私の個人情報を販売または共有しないプライバシーに関する選択 (クッキー設定)

"Unity" の名称、Unity のロゴ、およびその他の Unity の商標は、米国およびその他の国における Unity Technologies またはその関係会社の商標または登録商標です (詳しくはこちら)。その他の名称またはブランドは該当する所有者の商標です。

一部のページは利便性向上のため機械翻訳を使用しており、内容に不正確な表現が含まれる場合があります。内容に齟齬または不一致が生じた場合は、英語版を正本とします。

  • このページ
    • Interstitial ad load example

    • Interstitial ad show example


このページの問題を報告する