Overview
About Interstitial Ads:
Interstitial ads are full screen ads that cover the interface of their host app. They are generally displayed at usual transformation points in the flow of an app, such as among activities or during the pause between levels in a game. When an app displays an interstitial, the user has the option to either tap on the ad and continue to its destination, or close it and come back to the app. The immediate call to action and more substantial size combine to make interstitials a particularly effective form of mobile advertisement.
About Banner Ads:
Mobile phones have limited screen size, so mindful planning for your advertisement
positioning is primarily essential. Close nearness of banner ads to other components within an app is one of the biggest reasons of random clicks. To avoid such unintentional clicks, banner ads should not be placed next to interactive buttons, such as a "next" button or a custom app menu bar, next to interactive content like a text chat box or an image in an image gallery, or on a game play screen where users are regularly connecting with the app.About Offer-Wall Ads:
Offer walls effectively create a win-win promotion scenario for users because they can either select to invest money or time digesting you promotion and be rewarded for it, or simply neglect your ad and continue with their experience. Offer walls are mainly effective and convenient because the advertising comes perfect to the user, typically in the form of a landing page, and they don’t have to go out of their way to click a banner or separate advertisement.
ADAttract Account & ID
Register for an ADAttract affiliate Account
You must first create an account with ADAttract to be able to use this ad unit features. If you do not have an ADAttract account, copy the following URL to the browser: http://www.adattract.com and sign up.
Unique affiliate ID
Unique affiliate ID is useful for tracking of each app installed by your users. Unique affiliate id can be found in your account at: My account > Account details > under company details > affiliate ID.
Get a Unique API V3 Key
Unique API V3 is useful to get data from your account for advertising in your Android application. Unique API V3 can be found in your account at: Tools > APIs > API V3 > Request API key. You will be provided by API V3 key which will be useful in SDK.
INDEX
1.0 SDK Integration into the Editor
1.1 For Android Studio
1.2 For Eclipse
2.0 Integration of the Interstitial Ads
2.1 Specify the Affiliate ID and API V3 key into your respected Activity
2.2 Import the required package in the Activity
.2.3 Load Ads in the Main Activity class
2.4 Displaying Interstitial Ads
2.5 The Result
3.0 Integration of the Offer-Wall Ads
3.1 Specify the Affiliate ID and API V3 key into your respected Activity
3.2 Import the required package in the Activity.
3.3 Load Ads in the Main Activity class
3.4 Displaying Offer-Wall Ads
3.5 The Result
4.0 Integration of the Banner Ads
4.1 Specify the Affiliate ID and API V3 key into your respected Activity
4.2 Give your Refresh Rate for Banner ads.
4.3 Add custom layout in the activity_main.xml file at the proper position.
4.4. The Result
1.0 SDK Integration into the Editor
1.1 For Android Studio
1.1.1 Create the New Project and do the Compile + Run Process.
1.1.2
Your Project directory > Create the ‘libs’ folder
1.1.2 - Download our SDK, which will be in .jar format.
- Paste that jar file into ‘libs’ folder.
1.1.3 - Open the app/build.gradle file and
look for dependencies section
near the bottom.
build.gradle (excerpt)
…
dependencies
{
compile fileTree(dir: 'libs', include: ['*.jar'])
compile
'libs/com.android.support:appcompat-v7:22.2.1
}
…
1.1.4 Finally Sync Project with ‘Gradle’ Files.
- Now, Gradle will refresh your project's libraries to include the dependency you just added. Once your build.gradle file is modified and everything has synced, try rebuilding your project (Run 'app' in the Run menu) to make sure it compiles correctly.
1.2 For Eclipse
1.2.1 Download our SDK.
1.2.2 Project Directory > libs > Paste the SDK(jar file)
2.0 Integration of the Interstitial Ads
2.1 Specify the Affiliate-ID and API V3 key into your respected Activity.
Utils.API_KEY = "PLACE_YOUR_API_V3_KEY"; Utils.AFFILIATE_ID = "PLACE_YOUR_AFFILIATE_ID";
2.2 Import the required package in the Activity.
import com.adattract.sdk.ADInterstitial;
2.3 Load Ads in the Main Activity class
ADInterstitial.loadInterstitialAd();
2.4 Displaying Interstitial Ads
2.4.1. Showing the Interstitial Ad on clicking particular object.
2.4.2. Showing the InterstitialAd automatically on start activity
-
Creation of the
ADInterstitial
Object
.
ADInterstitial interstitialView = new ADInterstitial(MainActivity.this);
-
Overriding the
onInterstitialLoaded
Method of
InterstitialAdListener.
interstitialView
.setLoadInterstitialAdListener(new onLoadInterstitialAd(){
@Override
public void onInterstitialLoaded() {
// TODO Auto-generated method stub
ADInterstitial.showInterstitialAd(); }
});
2.5 The Result
3.0 Integration of the Offer-Wall Ads
3.1 Specify the Affiliate ID and API V3 key into your Activity.
Utils.API_KEY = "Place your API V3 key";
Utils.AFFILIATE_ID = "Place your Affiliate ID ";
3.2 Import the required package in the Activity.
import com.adattract.sdk.ADOfferWall;
3.3 Load Ads in the Main Activity class
3.4 Displaying Offer-Wall Ads
3.4.1. Showing the InterstitialAd on clicking particular object.
ADInterstitial.showOfferWallAd();
3.4.2. Showing the OfferWall Ads automatically on start activity
-
Creation of the
ADOfferWall
Object
.
ADOfferWall offerwallView = new ADOfferWall(MainActivity.this);
-
Overriding the
onOfferWallLoaded
Method of
OfferWallAdListener.
@Override
public void onOfferWallLoaded() {
// TODO Auto-generated method stub
ADOfferWall.showOfferWall(); }
});
3.5 The Result
4.0 Integration of the Banner Ads
4.1 Specify the Affiliate ID and API V3 key into your Activity.
Utils.API_KEY = "Place your API V3 key";
Utils.AFFILIATE_ID = "Place your Affiliate ID ";
4.2 Give your Refresh Rate for the Banner ads.
-Place below code in respected activity to set the refresh rate.
Utils.REFRESH_RATE = 15000; // IN_MILI_SECOND
Note: Default value is 1 sec.
4.3 Add below custom layout in your ‘activity_main.xml’ file as per
your required position.
. . .
<com.adattract.sdk.ADBannerView
android:layout_width="match_parent" android:layout_height="wrap_content" />