Add an ad client dependency (Android v3)
Enable Google IMA, Google DAI, and FreeWheel ad requests in your app
If you are not using FreeWheel Ad Manager, Google DAI, or Google IMA to serve your ads, skip to Schedule VAST ads.
The JWP SDK for Android integrates several ad client SDKs that you can use to request ads:
- FreeWheel Ad Manager
- Google DAI
- Google IMA
Requirements
Ad client | Requirements |
---|---|
FreeWheel Ad Manager | β’ All the JWP Android SDK requirements β’ FreeWheel Ad Manager SDK for Android |
Google DAI | β’ All the JWP Android SDK requirements β’ Google's Ad Manager 360 Advanced |
Google IMA | β’ All the JWP Android SDK requirements |
Gradle
- 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 client | JWP dependency |
---|---|
FreeWheel Ad Manager Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β | com.longtailvideo.jwplayer:jwplayer-freewheel:x.x.x |
Google DAI / IMA | com.longtailvideo.jwplayer:jwplayer-ima:x.x.x |
- (FreeWheel only) Add FreeWheel's Ad Manager dependency.
- 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
- With your app open in Android Studio, click File > New > New Module... > Import .JAR / .AAR Package.
- Click Next.
- 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 JWP 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 client | Dependency file |
---|---|
FreeWheel Ad Manager | jwplayer-freewheel-x.x.x.aar FWAdManager.aar |
Google DAI / IMA | jwplayer-ima-x.x.x.aar |
- Click Finish.
- Repeat steps 1-4 for each dependency file that needs to be added.
- Click File > Project Structure... > Dependencies. Under Modules, be sure that your app is selected.
- Click the plus sign in the main panel.
- Select Module dependency.
- Select the checkbox next to the name of each dependency that needs to be added.
- Click OK.
- Click Apply.
- Click OK.
Updated over 2 years ago