Package 

Interface AdNetworkAdapter


  • 
    public interface AdNetworkAdapter
    
                        

    A single ad demand source in the client-side mediation auction.

    Register one adapter per network on ad.elo.androidsdk.EloConfiguration.adapters. The mediator calls bid on every adapter in parallel and returns the highest-priced creative.

    Implementations should:

    • Return null for no-fill. Throwing is reserved for real errors (network failures, SDK not ready). No-fill is a normal outcome.

    • Respect AdBidRequest.timeoutMs. The mediator enforces its own ceiling, but well-behaved adapters should cancel their own work if they can't meet the budget.

    • Be safe to call concurrently. The mediator invokes adapters from a coroutineScope { async { ... } } per auction.

    Elo's own adapter (EloNetworkAdapter) is built internally by EloState from the publisher config; consumers never construct it.

    Mirrors iOS AdNetworkAdapter.

    • Method Summary

      Modifier and Type Method Description
      Unit start(Context context, AdConsent consent) Start or warm the adapter's underlying SDK.
      abstract AdBid bid(AdBidRequest request) Bid on the given request.
      Unit shutdown() Tear-down hook.
      abstract String getNetworkId() Stable identifier for this network.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • start

         Unit start(Context context, AdConsent consent)

        Start or warm the adapter's underlying SDK. Called once before the adapter's first auction. Default is a no-op.

      • bid

         abstract AdBid bid(AdBidRequest request)

        Bid on the given request. Return null for no-fill; throw an AdAdapterError for errors that should be surfaced but not break the auction.

      • shutdown

         Unit shutdown()

        Tear-down hook. Called from Elo.shutdown(). Default is a no-op.

      • getNetworkId

         abstract String getNetworkId()

        Stable identifier for this network. Used for logging and to attribute winning bids. Must be unique across registered adapters; duplicates surface as a ad.elo.androidsdk.internal.ValidationIssue from ConfigurationValidator and remain in the auction (no auto-dedupe).