AdIQuity Android SDK User Manual for Integration
Android Apps Integration Guide ver. 2.2
:: Table of Contents ::Document Revision
What’s new in Adiquity Android SDK v2.2?
How to Integrate the AdIQuity Ad SDK into your application?
What does package folder contains?
How to add the library to your project
- Add AdIQuityAndroidSDK.jar to your application’s buildpath
- Add permissions to your application in AndroidManifest.xml
- Add a custom view called BannerView to your layout XML
- Initialize the adView
- Initialize with the SiteId, AdSlotUnit
- Request test ads in test mode during development
- Set the refresh time as needed
- Setup any optional parameters
- Start the Ads using
- Initialize the Interstitial adView
- Initialize with the SiteId, AdSlotUnit
- Set UserProfile
- Start Ads
- Set Auto Interstitial Close Button
- Show Interstitial View For Ads
Run the Example Application App with Ads
Run the Example Application App with Interstitial Ads
Document Revision
| Date | Version | ChangeLog |
| 20/04/2011 | 1.0 | Initial Version |
| 19/12/2011 | 1.5 | Fixes for white space issues When Empty ad is received. |
| 25/01/2012 | 1.6 | 1) Fixes for multiple unhandled exceptions. 2)Hashed hardware ids sent from the device |
| 08/02/2012 | 1.7 | Fixes Illegal Argument Exception in DeviceUuidFactory |
| 17/04/2012 | 1.8 | BugFix for a isolated crash issue. |
| 27/06/2012 | 2.0 | Android SDK for Rich Media Ads |
| 17/08/2012 | 2.1 | 1) Additional data sent from device to enable better targeting. 2) Test app. fixed to resolve bugs. |
| 20/02/2013 | 2.2 | Bug Fix for Interstitial Screen View with Close Button. |
What’s new in AdIQuity Android SDK v2.2?
You’ve just downloaded the 2.2 version of AdIQuity’s Android SDK. Congratulations! We’ve improved a number of aspects of the SDK and rewritten larger portions of the code and improved the API. We’ve improved the user experience through opening links in an internal WebView and fully supporting the MRAID and ORMMA rich media standard.How to Integrate the AdIQuity Ad SDK into your application?
In order to integrate the AdIQuity Ad SDK for Android into your application, your application must be built using the Android SDK 1.6 or above. AdIQuityBanner is a custom 320x50 view class that handles the ad request and response from server in the background thread and then present the banner based on your app’s look and feel.What does package folder contains?
The uncompressed package should contain 2 items :- AdiquityAndroidSDK.jar - File – The Jar that has to added to your application
- AdIquityAdsExample - Project Folder - A sample app illustrating the integration.
How to add the library to your project?
Add AdIQuityAndroidSDK.jar to your application’s buildpath- Import the AdIQuityAdsExample project folder to Eclipse
- Select the project, and choose Properties from the right click menu.
- Select Java Build Path.
- Click Add External Jars, and navigate to the location of AdIQuityAndroidSDK.jar.
- Activate hardware acceleration for targets > Android 3.0
If you plan to support targets with Android versions above 3.0 you have to activate hardware acceleration in your AndroidManifest.xml
Note: Please check the Java Compiler/Compiler compliance level compatibility with JRE environment.
Add permissions to your application in AndroidManifest.xml
• INTERNET (mandatory)
• READ_PHONE_STATE (strongly recommended)
• ACCESS_NETWORK_STATE (strongly recommended)
• ACCESS_COARSE_LOCATION (recommended)
• ACCESS_FINE_LOCATION (optional)
For Example:
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission
android:name="android.permission.READ_PHONE_STATE " />
<uses-permission
android:name="android.permission.ACCESS_NETWORK_STATE " />
<uses-permission
android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission
android:name="android.permission.ACCESS_FINE_LOCATION" />
How to add banner view to your application?
Add a custom view called BannerView to your layout XMLFor Example:
<com.adiquity.android.AdIquityAdView
android:id="@+id/adview"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
How to Initialize Parameters for getting Ads?
Instantiate mAdView for Banner Ads / Rich Media AdView(AdIquityAdView) findViewById(R.id.adview);
For Example:
mAdView = (AdIquityAdView) findViewById(R.id.adview);Call the init function to set the Ad parameters(Params: pazid/siteid, banner slots)
init(SiteId, Activity, AdSlotUnit);
For Example:
mAdView.init("xxxxxxx-xxxxxxx-xxxxxx", this,AdIquityAdView.ADIQUITY_AD_UNIT_300_50);
SiteId : Your Application siteId as given by Adiquity.Activity: Instance of Android Activity Class.
AdSlotUnit : Appropriate adslot unit as required . Currently supported ones are:
ADIQUITY_AD_UNIT_300_50 for a 300x50 Banner
ADIQUITY_AD_UNIT_320_48 for a 320x48 Banner
To request an Ad in test mode (For testing/development purpose)setTestMode();
For Example:
mAdView.setTestMode();To get Ads only once set Refresh Time < 0 - Default : 30secs
By default refresh time is set to 15 secs. If a negative value is supplied it implies no auto refreshing.
setRefreshTime(RefreshTimeInSecs);
For Example:
mAdView.setRefreshTime(40);Setup any optional parameters
a) To Set UserProfile implement interface AdIquityUserProfile to pass any user profile information and set it in AdIquityAdView with:
setUserProfile(new AdiquitySampleAppUserProfile());
For Example:
mAdView.setUserProfile(new AdiquitySampleAppUserProfile());b) To Receive call back event on error and on success Ad retrieval, implement interface AdIquityAdListner to receive notifications:
setAdListener(new AdiquitySampleAppAdListner());
For Example:
mAdView.setAdListener(new AdiquitySampleAppAdListner());
Start the Ads using
startAds();
For Example:
mAdView.startAds();
How to use Interstitial Ad View?
Instantiate mAdViewInt for Interstitial /Full screen Banner/ Rich Media AdView(AdIquityAdView) findViewById(R.id.adview);
For Example:
mAdViewInt = (AdIquityAdView) findViewById(R.id.adview2);Call the init function to set the Ad parameters(Params:pazid/siteid, banner slots)
init(SiteId, Activity, AdSlotUnit);
For Example:
mAdViewInt.init("xxxxxxx-xxxxxxx-xxxxx", AdiquitySampleApp.this,AdIquityAdView.ADIQUITY_AD_UNIT_300_50);
SiteId : Your Application siteId as given by Adiquity.
Activity: Instance of Android Activity Class.
AdSlotUnit : Appropriate adslot unit as required . Currently supported ones are:
ADIQUITY_AD_UNIT_300_50 for a 300x50 BannerSetup any optional parameters
a) To Set UserProfile implement interface AdIquityUserProfile to pass any user profile information and set it in AdIquityAdView with:
setUserProfile(new AdiquitySampleAppUserProfile());
For Example:
mAdViewInt.setUserProfile(new AdiquitySampleAppUserProfile());b) To Receive call back event on error and on success Ad retrieval, implement interface AdIquityAdListner to receive notifications:
setAdListener(new AdiquitySampleAppAdListner());
For Example:
mAdViewInt.setAdListener(new AdiquitySampleAppAdListner());
To Start Ads
startAds();
For Example:
mAdViewInt.startAds();
Set Auto Interstitial close button with time given in seconds
setAutoCloseInterstitialTime(15);
For Example:
mAdViewInt.setAutoCloseInterstitialTime(15);To Set Interstitial View for Ads (Pre App or Post App/Fullscreen Ads/Banner Ads)
show();
For Example:
mAdViewInt.show();Additionally you could implement the optional delegates to get notified when an AD is successfully received, failed
The following are the delegates available for AdView
public void adRequestCompleted(AdIquityAdView arg0) {
Log.d("AdiquitySampleApp", "adRequestCompleted");
}
public void adRequestFailed(AdIquityAdView arg0) {
Log.d("AdiquitySampleApp", "adRequestFailed");
}
public void adRequestCompletedNoAd(AdIquityAdView arg0) {
Log.d("AdiquitySampleApp", "adRequestCompletedNoAd");
}
public void onInterstitialClosed(AdIquityAdView arg0) {
Log.d("AdiquitySampleApp", "adInterstialViewClosed");
}
Run the Example Application App with Ads
Run the Example Application App with Interstitial/FullScreen BannerAds/Rich Media Ads
200pxIMPORTANT: Please ensure that you implement onResume, onPause and onStop functions appropriately when the current activity or the process switches between foreground and background.
No comments:
Post a Comment