Facebook Aggregation Guide - uc-union/union-ads-sdk-demo GitHub Wiki
For more details please go to Facebook website
Add repositories
info to build.gradle
repositories {
mavenCentral()
}
Add dependencies
Dependency
dependencies {
'com.facebook.android:audience-network-sdk:4.+'
}
For more details: build.gradle & app/build.gradle
Add the following contents to AndroidManifest.xml
<application android:label="@string/app_name">
...
<activity android:name="com.facebook.ads.InterstitialAdActivity"
android:configChanges="keyboardHidden|orientation|screenSize" />
</application>
For more details: AndroidManifest.xml
Note: If you use Android Studio,you can skip this section.
Download the corresponding SDK from official Facebook site Download Page
Note:New Facebook SDK uses aar format
Decompress AudienceNetwork.aar
locally,you'll get the following directory structure.
AudienceNetwork.aar
|--(Directories)
|--AndroidManifest.xml
|--proguard.txt
|--classes.jar
Follow the steps below,
-
Rename
classes.jar
and put it in thelibs
directory -
Merge the content of
proguard.txt
intoproguard.pro
of the developer's project. -
Add the following content to
AndroidManifest.xml
<!-- Include required permissions --> <uses-permission android:name="android.permission.INTERNET"/> <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/> <application android:label="@string/app_name"> ... <activity android:name="com.facebook.ads.InterstitialAdActivity" android:configChanges="keyboardHidden|orientation|screenSize" /> </application>