Migration guide

This page will walk through the migration process from a SDK version to another, starting from the version 7.0.0.

We advise your to update your SDK version regulary to avoid having to much work to do during migration and to have access to new features and bug fixes.

  1. Migration from 7.17 and below to 7.17.1
    1. Location detection default setting
  2. Migration from 7.10 or 7.12 to 7.14.0
    1. Huawei Advertising Id support
  3. Migration from 7.8 to 7.10.0
    1. API Annotation
  4. Migration from 7.6 to 7.8.0
    1. Migration to AndroidX
  5. Migration from 7.4 to 7.6.0
    1. Base url automatic setting
    2. Huawei devices compatibility
  6. Migration from 7.0 to 7.1.0
    1. New dependencies
    2. setPreDrawListenerEnabled() method removal
  7. Migration guide to version 7.0.0
    1. Installation
    2. Configuration
    3. Placement object
    4. User location
    5. Banner integration
    6. Interstitial integration
    7. Rewarded Video integration
    8. Native Ad integration

Migration from 7.17 and below to 7.17.1

Location detection default setting

The automatic location detection (provided that the application already got it, with adequate permissions) is not done by default anymore in the Smart Display SDK, for data privacy and consent reasons.
The application is now responsible for getting the User consent to use his location for advertising purpose, and in this condition only, activate the automatic location retrieval in the Smart Display SDK.
See Getting Started page for more information.

Migration from 7.10 and 7.12 to 7.14.0

Huawei Advertising Id support

The support of Huawei Advertising Id (for Huawei devices) is not included by default in the Smart Display SDK anymore.
If you want to enable Advertising Id retrieval on such devices (which do not feature Google Avertising Id), you must explicitly declare the Huawei artifact repository and add the Smart Huawei support library dependency in your application's build.gradle file.
See Getting Started page for more information.

Migration from 7.8 to 7.10.0

API Annotation

A lot of APIs have been annotated with @NonNull and @Nullable annotations, both methods and interfaces.

It will only create warnings in case of JAVA application. But if you are using Kotlin, you will need to do some code adjustements as it will lead to warnings blocking the compilation.

Migration from 7.6 to 7.8.0

Migration to AndroidX

The Smart Display SDK is now compiled using AndroidX libraries, meaning they are needed at runtime and will be imported as transitive Gradle dependencies at building time.

It is mandatory from now on that any application importing the Smart Display SDK be migrated to AndroidX (you will experience conflicts when building you application if you do not, or worse, crashes at runtime).

If you need assistance to migrate your application, here is the official Android migration guide.

Migration from 7.4 to 7.6.0

Base url automatic setting

The configure(Context, int, String) method is deprecated because the SDK can now automatically fetch the appropriate base URL (from the site ID parameter).

For most applications, you should use the configure(Context, int) method instead.

Huawei devices compatibility

Now that Huawei devices are not able anymore to use the Google APIs, you will have to add the Huawei APIs dependencies if you still want to be fully compatible with all Huawei devices. You will find more information about this in the Getting Started page.

Migration from 7.0 to 7.1.0

New dependencies

There are two new mandatory dependencies required to integrate the SDK 7.1.0:

  • Smart Core SDK
  • ExoPlayer

For more info on how to add these dependencies, check the Getting Started section.

setPreDrawListenerEnabled() method removal

The setPreDrawListenerEnabled method which was previously public and used in the sample application is now private. The purpose of this method is now performed internally.

Migration guide to version 7.0.0

Installation

The recommended way to integrate the Smart Display SDK is to use Gradle dependencies. It now requires some third-party libraries, please refer to the installation section of the getting started chapter.

Configuration

The Smart Display SDK needs to be configured with your own site ID and base URL before making any ad calls. You will have to call the method configure() of the SASConfiguration shared instance to do so.

This method must be called at least once, as soon as possible.
Ideally call it in the onCreate() method of your Application class. For instance:


public class MyApplication extends MultiDexApplication {
  @Override
  public void onCreate() {
    super.onCreate();

    // 123456 is used as an example, be sure to use your own siteID
    SASConfiguration.getSharedInstance().configure(this, 123456);
  }

class MyApplication : MultiDexApplication() {
  @Override
  public void onCreate() {
    super.onCreate()

    // 123456 is used as an example, be sure to use your own siteID
    SASConfiguration.getSharedInstance().configure(this, 123456)
  }

Any subsequent valid call to the configure() method will update the current configuration with the newly supplied parameters.

Placement object

In previous versions of the Smart Display SDK, the loadAd methods on banner and interstitial views required many parameters such as siteId, pageId, formatId, targeting string.
As of 7.0.0 version, all those parameters are now part of the SASAdPlacement class, and the loadAd methods now take an instance of this class instead.


// Create a placement object
SASAdPlacement adPlacement = new SASAdPlacement(SOME_SITE_ID, SOME_PAGE_ID, SOME_FORMAT_ID, SOME_KEYWORD_TARGETING);
// load an ad for the ad view
adView.loadAd(adPlacement);

val adPlacement = SASAdPlacement(SOME_SITE_ID, SOME_PAGE_ID, SOME_FORMAT_ID, SOME_KEYWORD_TARGETING)

Please refer to the 'Creating a placement' section of the integration guides to get further details.

User location

In previous versions of the Smart Display SDK, you could set a user location per SASAdView instance or SASNativeAdManager instance (for native ads) using the setLocation() method.

As of 7.0.0 version, you can no longer set a user location per ad view of native ad manager. Instead, you can set an overall 'forced location' using the setForcedLocation() method on the SASConfiguration shared instance.
Set the forced location to null if you want to clear it and let the SDK automatically use the location available to the application.

Banner integration

In previous versions of the Smart Display SDK, you would use objects implementing several separate interfaces to monitor ad call outcomes and SASBannerView events

  • the SASAdView.AdResponseHandler interface, passed to the loadAd() method, to handle the ad call success or failure
  • the SASAdView.OnStateChangeListener, SASAdView.OnVideoEventListener, SASAdView.OnEndCardDisplayedListener,SASAdView.OnRewardListener interfaces to monitor various events occurring during the SASBannerView lifecycle.

As of 7.0.0 version, all relevant events will trigger methods of the new SASBannerView.BannerListener interface

Please refer to the listener section of the banner integration guide to get further details on this listener interface

Interstitial integration

In previous versions of the Smart Display SDK, you would use directly an instance of the SASInterstitialView class, and calling its loadAd method would load and show the interstitial ad straight away as it was successfully loaded.

As of 7.0.0 version, the SASInterstitialManager class was introduced to encapsulate the former SASInterstitialView Object that needs not be exposed to the user (it is an Android View but was not intended to be manipulated as a view).

Instead of having to pass the SASAdplacement object as a parameter in every loadAd() method call, the SASInterstitialManager is now directly instantiated with an SASAdPlacement object.

Plus, the loadAd() method does not trigger the display anymore.You control when to display the interstitial ad by calling the show() method of the SASInterstitialManager.
Please refer to the loading section and the showing section to get further details on how to load and show interstitial ads.

In previous versions of the Smart Display SDK, you would use objects implementing several separate interfaces to monitor ad call outcomes and SASinterstitialView events

  • the SASAdView.AdResponseHandler interface, passed to the loadAd() method, to handle the ad call success or failure
  • the SASAdView.OnStateChangeListener, SASAdView.OnVideoEventListener, SASAdView.OnEndCardDisplayedListener,SASAdView.OnRewardListener interfaces to monitor various events occurring during the SASinterstitialView lifecycle.

As of 7.0.0 version, all relevant events will trigger methods of the new SASInterstitialManager.InterstitialListener interface

Please refer to the loading section of the interstitial integration guide to get further details on this listener interface

Rewarded Video integration

In previous versions of the Smart Display SDK, rewarded video ads were managed by the singleton SASRewardedVideoManager class, that would load and show several rewarded videos on different SASRewardedVideoPlacement objects separately.
It would also trigger methods of a unique SASRewardedVideoListener listener instance for all placements (with a SASRewardedVideoPlacement as parameter).

As of 7.0.0 version, the SASRewardedVideoManager class is not a singleton anymore, and one instance should be created per SASAdPlacement placement object. It behaves quite similarly to the SASInterstitialManager class described above.

All methods that were part of the SASRewardedVideoListener interface were moved to the new SASRewardedVideoManager.RewardedVideoListener interface

Please refer to the loading section of the rewarded video integration guide to get further details on this listener interface

Native Ad integration

In previous versions of the Smart Display SDK, The SASNativeAdManager instances were initialized with a SASNativeAdPlacement.

As of 7.0.0 version, the SASNativeAdPlacement class was removed and the SASNativeAdManager is now initialized using a SASAdPlacement placement object.

Also, to ensure API consistency with other formats, the SASNativeAdManager.NativeAdResponseHandler interface used to handle the native ad call outcome (passed in the former requestNativeAd() call) was replaced by the SASNativeAdManagerListener interface.

Please refer to the loading section of the native ads integration guide to get further details on this listener interface