Step 1. Add the JitPack repository to your build file
Add it in your root settings.gradle at the end of repositories:
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
mavenCentral()
maven { url 'https://jitpack.io' }
}
}
Add it in your settings.gradle.kts at the end of repositories:
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
mavenCentral()
maven { url = uri("https://jitpack.io") }
}
}
Add to pom.xml
<repositories>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
</repositories>
Add it in your build.sbt at the end of resolvers:
resolvers += "jitpack" at "https://jitpack.io"
Add it in your project.clj at the end of repositories:
:repositories [["jitpack" "https://jitpack.io"]]
Step 2. Add the dependency
dependencies {
implementation 'com.github.raymondctc:mopub-android-sdk:v4.13.1'
}
dependencies {
implementation("com.github.raymondctc:mopub-android-sdk:v4.13.1")
}
<dependency>
<groupId>com.github.raymondctc</groupId>
<artifactId>mopub-android-sdk</artifactId>
<version>v4.13.1</version>
</dependency>
libraryDependencies += "com.github.raymondctc" % "mopub-android-sdk" % "v4.13.1"
:dependencies [[com.github.raymondctc/mopub-android-sdk "v4.13.1"]]
Thanks for taking a look at MoPub! We take pride in having an easy-to-use, flexible monetization solution that works across multiple platforms.
Sign up for an account at http://app.mopub.com/.
You can find integration documentation on our wiki and additional help documentation on our developer help site.
To file an issue with our team visit the MoPub Forum or email support@mopub.com.
Please Note: We no longer accept GitHub Issues.
The MoPub SDK is available via:
JCenter AAR
The MoPub SDK is available as an AAR via JCenter; to use it, add the following to your build.gradle
.
repositories {
jcenter()
}
dependencies {
compile('com.mopub:mopub-sdk:4.13.0@aar') {
transitive = true
}
}
SDK Modularization
With the modular SDK, you can choose to include specific formats to decrease overall SDK footprint in your app. To do so, include the line for any combination of components that you want in your build.gradle
file as follows:
repositories {
// ... other project repositories
jcenter()
}
// ...
dependencies {
// ... other project dependencies
// For banners
compile('com.mopub:mopub-sdk-banner:4.13.0@aar') {
transitive = true
}
// For interstitials
compile('com.mopub:mopub-sdk-interstitial:4.13.0@aar') {
transitive = true
}
// For rewarded videos. This will automatically also include interstitials
compile('com.mopub:mopub-sdk-rewardedvideo:4.13.0@aar') {
transitive = true
}
// For native static (images).
compile('com.mopub:mopub-sdk-native-static:4.13.0@aar') {
transitive = true
}
// For native video. This will automatically also include native static
compile('com.mopub:mopub-sdk-native-video:4.13.0@aar') {
transitive = true
}
}
To continue integration using the mopub-sdk AAR, please see the Getting Started guide.
Zipped Source
The MoPub SDK is also distributed as zipped source code that you can include in your application. MoPub provides two prepackaged archives of source code:
MoPub Android SDK.zip
Includes everything you need to serve MoPub ads. No third party ad networks are included.
For additional integration instructions, please see the Getting Started guide.
Cloned GitHub repository
Alternatively, you can obtain the MoPub SDK source by cloning the git repository:
git clone git://github.com/mopub/mopub-android-sdk.git
For additional integration instructions, please see the Getting Started guide.
Please view the changelog for a complete list of additions, fixes, and enhancements in the latest release.
GooglePlayServicesAdRenderer
and GooglePlayServicesNative
GooglePlayServicesRewardedVideo
In 3.3.0 a dependency on android-support-annotations.jar was added. If you are using Maven or Gradle to include the MoPub SDK, this dependency is included in the build scripts. For instructions on adding dependencies for Eclipse projects, see our Getting Started Guide
Version 4.4.0 of the MoPub SDK fixes a security issue identified by Google. Note that only publishers who received a message from Google are affected. While not all publishers are impacted, we recommend you upgrade to SDK 4.4.0+ ahead of Google's deadline (July 11, 2016) to avoid any issues submitting updates to your apps after the date. More information can be found in Google's support article.
If your app's target SDK is 23 or higher and the user's device is running Android 6.0 or higher, you are responsible for supporting runtime permissions, one of the changes introduced in Android 6.0 (API level 23). In addition to listing any dangerous permissions your app needs in the manifest, your app also has to explicitly request the dangerous permission(s) during runtime by calling method requestPermissions()
in the ActivityCompat
class.
ACCESS_COARSE_LOCATION
is needed to pass network location data to MoPub.ACCESS_FINE_LOCATION
is needed to pass GPS location data to MoPub.
ACCESS_FINE_LOCATION
also allows network location data to be passed to MoPub without the need to also grant ACCESS_COARSE_LOCATION
.WRITE_EXTERNAL_STORAGE
is needed for MRAID 2.We have launched a new license as of version 3.2.0. To view the full license, visit http://www.mopub.com/legal/sdk-license-agreement/.