# Android > Migration guide

Source: https://help-display-sdk.equativ.com/android/migration.html

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.

---

## Migration from version 8.2.0 to 8.3.0 and above

### Banner format

##### Updated Behaviors

- The [`SASAdInfo`](https://help-display-sdk.equativ.com/android/API/-display%20-s-d-k/com.equativ.displaysdk.model/-s-a-s-ad-info/index.html)'s [`aspectRatio`](https://help-display-sdk.equativ.com/android/API/-display%20-s-d-k/com.equativ.displaysdk.model/-s-a-s-ad-info/aspect-ratio.html) can now be negative to invite you to use `LayoutParams.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`](https://help-display-sdk.equativ.com/android/API/-display%20-s-d-k/com.equativ.displaysdk.ad.banner/-s-a-s-banner-view/-banner-listener/index.html) interface has two new methods that require implementation, `onBannerAdExpanded` and `onBannerAdCollapsed`, 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](https://help-display-sdk.equativ.com/android/integration/interstitial.html#loading).

## Migration from version 7.x to 8.5.5

### SASConfiguration

##### Renamed API

- `setCustomIdentifier` and `getCustomIdentifier`. Renamed `setPublisherIdentifier` and `getPublisherIdentifier`.

## Migration from version 7.x to 8.4.0

### Integration changes

All the integration related information can be found [here](https://help-display-sdk.equativ.com/android/gettingstarted.html.md).

##### 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`](https://help-display-sdk.equativ.com/android/API/-display%20-s-d-k/com.equativ.displaysdk.util/-s-a-s-configuration/index.html) 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](https://kotlinlang.org/docs/object-declarations.html#object-declarations-overview)).

You can now access its APIs as follows:

#### Kotlin

```kotlin
SASConfiguration.<the api>
```

#### Java

```java
SASConfiguration.INSTANCE.<the api>
```

##### Removed APIs

- `setForcedLocation` and `getForcedLocation`.
- `setManualBaseUrl`. The support of `manualBaseUrl` was dropped.
- `setCustomIdentifier` and `getCustomIdentifier`. Renamed `setPublisherIdentifier` and `getPublisherIdentifier` in the v8.5.5.

##### Updated APIs

- Both `configure(context: Context, siteId: Int)` and `configure(context: Context, siteId: Int, manualBaseUrl: String)` were replaced by a single method [`configure(context: Context)`](https://help-display-sdk.equativ.com/android/API/-display%20-s-d-k/com.equativ.displaysdk.util/-s-a-s-configuration/configure.html).
  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`](https://help-display-sdk.equativ.com/android/API/-display%20-s-d-k/com.equativ.displaysdk.util/-s-a-s-library-info/index.html) 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](https://kotlinlang.org/docs/object-declarations.html#object-declarations-overview)).

You can now access its APIs as follows:

#### Kotlin

```kotlin
SASLibraryInfo.<the api>
```

#### Java

```java
SASLibraryInfo.INSTANCE.<the api>
```

### Ad placement

##### Test placements

The test placement list definition is now done within a `companion object` in the [`SASAdPlacement`](https://help-display-sdk.equativ.com/android/API/-display%20-s-d-k/com.equativ.displaysdk.model/-s-a-s-ad-placement/index.html). You'll find more information on how to use them [here](https://help-display-sdk.equativ.com/android/troubleshooting.html.md).

##### Constructors

There is only 1 contructor remaining to instantiate [`SASAdPlacement`](https://help-display-sdk.equativ.com/android/API/-display%20-s-d-k/com.equativ.displaysdk.model/-s-a-s-ad-placement/index.html)

[`constructor(siteId: Long, pageId: Long, formatId: Long, keywordTargetingString: String? = null)`](https://help-display-sdk.equativ.com/android/API/-display%20-s-d-k/com.equativ.displaysdk.model/-s-a-s-ad-placement/-s-a-s-ad-placement.html).

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`](https://help-display-sdk.equativ.com/android/API/-display%20-s-d-k/com.equativ.displaysdk.model/-s-a-s-ad-placement/supply-chain-object-string.html) 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`](https://help-display-sdk.equativ.com/android/API/-display%20-s-d-k/com.equativ.displaysdk.exception/-s-a-s-exception/index.html) class. This class has a `type` property letting you know the type of error encountered.
This [`SASException`](https://help-display-sdk.equativ.com/android/API/-display%20-s-d-k/com.equativ.displaysdk.exception/-s-a-s-exception/index.html) 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`](https://help-display-sdk.equativ.com/android/API/-display%20-s-d-k/com.equativ.displaysdk.model/-s-a-s-ad-info/index.html) instance instead.

All other _AdElement_ model classes were removed too:
- `SASMediationAdElement`
- `SASNativeAdElement`
- `SASNativeParallaxAdElement`
- `SASNativeVideoAdElement`

### Banner format

The implementation documentation of [`SASBannerView`](https://help-display-sdk.equativ.com/android/API/-display%20-s-d-k/com.equativ.displaysdk.ad.banner/-s-a-s-banner-view/index.html) can be found [here](https://help-display-sdk.equativ.com/android/integration/banner.html.md).

##### Removed APIs

- `getCurrentAdElement` was removed. Use the [`SASAdInfo`](https://help-display-sdk.equativ.com/android/API/-display%20-s-d-k/com.equativ.displaysdk.model/-s-a-s-ad-info/index.html) instance returned in the [`onBannerAdLoaded`](https://help-display-sdk.equativ.com/android/API/-display%20-s-d-k/com.equativ.displaysdk.ad.banner/-s-a-s-banner-view/-banner-listener/on-banner-ad-loaded.html) callback instead.
- `getExpectedFormatType`.
- `installLoaderView` and `removeLoaderView`. The loader view is not supported anymore.
- `sendMessageToWebView`. This feature is not supported anymore.
- `setRefreshInterval`.
- APIs related to the sticky mode, such as `setStickyModeAnchorView` and `dismissStickyMode`.
- `MessageHandler` support was dropped.

##### Updated APIs

- There is only one [`loadAd`](https://help-display-sdk.equativ.com/android/API/-display%20-s-d-k/com.equativ.displaysdk.ad.banner/-s-a-s-banner-view/load-ad.html) method to call. All other load methods were removed.
- `getRatio` is not accessible anymore on the [`SASBannerView`](https://help-display-sdk.equativ.com/android/API/-display%20-s-d-k/com.equativ.displaysdk.ad.banner/-s-a-s-banner-view/index.html). From now on, you will find this ratio value in the [`SASAdInfo`](https://help-display-sdk.equativ.com/android/API/-display%20-s-d-k/com.equativ.displaysdk.model/-s-a-s-ad-info/index.html) returned
  by the [`onBannerAdLoaded`](https://help-display-sdk.equativ.com/android/API/-display%20-s-d-k/com.equativ.displaysdk.ad.banner/-s-a-s-banner-view/-banner-listener/on-banner-ad-loaded.html) callback of the [`SASBannerView.BannerListener`](https://help-display-sdk.equativ.com/android/API/-display%20-s-d-k/com.equativ.displaysdk.ad.banner/-s-a-s-banner-view/-banner-listener/index.html). More information in the dedicatec banner [documentation](https://help-display-sdk.equativ.com/android/integration/banner.html#how-to-adapter-the-banner-size-after-loading).

- The `setParallaxMarginBottom` and `setParallaxMarginTop` methods of `SASBannerView`, which were used to setup the parallax creative margins, have been replaced (starting from the **Equativ Display SDK** 8.1.0) by the [`parallaxMargins`](https://help-display-sdk.equativ.com/android/API/-display%20-s-d-k/com.equativ.displaysdk.ad.banner/-s-a-s-banner-view/parallax-margins.html) property, which is an instance of the new [`SASParallaxMargins`](https://help-display-sdk.equativ.com/android/API/-display%20-s-d-k/com.equativ.displaysdk.model/-s-a-s-parallax-margins/index.html) class. For more detail, please refer to the [banner integration guide](https://help-display-sdk.equativ.com/android/integration/banner.html#parallax).

##### Listener

All callback methods of [`SASBannerView.BannerListener`](https://help-display-sdk.equativ.com/android/API/-display%20-s-d-k/com.equativ.displaysdk.ad.banner/-s-a-s-banner-view/-banner-listener/index.html) have changed.

[`SASBannerView.BannerListener`](https://help-display-sdk.equativ.com/android/API/-display%20-s-d-k/com.equativ.displaysdk.ad.banner/-s-a-s-banner-view/-banner-listener/index.html) removed callbacks:
- `onBannerAdClosed`
- `onBannerAdCollapsed`
- `onBannerAdExpanded`
- `onBannerAdResized`
- `onBannerAdVideoEvent`

[`SASBannerView.BannerListener`](https://help-display-sdk.equativ.com/android/API/-display%20-s-d-k/com.equativ.displaysdk.ad.banner/-s-a-s-banner-view/-banner-listener/index.html) updated callbacks:
- [`onBannerAdLoaded`](https://help-display-sdk.equativ.com/android/API/-display%20-s-d-k/com.equativ.displaysdk.ad.banner/-s-a-s-banner-view/-banner-listener/on-banner-ad-loaded.html) does not return the instance of the [`SASBannerView`](https://help-display-sdk.equativ.com/android/API/-display%20-s-d-k/com.equativ.displaysdk.ad.banner/-s-a-s-banner-view/index.html) that triggered the listener anymore, and provides an instance of [`SASAdInfo`](https://help-display-sdk.equativ.com/android/API/-display%20-s-d-k/com.equativ.displaysdk.model/-s-a-s-ad-info/index.html) instead of a `SASAdElement`.
- [`onBannerAdFailedToLoad`](https://help-display-sdk.equativ.com/android/API/-display%20-s-d-k/com.equativ.displaysdk.ad.banner/-s-a-s-banner-view/-banner-listener/on-banner-ad-failed-to-load.html) does not return the instance of the [`SASBannerView`](https://help-display-sdk.equativ.com/android/API/-display%20-s-d-k/com.equativ.displaysdk.ad.banner/-s-a-s-banner-view/index.html) that triggered the listener anymore and always provides a [`SASException`](https://help-display-sdk.equativ.com/android/API/-display%20-s-d-k/com.equativ.displaysdk.exception/-s-a-s-exception/index.html) instance.
- [`onBannerAdClicked`](https://help-display-sdk.equativ.com/android/API/-display%20-s-d-k/com.equativ.displaysdk.ad.banner/-s-a-s-banner-view/-banner-listener/on-banner-ad-clicked.html) does not return the instance of the [`SASBannerView`](https://help-display-sdk.equativ.com/android/API/-display%20-s-d-k/com.equativ.displaysdk.ad.banner/-s-a-s-banner-view/index.html) that triggered the listener anymore.

### Interstitial format

The implementation documentation of [`SASInterstitialManager`](https://help-display-sdk.equativ.com/android/API/-display%20-s-d-k/com.equativ.displaysdk.ad.interstitial/-s-a-s-interstitial-manager/index.html) can be found [here](https://help-display-sdk.equativ.com/android/integration/interstitial.html.md).

##### Removed APIs

- There is no more `OnCrashListener` to set on the [`SASInterstitialManager`](https://help-display-sdk.equativ.com/android/API/-display%20-s-d-k/com.equativ.displaysdk.ad.interstitial/-s-a-s-interstitial-manager/index.html).
- `getCurrentAdElement` was removed. Use the [`SASAdInfo`](https://help-display-sdk.equativ.com/android/API/-display%20-s-d-k/com.equativ.displaysdk.model/-s-a-s-ad-info/index.html) instance returned in the [`onInterstitialAdLoaded`](https://help-display-sdk.equativ.com/android/API/-display%20-s-d-k/com.equativ.displaysdk.ad.interstitial/-s-a-s-interstitial-manager/-interstitial-manager-listener/on-interstitial-ad-loaded.html) callback instead.
- `MessageHandler` support was dropped.
- `isShowable` was removed. This information can be found by using the [`SASAdStatus`](https://help-display-sdk.equativ.com/android/API/-display%20-s-d-k/com.equativ.displaysdk.model/-s-a-s-ad-status/index.html) 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`](https://help-display-sdk.equativ.com/android/API/-display%20-s-d-k/com.equativ.displaysdk.ad.interstitial/-s-a-s-interstitial-manager/load-ad.html) method to call. All other load methods were removed.

##### Listener

The interstitial listener was renamed from `SASInterstitialManager.InterstitialListener` to [`SASInterstitialManager.InterstitialManagerListener`](https://help-display-sdk.equativ.com/android/API/-display%20-s-d-k/com.equativ.displaysdk.ad.interstitial/-s-a-s-interstitial-manager/-interstitial-manager-listener/index.html).

All callback methods of [`SASInterstitialManager.InterstitialManagerListener`](https://help-display-sdk.equativ.com/android/API/-display%20-s-d-k/com.equativ.displaysdk.ad.interstitial/-s-a-s-interstitial-manager/-interstitial-manager-listener/index.html) have changed.

[`SASInterstitialManager.InterstitialManagerListener`](https://help-display-sdk.equativ.com/android/API/-display%20-s-d-k/com.equativ.displaysdk.ad.interstitial/-s-a-s-interstitial-manager/-interstitial-manager-listener/index.html) removed callbacks:
- `onInterstitialAdVideoEvent`

[`SASInterstitialManager.InterstitialManagerListener`](https://help-display-sdk.equativ.com/android/API/-display%20-s-d-k/com.equativ.displaysdk.ad.interstitial/-s-a-s-interstitial-manager/-interstitial-manager-listener/index.html) updated callbacks:
- [`onInterstitialAdLoaded`](https://help-display-sdk.equativ.com/android/API/-display%20-s-d-k/com.equativ.displaysdk.ad.interstitial/-s-a-s-interstitial-manager/-interstitial-manager-listener/on-interstitial-ad-loaded.html) does not return the instance of [`SASInterstitialManager`](https://help-display-sdk.equativ.com/android/API/-display%20-s-d-k/com.equativ.displaysdk.ad.interstitial/-s-a-s-interstitial-manager/index.html) anymore and provides an
  instance of [`SASAdInfo`](https://help-display-sdk.equativ.com/android/API/-display%20-s-d-k/com.equativ.displaysdk.model/-s-a-s-ad-info/index.html) instead of a `SASAdElement`.
- [`onInterstitialAdFailedToLoad`](https://help-display-sdk.equativ.com/android/API/-display%20-s-d-k/com.equativ.displaysdk.ad.interstitial/-s-a-s-interstitial-manager/-interstitial-manager-listener/on-interstitial-ad-failed-to-load.html) does not return the instance of [`SASInterstitialManager`](https://help-display-sdk.equativ.com/android/API/-display%20-s-d-k/com.equativ.displaysdk.ad.interstitial/-s-a-s-interstitial-manager/index.html) anymore and always provides a [`SASException`](https://help-display-sdk.equativ.com/android/API/-display%20-s-d-k/com.equativ.displaysdk.exception/-s-a-s-exception/index.html) instance.
- [`onInterstitialAdShown`](https://help-display-sdk.equativ.com/android/API/-display%20-s-d-k/com.equativ.displaysdk.ad.interstitial/-s-a-s-interstitial-manager/-interstitial-manager-listener/on-interstitial-ad-shown.html) does not return the instance of [`SASInterstitialManager`](https://help-display-sdk.equativ.com/android/API/-display%20-s-d-k/com.equativ.displaysdk.ad.interstitial/-s-a-s-interstitial-manager/index.html) anymore.
- [`onInterstitialAdFailedToShow`](https://help-display-sdk.equativ.com/android/API/-display%20-s-d-k/com.equativ.displaysdk.ad.interstitial/-s-a-s-interstitial-manager/-interstitial-manager-listener/on-interstitial-ad-failed-to-show.html) does not give the instance of [`SASInterstitialManager`](https://help-display-sdk.equativ.com/android/API/-display%20-s-d-k/com.equativ.displaysdk.ad.interstitial/-s-a-s-interstitial-manager/index.html) anymore and always provides a [`SASException`](https://help-display-sdk.equativ.com/android/API/-display%20-s-d-k/com.equativ.displaysdk.exception/-s-a-s-exception/index.html) instance.
- `onInterstitialAdDismissed` is renamed [`onInterstitialAdClosed`](https://help-display-sdk.equativ.com/android/API/-display%20-s-d-k/com.equativ.displaysdk.ad.interstitial/-s-a-s-interstitial-manager/-interstitial-manager-listener/on-interstitial-ad-closed.html) and does not return the instance of [`SASInterstitialManager`](https://help-display-sdk.equativ.com/android/API/-display%20-s-d-k/com.equativ.displaysdk.ad.interstitial/-s-a-s-interstitial-manager/index.html) anymore.
- [`onInterstitialAdClicked`](https://help-display-sdk.equativ.com/android/API/-display%20-s-d-k/com.equativ.displaysdk.ad.interstitial/-s-a-s-interstitial-manager/-interstitial-manager-listener/on-interstitial-ad-clicked.html) does not return the instance of [`SASInterstitialManager`](https://help-display-sdk.equativ.com/android/API/-display%20-s-d-k/com.equativ.displaysdk.ad.interstitial/-s-a-s-interstitial-manager/index.html) 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](https://help-display-sdk.equativ.com/android/integration/native-ad.html.md).

### 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](https://help-display-sdk.equativ.com/mediation/primarysdk.html.md), and more particularly the [implement a custom mediation adapter article](https://help-display-sdk.equativ.com/android/custommediationadapters.html.md) 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 the `SASBiddingManager` class instead of being passed in the constructor.
- the `load()` method of the `SASBiddingManager` class in the __Smart Display SDK v7.x__ was renamed to `loadAd()` in the **Equativ Display SDK**
- the currency String property of the `SASBiddingAdPrice` class in the the __Smart Display SDK v7.x__ was replaced by a `SASBiddingAdCurrency` enum class in the **Equativ Display SDK**
- for a `SASInterstitialManager` instantiated from a `SASBiddingAdResponse`, once the `loadAd()` is called to render the bidding ad, any subsequent call to `loadAd()` will simply trigger the `onInterstitialAdLoaded()` callback method again, contrary to the __Smart Display SDK v7.x__ where an exception was thrown stating that the `SASBiddingAdResponse` had been consumed already.

For more detail, please refer to the [in-app integration guide](https://help-display-sdk.equativ.com/android/inappbidding.html.md).

### 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

- `SASRewardedVideoManager` class and its listener `SASRewardedVideoManager.RewardedVideoListener`.
- `SASReward` class.

##### 3rd party in-app bidding related APIs

- `SASBidderAdapter` interface and its implementations:
  - `SASBannerBidderAdapter` and its listener `SASBannerBidderAdapterListener`.
  - `SASInterstitialBidderAdapter` and its listener `SASInterstitialBidderAdapterListener`.
- `SASBidderAdapter.CompetitionType` and `SASBidderAdapter.RenderingType` enum classes.
