Package 

Class EloAd


  • 
    public final class EloAd
    
                        

    One ad ready to render.

    An EloAd is a showing, not a creative. The same creative can win repeatedly for the same user, and each win is a separate ad opportunity with its own tracking. id is that opportunity and is what impression dedup and analytics correlate on; creativeId is the artwork it happened to serve.

    The tracker is set by the winning adapter and owns render / impression telemetry plus click lifecycle behavior. Elo-direct clicks currently notify the publisher locally without a client-side click POST. The SDK never reads network-specific fields directly — it calls tracker methods.

    The optional renderer is set by adapters whose underlying SDK requires view registration to count impressions and clicks (AdMob, Meta). When present, the SDK's Compose ad views embed the renderer's view via AndroidView { ... } instead of rendering Elo-styled chrome.

    clickUrl is exposed (still internal) for the view layer to launch the destination in a browser via Intent.ACTION_VIEW.

    Mirrors iOS EloAd.

    • Method Detail

      • getId

         final String getId()

        The ad opportunity this showing belongs to (ad response request_id).

        Render, impression, and click URLs are keyed under this id server-side, so it is what correlates a confirmed impression to its funnel row and what render/impression dedup keys on. Carried through to the impression diagnostics entry (EloTrackingDiagnosticsEntry.serverRequestId).

        Adapter authors: this must be unique per fill, not per creative. Networks exposing their own per-response id should pass it; those that don't should mint one. Mirrors iOS EloAd.id.

      • getCreativeId

         final String getCreativeId()

        The creative that filled this opportunity (ad response ad_id).

        Stable across opportunities — the same creative is served to the same user many times. Use it to recognize a creative, never to identify a showing, which is id. Deduping on this instead silenced every showing of a creative after the first, so those opportunities recorded a click with no render and no impression (ENG-375), and suppressed a repeat creative's thumbnail after one failed image load (ENG-397). Mirrors iOS EloAd.creativeId.

      • releaseResources

         final Unit releaseResources()

        Release adapter-owned resources tied to this ad. Call this only when you've decided not to render the ad — e.g. you ran a client-side auction against another SDK and chose the other bid, so the EloAd you received from Elo.loadAd will never reach an EloAdView.

        For adapter-rendered fills (AdMob native, Meta, etc.) the underlying network's SDK holds native resources (e.g. AdMob's NativeAd) that get released here. For Elo-direct fills this is a no-op. Safe to call more than once.

        Do not call this on an ad you've passed to EloAdView or Elo.trackRender — the SDK manages losing-bid cleanup automatically (ParallelAuctionMediator releases all losing bids before returning the winner), and the view layer keeps the winner alive as long as it's displayed.

        Named for parity with iOS EloAd.releaseResources().