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
‘saspectRatio
can now be negative to invite you to useLayoutParams.WRAP_CONTENT
instead of computing the height yourself.
Migration from version 8.1.0 to 8.2.0
Banner format
Updated APIs
- The
SASBannerView.BannerListener
interface has two new methods that require implementation,onBannerAdExpanded
andonBannerAdCollapsed
, 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
-
setForcedLocation
andgetForcedLocation
. -
setManualBaseUrl
. The support ofmanualBaseUrl
was dropped. -
setCustomIdentifier
andgetCustomIdentifier
.
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
-
contentUrl
property was dropped. -
mediationExtraParameters
property 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:
SASAdDisplayTimeoutException
SASAdTimeoutException
SASInvalidJSONException
SASNoAdToDeliverException
SASPendingAdException
SASVASTParsingException
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:
SASMediationAdElement
SASNativeAdElement
SASNativeParallaxAdElement
SASNativeVideoAdElement
Banner format
The implementation documentation of SASBannerView
can be found here.
Removed APIs
-
getCurrentAdElement
was removed. Use theSASAdInfo
instance returned in theonBannerAdLoaded
callback instead. -
getExpectedFormatType
. -
installLoaderView
andremoveLoaderView
. The loader view is not supported anymore. -
sendMessageToWebView
. This feature is not supported anymore. -
setRefreshInterval
. - APIs related to the sticky mode, such as
setStickyModeAnchorView
anddismissStickyMode
. -
MessageHandler
support was dropped.
Updated APIs
- There is only one
loadAd
method to call. All other load methods were removed. getRatio
is not accessible anymore on theSASBannerView
. From now on, you will find this ratio value in theSASAdInfo
returned by theonBannerAdLoaded
callback of theSASBannerView.BannerListener
. More information in the dedicatec banner documentation.- The
setParallaxMarginBottom
andsetParallaxMarginTop
methods ofSASBannerView
, which were used to setup the parallax creative margins, have been replaced (starting from the Equativ Display SDK 8.1.0) by theparallaxMargins
property, which is an instance of the newSASParallaxMargins
class. For more detail, please refer to the banner integration guide.
Listener
All callback methods of SASBannerView.BannerListener
have changed.
SASBannerView.BannerListener
removed callbacks:
onBannerAdClosed
onBannerAdCollapsed
onBannerAdExpanded
onBannerAdResized
onBannerAdVideoEvent
SASBannerView.BannerListener
updated callbacks:
-
onBannerAdLoaded
does not return the instance of theSASBannerView
that triggered the listener anymore, and provides an instance ofSASAdInfo
instead of aSASAdElement
. -
onBannerAdFailedToLoad
does not return the instance of theSASBannerView
that triggered the listener anymore and always provides aSASException
instance. -
onBannerAdClicked
does not return the instance of theSASBannerView
that triggered the listener anymore.
Interstitial format
The implementation documentation of SASInterstitialManager
can be found here.
Removed APIs
- There is no more
OnCrashListener
to set on theSASInterstitialManager
. -
getCurrentAdElement
was removed. Use theSASAdInfo
instance returned in theonInterstitialAdLoaded
callback instead. -
MessageHandler
support was dropped. -
isShowable
was removed. This information can be found by using theSASAdStatus
property. -
sendMessageToWebView
. This feature is not supported anymore. -
reset
is now unavailable.
Updated APIs
- The constructor related to the In-app bidding were removed.
- There is only one
loadAd
method 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:
-
onInterstitialAdLoaded
does not return the instance ofSASInterstitialManager
anymore and provides an instance ofSASAdInfo
instead of aSASAdElement
. - does not return the instance of
SASInterstitialManager
anymore and always provides aSASException
instance. -
onInterstitialAdShown
does not return the instance ofSASInterstitialManager
anymore. -
onInterstitialAdFailedToShow
does not give the instance ofSASInterstitialManager
anymore and always provides aSASException
instance. -
onInterstitialAdDismissed
is renamedonInterstitialAdClosed
and does not return the instance ofSASInterstitialManager
anymore. -
onInterstitialAdClicked
does not return the instance ofSASInterstitialManager
anymore.
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
BiddingManagerListener
listener class is now a property of theSASBiddingManager
class instead of being passed in the constructor. - the
load()
method of theSASBiddingManager
class in the Smart Display SDK v7.x was renamed toloadAd()
in the Equativ Display SDK - the currency String property of the
SASBiddingAdPrice
class in the the Smart Display SDK v7.x was replaced by aSASBiddingAdCurrency
enum class in the Equativ Display SDK - for a
SASInterstitialManager
instantiated 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 theSASBiddingAdResponse
had 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. Please have a look to our roadmap for more information about the upcoming features.
Rewarded video format related APIs
-
SASRewardedVideoManager
class and its listenerSASRewardedVideoManager.RewardedVideoListener
. -
SASReward
class.
3rd party in-app bidding related APIs
-
SASBidderAdapter
interface and its implementations:-
SASBannerBidderAdapter
and its listenerSASBannerBidderAdapterListener
. -
SASInterstitialBidderAdapter
and its listenerSASInterstitialBidderAdapterListener
.
-
-
SASBidderAdapter.CompetitionType
andSASBidderAdapter.RenderingType
enum classes.