×
Namespaces

Variants
Actions
(Difference between revisions)

Integrating Vserv Ads in Nokia X

From Nokia Developer Wiki
Jump to: navigation, search
pardeepsharma10 (Talk | contribs)
(Pardeepsharma10 -)
pardeepsharma10 (Talk | contribs)
(Pardeepsharma10 -)
Line 51: Line 51:
  
 
<metadata
 
<metadata
android:name="com.google.android.gms.version"
+
android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version" />
android:value="@integer/google_play_services_version" />
+
  
  
 +
===Provide Internet Access Permission===
 +
Your App will need internet to fetch Ads from Vserv Ad Network. So, you have to enable Internet access permission which can be done by following code in the AndroidManifest.xml File. add it outside application tag.
  
 +
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
 +
 +
===Request Vserv Ads===
 +
Only thing now left to request Ads from Vserv Ad Network.The Vserv.mobi SDK provides you with various mechanisms to request for Ads in your Android application.
 +
 +
====Managed  Ads using displayAd()====
 +
First create object of VservManager(mobi.vserv.android.ads) and initialize it. Now request ads using displayAd() of VservManager Object.
 +
 +
VservManager manager = VservManager.getInstance(context);
 +
manager.setShowAt(AdPosition.IN);
 +
manager.displayAd(YOUR_ZONE_ID);
 +
YOUR_ZONE_ID is Zone is you received in the Welcome Email.
 +
 +
====Managed Overlay Ads using displayAd()====
 +
The DisplayAd() method by default displays an interstitial but can be used to display an Overlay ad for a more native experience. To request an Overlay ad you need to pass the AdType to the Overloaded displayAd()
 +
method.
 +
 +
VservManager manager = VservManager.getInstance(context);
 +
manager.setShowAt(AdPosition.IN);
 +
manager.displayAd(YOUR_ZONE_ID, AdType.OVERLAY);
 +
 +
You can pass either AdType.OVERLAY & AdType.INTERSTITIAL to displayAd().
 +
 +
====Requesting for a particular orientation in displayAd()====
 +
You can request for an interstitial in a particular orientation by  passing an AdOrientation parameter to displayAd() as shown.
 +
 +
VservManager manager = VservManager.getInstance(context);
 +
manager.setShowAt(AdPosition.IN);
 +
manager.displayAd(YOUR_ZONE_ID, AdOrientation.LANDSCAPE);
 +
 +
Ad orientation will either be AdOrientation.LANDSCAPE or AdOrientation.PORTRAIT
 
== Summary ==
 
== Summary ==
  

Revision as of 16:34, 13 April 2014

This article explain explain step by step integration of Vserv Ads into NOKIA X App using Vserv Android SDK

Note.pngNote: This is an entry in the Nokia X Wiki Challenge 2014Q1

Article Metadata
Tested with
Devices(s): NOKIA X Emulator
Platform Security
Capabilities: ACCESS_NETWORK_STATE
Article
Created: pardeepsharma10 (15 Apr 2014)
Last edited: pardeepsharma10 (13 Apr 2014)

Contents

Introduction

Vserv Ad Network provide Advertisement support to almost all the Mobile Platform including 'NOKIA X'-the newest addition to the NOKIA family.integration can be performed using Vserv Android SDK. this can be performed in number of steps described below.


Implementation

Register as Developer

First thing needed is a Developer Account.If you don't have one, register on the 'http://www.vserv.mobi' as Developer, your Default Zone ID would be sent to you in your welcome Email. I will use Default Zone ID in the sample, but you can create as many Zone ID as you want on Vserv Dashboard having different Categories. IF you already have Developer account and Default Zone ID skip this Step.


Download Vserv Android SDK

Next step would be to Download Vserv Android SDK, you can download it here[[1]]. Unzip the Downloaded File. there would be a Folder named as AndroidV2SDKLibrary/ which contain Vserv Android SDK.

Integrate Vserv Android SDK Library

