Android Migration guide
This page will walk you through the migration process from a SDK version to a newer one, starting from the version 8.0.0.
We advise you to update your SDK version on regular basis to avoid making the migration process more tedious, and to have access to new features and bug fixes.
Table of contents
- Migration from version 8.2.0 to 8.3.0 and above
- Migration from version 8.1.0 to 8.2.0
- Migration from version 7.x to 8.4.0
Migration from version 8.2.0 to 8.3.0 and above
Banner format
Updated Behaviors
- The
SASAdInfo‘saspectRatiocan now be negative to invite you to useLayoutParams.WRAP_CONTENTinstead of computing the height yourself.
Migration from version 8.1.0 to 8.2.0
Banner format
Updated APIs
- The
SASBannerView.BannerListenerinterface has two new methods that require implementation,onBannerAdExpandedandonBannerAdCollapsed, to be notified when the banner expand state changes.
Interstitial format
Updated APIs
- The main constructor now requires an Activity instance to be passed instead of a more generic Context instance.
For more detail, please refer to the interstitial integration guide.
Migration from version 7.x to 8.4.0
Integration changes
All the integration related information can be found here.
Library name
The fully qualified name of the library has changed with this version 8.0.0.
You’ll have to update the declared dependency from com.smartadserver.com:smart-display-sdk:X.Y.Z to com.equativ.android:equativ-display-sdk:X.Y.Z.
minSdkVersion
The minSdkVersion has been bumped from 19 to 23, meaning your application’s will need to declare a minSdkVersion of 23 at least to integrate the Equativ Display SDK 8.0.0.
APIs related to supported features
Package name
The root package of the SDK has changed from com.smartadserver.android.library to com.equativ.displaysdk. Therefore, all classes and interfaces are impacted.
SASConfiguration
SASConfiguration remains a singleton object, but it is now a a Kotlin object instead of a java class using the singleton pattern. It can therefore be used directly without the need to call a getSharedInstance method (that was been removed as a Kotlin object acts as a singleton. See the official Kotlin documentation).
You can now access its APIs as follows:
Removed APIs
-
setForcedLocationandgetForcedLocation. -
setManualBaseUrl. The support ofmanualBaseUrlwas dropped. -
setCustomIdentifierandgetCustomIdentifier.
Updated APIs
- Both
configure(context: Context, siteId: Int)andconfigure(context: Context, siteId: Int, manualBaseUrl: String)were replaced by a single methodconfigure(context: Context). This new method doesn’t need a site ID or manualBaseUrl parameters because the SDK will always use the base URL related to the current ad call site ID, found in the ad placement.
SASLibraryInfo
SASLibraryInfo remains a singleton, but it is now a a Kotlin object instead of a java class using the singleton pattern. It can therefore be used directly without the need to call a getSharedInstance method (that was been removed as a Kotlin object acts as a singleton. See the official Kotlin documentation).
You can now access its APIs as follows:
Ad placement
Test placements
The test placement list definition is now done within a companion object in the SASAdPlacement . You’ll find more information on how to use them here.
Constructors
There is only 1 contructor remaining to instantiate SASAdPlacement
constructor(siteId: Long, pageId: Long, formatId: Long, keywordTargetingString: String? = null) .
All of the constructors using pageName were dropped, because pageName is not supported anymore.
Also, the contructor using the supplyChainObject parameter is not available anymore. The supplyChainObjectString parameter is now available as a mutable property. Please refer to the API reference documentation of the supplyChainObjectString property.
Removed APIs
-
contentUrlproperty was dropped. -
mediationExtraParametersproperty was dropped as mediation is not implemented yet. -
isMaster()method was dropped. -
usesPageName()method was dropped, as pageName is not supported anymore.
Exceptions
From now on, the Equativ Display SDK will only return only one class of Exception in case of error, the SASException class. This class has a type property letting you know the type of error encountered. This SASException class and its ‘type’ values covers all the cases where the older Exception classes the Display SDK 7.x would be thrown.
Therefore, the following classes have been removed:
SASAdDisplayTimeoutExceptionSASAdTimeoutExceptionSASInvalidJSONExceptionSASNoAdToDeliverExceptionSASPendingAdExceptionSASVASTParsingException
SASAdElement
The model class SASAdElement that was returned in successful adLoaded callbacks does not exist anymore.
From now on, successful adLoaded callbacks will return a SASAdInfo instance instead.
All other AdElement model classes were removed too:
SASMediationAdElementSASNativeAdElementSASNativeParallaxAdElementSASNativeVideoAdElement
Banner format
The implementation documentation of SASBannerView can be found here.
Removed APIs
-
getCurrentAdElementwas removed. Use theSASAdInfoinstance returned in theonBannerAdLoadedcallback instead. -
getExpectedFormatType. -
installLoaderViewandremoveLoaderView. The loader view is not supported anymore. -
sendMessageToWebView. This feature is not supported anymore. -
setRefreshInterval. - APIs related to the sticky mode, such as
setStickyModeAnchorViewanddismissStickyMode. -
MessageHandlersupport was dropped.
Updated APIs
- There is only one
loadAdmethod to call. All other load methods were removed. getRatiois not accessible anymore on theSASBannerView. From now on, you will find this ratio value in theSASAdInforeturned by theonBannerAdLoadedcallback of theSASBannerView.BannerListener. More information in the dedicatec banner documentation.- The
setParallaxMarginBottomandsetParallaxMarginTopmethods ofSASBannerView, which were used to setup the parallax creative margins, have been replaced (starting from the Equativ Display SDK 8.1.0) by theparallaxMarginsproperty, which is an instance of the newSASParallaxMarginsclass. For more detail, please refer to the banner integration guide.
Listener
All callback methods of SASBannerView.BannerListener have changed.
SASBannerView.BannerListener removed callbacks:
onBannerAdClosedonBannerAdCollapsedonBannerAdExpandedonBannerAdResizedonBannerAdVideoEvent
SASBannerView.BannerListener updated callbacks:
-
onBannerAdLoadeddoes not return the instance of theSASBannerViewthat triggered the listener anymore, and provides an instance ofSASAdInfoinstead of aSASAdElement. -
onBannerAdFailedToLoaddoes not return the instance of theSASBannerViewthat triggered the listener anymore and always provides aSASExceptioninstance. -
onBannerAdClickeddoes not return the instance of theSASBannerViewthat triggered the listener anymore.
Interstitial format
The implementation documentation of SASInterstitialManager can be found here.
Removed APIs
- There is no more
OnCrashListenerto set on theSASInterstitialManager. -
getCurrentAdElementwas removed. Use theSASAdInfoinstance returned in theonInterstitialAdLoadedcallback instead. -
MessageHandlersupport was dropped. -
isShowablewas removed. This information can be found by using theSASAdStatusproperty. -
sendMessageToWebView. This feature is not supported anymore. -
resetis now unavailable.
Updated APIs
- The constructor related to the In-app bidding were removed.
- There is only one
loadAdmethod to call. All other load methods were removed.
Listener
The interstitial listener was renamed from SASInterstitialManager.InterstitialListener to SASInterstitialManager.InterstitialManagerListener .
All callback methods of SASInterstitialManager.InterstitialManagerListener have changed.
SASInterstitialManager.InterstitialManagerListener removed callbacks:
onInterstitialAdVideoEvent
SASInterstitialManager.InterstitialManagerListener updated callbacks:
-
onInterstitialAdLoadeddoes not return the instance ofSASInterstitialManageranymore and provides an instance ofSASAdInfoinstead of aSASAdElement. - does not return the instance of
SASInterstitialManageranymore and always provides aSASExceptioninstance. -
onInterstitialAdShowndoes not return the instance ofSASInterstitialManageranymore. -
onInterstitialAdFailedToShowdoes not give the instance ofSASInterstitialManageranymore and always provides aSASExceptioninstance. -
onInterstitialAdDismissedis renamedonInterstitialAdClosedand does not return the instance ofSASInterstitialManageranymore. -
onInterstitialAdClickeddoes not return the instance ofSASInterstitialManageranymore.
Native ad format
The native ad format has been added to the Equativ Display SDK 8.3.0, and its API underwent a complete redesign compared to the native ad integration in the Smart Display SDK v7.x. The native ad rendering is now done by the SDK, via the SASNativeAdView or the SASBannerView classes.
Consequently, all classes and methods related to native ads in the Smart Display SDK v7.x , such as the SASNativeAdManager, SASNativeAdElement and SASNativeAdMediaView were removed.
For more details, please check the native ad integration article.
Mediation API (for the Equativ Display SDK as primary SDK)
Although similar to its counterpart in Smart Display SDK v7.x, the mediation API for the Equativ Display SDK as primary SDK was redesigned, and only the SASMediationBannerAdapter and SASMediationInterstitialAdapter class names remained the same, their methods and properties being different.
For more details, please check the Mediation as Primary SDK article, and more particularly the implement a custom mediation adapter article if you intend to implement your own Android mediation adapter for a third-party SDK that is not yet provided by Equativ.
In-App Bidding
The In-app bidding feature has been added to the Equativ Display SDK 8.4.0.
The API is very similar to the Smart Display SDK v7.x one, except for a few differences:
- the
BiddingManagerListenerlistener class is now a property of theSASBiddingManagerclass instead of being passed in the constructor. - the
load()method of theSASBiddingManagerclass in the Smart Display SDK v7.x was renamed toloadAd()in the Equativ Display SDK - the currency String property of the
SASBiddingAdPriceclass in the the Smart Display SDK v7.x was replaced by aSASBiddingAdCurrencyenum class in the Equativ Display SDK - for a
SASInterstitialManagerinstantiated from aSASBiddingAdResponse, once theloadAd()is called to render the bidding ad, any subsequent call toloadAd()will simply trigger theonInterstitialAdLoaded()callback method again, contrary to the Smart Display SDK v7.x where an exception was thrown stating that theSASBiddingAdResponsehad been consumed already.
For more detail, please refer to the in-app integration guide.
APIs related to dropped or yet to come features
The following list wraps up all the classes, interfaces and APIs related to features that are not currently available in the Equativ Display SDK 8.4.0, but were in the previous versions.
Some of those features might be supported in future releases, some others will not.
Rewarded video format related APIs
-
SASRewardedVideoManagerclass and its listenerSASRewardedVideoManager.RewardedVideoListener. -
SASRewardclass.
3rd party in-app bidding related APIs
-
SASBidderAdapterinterface and its implementations:-
SASBannerBidderAdapterand its listenerSASBannerBidderAdapterListener. -
SASInterstitialBidderAdapterand its listenerSASInterstitialBidderAdapterListener.
-
-
SASBidderAdapter.CompetitionTypeandSASBidderAdapter.RenderingTypeenum classes.