ORTB
OMID chapter navigation

Android

platform

The listings on this page are generated by scripts/gen-omid-spec.mjs from official IAB Tech Lab sources, with descriptions in the original English; see the page footer for the collection baseline.

On this page

Role & scope

OM SDK Android exposes the interface through the com.iab.omid.library packages: Omid.activate performs initialisation, AdSession is constructed from AdSessionConfiguration and AdSessionContext, VerificationScriptResource offers factory methods with and without parameters, and ad events and media events live under the adsession and adsession.media packages respectively.

Platform
Android
Implementation
OM SDK Android
Library version
Spec version
OMID 1.6
Public classes
10
Public members
66

Platform notes

  • The entry class is Omid, publishing activate, updateLastActivity, getVersion and isActive; a session is created from AdSessionConfiguration and AdSessionContext via AdSession.createAdSession.
  • Public classes are spread over three packages: com.iab.omid.library (Omid, ScriptInjector), com.iab.omid.library.adsession (AdEvents, AdSession, AdSessionConfiguration, AdSessionContext, Partner, VerificationScriptResource) and com.iab.omid.library.adsession.media (MediaEvents, VastProperties).
  • There is no VerificationClient class on Android: verification scripts always use the JS verification client.
  • No class publishes public fields; instances are always created through static factory methods (createAdSession, createAdEvents, createMediaEvents, createPartner, createAdSessionContext, createAdSessionConfiguration, createVerificationScriptResourceWithParameters / WithoutParameters, createVastProperties and so on).
  • The ad view and obstructions are handled natively through AdSession's registerAdView, addFriendlyObstruction, removeFriendlyObstruction, removeAllFriendlyObstructions and setPossibleObstructionListener.
  • The official Open-Measurement-ReferenceApp-Android repository is frozen at 2020-01 (pre-OM SDK 1.3); the current API surface is authoritative at docs.iabtechlab.com/omsdk-1.6/android.

Public class listing

ClassClientMembersOfficial description
AdEventsOfficial docsSession client4createAdEventsimpressionOccurredloaded()loaded(VastProperties)Ad event API enabling the integration partner to signal to all verification providers when key events have occurred. Only one ad events implementation can be associated with the ad session and any attempt to create multiple instances will result in an exception. Created by Natasha Garner on 04/09/2017.
AdSessionOfficial docsSession client10AdSessionstarterrorregisterAdViewfinishaddFriendlyObstructionremoveFriendlyObstructionremoveAllFriendlyObstructionssetPossibleObstructionListenercreateAdSessionAd session API enabling the integration partner to notify OM SDK of key state relating to viewability calculations. In addition to viewability this API will also notify all verification providers of key ad session lifecycle events.
AdSessionConfigurationOfficial docsSession client4createAdSessionConfigurationisNativeImpressionOwnerisNativeMediaEventsOwnertoJsonObjectCreated by pharris on 11/09/2017.
AdSessionContextOfficial docsSession client13createHtmlAdSessionContextcreateJavascriptAdSessionContextcreateNativeAdSessionContext(Partner,String,List,String,String,UniversalAdId)createNativeAdSessionContext(Partner,String,List,String,String)getPartnergetVerificationScriptResourcesgetInjectedResourcesMapgetWebViewgetContentUrlgetCustomReferenceDatagetOmidJsScriptContentgetAdSessionContextTypegetUniversalAdIdThis class will provide the ad session both details of the partner and whether this is considered HTML or native. Created by Natasha Garner on 01/08/2017.
MediaEventsOfficial docsSession client14createMediaEventsstartfirstQuartilemidpointthirdQuartilecompletepauseresumebufferStartbufferFinishskippedvolumeChangeplayerStateChangeadUserInteractionThis provides a complete list of native media events supported by OM SDK. Using this event API assumes the native-layer audio/video player is fully responsible for communicating all media events at the appropriate times. Only one media events implementation can be associated with the ad session and any attempt to create multiple instances will result in an exception. Created by Natasha Garner on 10/09/2017.
OmidOfficial docsSession client4activateupdateLastActivitygetVersionisActiveThis application level class will be called by all integration partners to ensure OM SDK has been activated before calling any other API methods. Any attempt to use other API methods prior to activation will result in an exception. Note that OM SDK may only be used on the main UI thread. Make sure you are on the main thread when you initialize the SDK, create its objects, and invoke its methods. Created by Natasha Garner on 20/06/2017.
PartnerOfficial docsSession client3createPartnergetNamegetVersionDetails about the integration partner which will be supplied to the ad session. Created by Natasha Garner on 01/08/2017.
ScriptInjectorOfficial docsSession client1injectScriptContentIntoHtmlUtility class which enables integration partners to use a standard approach for injecting OM SDK JS into the served tag HTML content.
VastPropertiesOfficial docsSession client7createVastPropertiesForSkippableMediacreateVastPropertiesForNonSkippableMediaisSkippablegetSkipOffsetisAutoPlaygetPositiontoJSONThis object is used to capture key VAST properties so this can be shared with all registered verification providers. Created by Natasha Garner on 09/09/2017.
VerificationScriptResourceOfficial docsSession client6createVerificationScriptResourceWithParameterscreateVerificationScriptResourceWithoutParametersgetVendorKeygetResourceUrlgetVerificationParameterstoJsonObjectDetails about the verification provider which will be supplied to the ad session. Created by Natasha Garner on 02/08/2017.

