Add an ad client dependency

Enable Google IMA, Google DAI, and FreeWheel ad requests in your app


👍

IMPORTANT

If you are not using FreeWheel Ad Manager, Google DAI, or Google IMA to serve your ads, skip to Schedule VAST ads.


The JW Player SDK for Android integrates several ad client SDKs that you can use to request ads:

  • FreeWheel Ad Manager
  • Google DAI
  • Google IMA

Requirements



Gradle

  1. In the build.gradle file of your app, add the dependency from the following table. Be sure to replace x.x.x with the dependency version number.
Ad clientJW Player dependency
FreeWheel Ad Manager
                                        
com.longtailvideo.jwplayer:jwplayer-freewheel:x.x.x
Google DAI / IMAcom.longtailvideo.jwplayer:jwplayer-ima:x.x.x
  1. (FreeWheel only) Add FreeWheel's Ad Manager dependency.
  2. Sync Gradle.

dependencies {
  ...
  implementation 'com.longtailvideo.jwplayer:jwplayer-core:x.x.x'
  implementation 'com.longtailvideo.jwplayer:jwplayer-common:x.x.x'
  implementation '{jw_player_dependency}'
  implementation '{freewheel_admanager_dependency}'
}


Local

  1. With your app open in Android Studio, click File > New > New Module... > Import .JAR / .AAR Package.
  2. Click Next.
  3. Select the .aar file from your computer. The list of required .aar files are listed in the table below.

    • If you do not have a jwplayer-[dependency]-x.x.x.aar file on your computer, you can download the Android SDK .zip from your JW Player dashboard.
    • If you do not have the FWAdManager.aar on your computer, you can download this file from FreeWheel or contact your FreeWheel representative.
Ad clientDependency file
FreeWheel Ad Managerjwplayer-freewheel-x.x.x.aar
FWAdManager.aar
Google DAI / IMAjwplayer-ima-x.x.x.aar
  1. Click Finish.
  2. Repeat steps 1-4 for each dependency file that needs to be added.
  3. Click File > Project Structure... > Dependencies. Under Modules, be sure that your app is selected.
  4. Click the plus sign in the main panel.
  5. Select Module dependency.
  6. Select the checkbox next to the name of each dependency that needs to be added.
  7. Click OK.
  8. Click Apply.
  9. Click OK.


Next step

Now that you have added an ad client dependency, you can now schedule ad for any of the following ad clients:

Did this page help you?