Now import Vserv Android SDK library in the Project. Next step would be add library into the Project. Go to Project->Property->Android and select the Library and ad it into the Project.

Updating your project.properties

Next step would be to update project.properties file. add below code in the File


                   manifestmerger.enabled=true


Update Vserv Library AndroidManifest =

Now update the AndroidManifest.xml File in the Vserv Library. Delete the following code from the File

<metadata

android:name="com.google.android.gms.version"  android:value="@integer/google_play_services_version" />


Provide Internet Access Permission

Your App will need internet to fetch Ads from Vserv Ad Network. So, you have to enable Internet access permission which can be done by following code in the AndroidManifest.xml File. add it outside application tag.

<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />

Request Vserv Ads

Only thing now left to request Ads from Vserv Ad Network.The Vserv.mobi SDK provides you with various mechanisms to request for Ads in your Android application.

Managed Ads using displayAd()

First create object of VservManager(mobi.vserv.android.ads) and initialize it. Now request ads using displayAd() of VservManager Object.

VservManager manager = VservManager.getInstance(context);
manager.setShowAt(AdPosition.IN);
manager.displayAd(YOUR_ZONE_ID);

YOUR_ZONE_ID is Zone is you received in the Welcome Email.

Managed Overlay Ads using displayAd()

The DisplayAd() method by default displays an interstitial but can be used to display an Overlay ad for a more native experience. To request an Overlay ad you need to pass the AdType to the Overloaded displayAd() method.

VservManager manager = VservManager.getInstance(context); manager.setShowAt(AdPosition.IN); manager.displayAd(YOUR_ZONE_ID, AdType.OVERLAY);

You can pass either AdType.OVERLAY & AdType.INTERSTITIAL to displayAd().

Requesting for a particular orientation in displayAd()

You can request for an interstitial in a particular orientation by passing an AdOrientation parameter to displayAd() as shown.

VservManager manager = VservManager.getInstance(context); manager.setShowAt(AdPosition.IN); manager.displayAd(YOUR_ZONE_ID, AdOrientation.LANDSCAPE);

Ad orientation will either be AdOrientation.LANDSCAPE or AdOrientation.PORTRAIT

Summary

Remove Category:Draft when the page is complete or near complete


The "platform categories" will be displayed here in preview only - Copy paste relevant categories into text here

Version Hint

Windows Phone: [[Category:Windows Phone]]
[[Category:Windows Phone 7.5]]
[[Category:Windows Phone 8]]

Nokia Asha: [[Category:Nokia Asha]]
[[Category:Nokia Asha Platform 1.0]]

Series 40: [[Category:Series 40]]
[[Category:Series 40 1st Edition]] [[Category:Series 40 2nd Edition]]
[[Category:Series 40 3rd Edition (initial release)]] [[Category:Series 40 3rd Edition FP1]] [[Category:Series 40 3rd Edition FP2]]
[[Category:Series 40 5th Edition (initial release)]] [[Category:Series 40 5th Edition FP1]]
[[Category:Series 40 6th Edition (initial release)]] [[Category:Series 40 6th Edition FP1]] [[Category:Series 40 Developer Platform 1.0]] [[Category:Series 40 Developer Platform 1.1]] [[Category:Series 40 Developer Platform 2.0]]

Symbian: [[Category:Symbian]]
[[Category:S60 1st Edition]] [[Category:S60 2nd Edition (initial release)]] [[Category:S60 2nd Edition FP1]] [[Category:S60 2nd Edition FP2]] [[Category:S60 2nd Edition FP3]]
[[Category:S60 3rd Edition (initial release)]] [[Category:S60 3rd Edition FP1]] [[Category:S60 3rd Edition FP2]]
[[Category:S60 5th Edition]]
[[Category:Symbian^3]] [[Category:Symbian Anna]] [[Category:Nokia Belle]]

Add categories below using category selector.

358 page views in the last 30 days.

Was this page helpful?

Your feedback about this content is important. Let us know what you think.

 

Thank you!

We appreciate your feedback.

×