Cross-platform naming

ConceptJavaScriptiOSAndroid
ad-eventsAdEventsOMIDAdEventsAdEvents
ad-sessionAdSessionOMIDAdSessionAdSession
ad-session-configurationOMIDAdSessionConfigurationAdSessionConfiguration
ad-session-contextOMIDAdSessionContextAdSessionContext
contextContext
js-session-serviceOMIDJavaScriptSessionService
media-eventsMediaEventsOMIDMediaEventsMediaEvents
omid-versionOmidVersion
partnerPartnerOMIDPartnerPartner
script-injectorOMIDScriptInjectorScriptInjector
sdk-entryOMIDSDKOmid
universal-ad-idOMIDUniversalAdID
vast-propertiesOMIDVASTPropertiesVastProperties
verification-clientVerificationClient
verification-script-resourceVerificationScriptResourceOMIDVerificationScriptResourceVerificationScriptResource
  • ad-session-configurationNo JS counterpart: creativeType/impressionType are set through AdSession.setCreativeType()/setImpressionType(), and the event-owner concept (impressionOwner/mediaEventsOwner) does not exist on the JS side.
  • ad-session-contextCorresponds to Context on JS: JS folds partner, verificationScriptResources, contentUrl, customReferenceData, universalAdId and the slot/video element into Context plus the AdSession constructor arguments, while the native side splits them into AdSessionContext (iOS additionally has AdSessionConfiguration).
  • contextNo class of this name on iOS/Android: the JS Context is split on the native side into AdSessionContext + AdSessionConfiguration (see the ad-session-context / ad-session-configuration entries).
  • js-session-servicePublished on iOS only: the JS session service built into OM SDK iOS. On Android this is handled by Omid/OmidJsBridge, with no corresponding class published on the javadoc site.
  • omid-versionPublished on JS only: the top of the source file omid-version.js carries TODO(OMSDK-715) noting that the class seems unused and should be removed in the next major version, yet the JSDoc site still publishes it.
  • script-injectorOMIDScriptInjector on iOS / ScriptInjector on Android: inject verification script content into an HTML creative. On the JS side the OM SDK service does this and publishes no class.
  • sdk-entryOMIDSDK on iOS (+sharedInstance / -activate) and Omid on Android (activate(Context) / isActive()); there is no JS counterpart class, as the service script is loaded by the OM SDK service itself.
  • universal-ad-idPublished on iOS only: the JS source has UniversalAdId (exported via packageExport onto OmidSessionClient.UniversalAdId, added in 1.5.5) but the official JSDoc site has no page for it; Android's createNativeAdSessionContext(...)/getUniversalAdId() reference the UniversalAdId type in their signatures, and the javadoc site has no such page either (verified 404).
  • vast-propertiesVastProperties on JS (src/common/vast-properties.js, marked @public and listed in jsdoc.json's include list) is not published on the official JSDoc site (VastProperties.html verified 404), so js is recorded as null; AdEvents.loaded(vastProperties) therefore references a type that is undocumented on the site.
  • verification-clientPublished on JS only: verification scripts (third-party measurement) always use the JS OmidVerificationClient; the native SDKs contain no verification client.

Class names for the same concept on each of the three platforms; a blank cell means that platform provides no corresponding class. On the JS side session configuration is folded into Context and the constructor arguments, while iOS / Android split it into separate configuration and context classes.

Content is taken from official IAB Tech Lab sources (the OM SDK JS repository, the three platforms' official API docs, the OpenRTB support advisory and the VAST specification); spec data is kept in the original English and site-written prose is bilingual. See data/omid-spec/PROVENANCE.json for provenance.