Using AdDuplex for Windows Phone 8 Silverlight app

AdDuplex is a cross-promotion network specifically targeted at Windows 8 and Windows Phone apps and games. You add our AdControl to your application and start serving ads for other apps. They serve ads for your app in return. The ratio is 8:10. This means for each 10 ads displayed in your app 8 of your ads will be displayed in other apps. The remaining 2 ads will be sold to support the service. The advantage of using adduplex is that it has a 100% fill rate. So it is often used as a secondary option to fill ad space if the primary ad network fails to deliver an ad.

You may consider using these as your primary ad networks

Here’s how you could use AdDuplex in your app.

Step 1. Register for a publisher account on AdDuplex

First thing first. If you don’t have an adduplex account, register on

http://www.adduplex.com


 

Step 2. Register a new app from your dashboard

Click on New App button in the dashboard to register a new app. We are building a Windows Phone 8 Silverlight application.


 

Enter the details for the app and choose an appropriate platform.

 

Once you create the app, note down the App ID which we will need while developing the application.

 

Step 3. Create a new Windows Phone 8 Silverlight app

Choose a Blank Windows Phone Silverlight template from installed templates and create a project.

 


 

Step 4. Add AdDuplex SDK to your project using Nuget

Next, add AdDuplex SDK to your project using Nuget package installer. You might want to see

How to integrate a Toolkit or Third party SDK with windows phone app using NuGet Package Manager

 


 

Step 5. Add the namespace for using AdDuplex in MainPage.xaml

Add the namespace for AdDuplex on pages where you wish to display ads

xmlns:adduplex=”clr-namespace:AdDuplex;assembly=AdDuplex.WindowsPhone”

Step 6. Add the adcontrol in your page

Now add the adcontrol in your page. Use the App id which you generated earlier.


 

Note:

  • You can preview your own exchange ad by setting IsTest property to true.
  • Make sure the whole AdControl is visible by verifying that it’s not obstructed by any other objects on your page.

Download full project AdDuplex-Example.zip

Adding Microsoft pubcenter ads in Windows Phone 8 apps

Recently lots of developers are seen facing problems with pubcenter ads. The impressions are at an all-time low still for some developers ads never show up (not even the test ads). There’s a little thing that developers should be mindful of and pubcenter will again start working for them. Heres a tutorial explaining how you could integrate pubcenter advertisements in your Windows Phone 8 apps.

Step 1. Visit pubcenter website and add a new application in it

Visit pubcenter website to create a new application and its ad unit

https://pubcenter.microsoft.com/

 

 

Note down the application ID and the ad unit ID which you just created.

Step 2. Add a reference to Microsoft.Advertising.Mobile.UI

Right click on the name of the project in solution explorer and choose Add>Reference. From the dialog box that appears choose Microsoft.Advertising.Mobile.UI and Microsoft.Advertising.Mobile and add it to your project. These references will enable you to use Microsoft’s pubcenter ads in your app. Instead of adding the reference you could have dragged and dropped the AdControl from Toolbox.

 


 

Step 3. Crucial step- Add the following capabilities carefully

Not adding all the required capabilities is main reason behind ads not showing up from pubcenter. Not choosing the right capabilities doesn’t lead to a syntax error and no error is reported while deploying the app. The following ID_CAP capabilities must be included in the manifest of the advertising-enabled app.

  • ID_CAP_IDENTITY_USER
  • ID_CAP_MEDIALIB_PHOTO
  • ID_CAP_NETWORKING
  • ID_CAP_PHONEDIALER
  • ID_CAP_WEBBROWSERCOMPONENT

Go to Solution Explorer> Properties> WMAPPManifest.xml and move over to capabilities tab. From there choose the following capabilities. You may require other capabilities based on the type of application you are building but these will be required for pubcenter.

 

Step 4. Add a reference to the page where you want to display ads

Add the following reference to the page where you wish to display ads from pubcenter.

xmlns:UI=”clr-namespace:Microsoft.Advertising.Mobile.UI;assembly=Microsoft.Advertising.Mobile.UI”

 

Step 5. Add the AdControl to your page

Add the AdControl to your page and insert the app id and ad unit id in it. If you are unsure where to put the code then have a look at the screen shot below. Also notice that the app id and ad unit id are set to test_client and Image480_80 respectively which is the default value. Also we have added an error occurred event handler.

Note: While debugging the app on emulator ads won’t show up if you are using a real app id and ad unit id. Instead if you use test values then a default ad will be visible    

Step 6. Add the error occurred event handler in code behind

You could use this event handler while debugging to know the reason for ads not appearing in the app. Most of the times if the ad control is correctly configured the reason for ads not appearing is low fill rates. Also you could use this event handler to load ads from another provider if ads from pubcenter fails. The code snippet show how you could add Google Admob’s ads when pubcenter fails to get an ad.

Here’s an article explaining how you could add Google AdMob in your Windows Phone 8 app.

 

Note

A few users have claimed that they can’t find this event trigger in their ad control. They might not be using the latest Ad SDK.

When you run the app in the emulator ads should now appear. Here’s a screenshot of the sample app i built.

Capture

 

Get the full source code of the app here,

Download full project source code pubcenter.zip