Friday, January 13, 2012

How to Monetize Windows Phone 7 Application

 

This article explains how to Monetize Windows Phone 7 application using Microsoft Advertising Ad control.

Introduction

The market for Windows Phone 7 apps is wide open for developers wanting to monetize mobile apps. That means endless opportunities for any developer looking to monetize mobile apps.

Monetization in mobile app basically allows developer to display advertisement on your mobile application, in WP7 we achieving such kind of functionality using Microsoft Advertising Ad Rotator Control. Monetized utilizing unique capability to serve ads based on *where* the person is located, *what* they are searching for (ad unit categories), and *when* they are searching (active advertising campaigns)

What is mobile monetization?

In mobile app development the term monetization is used to mean the ability to generate revenue thorough your mobile app. It can be from affiliate programs, e- commerce, premium content and advertising.

Implementation

Basic steps follow to implementation in Windows Phone 7 app.

Step-1:

Download Microsoft Advertising SDK.

Download Microsoft Advertising SDK for Windows Phone.

After download Microsoft Advertising SDK, install it on your development machine.

Step-2:

Register mobile App at Microsoft pubCenter..

Register Your Mobile App: Sign up and register your Windows Phone apps using Microsoft pubCenter. Here you can use your live or pubCenter Id.

Ad_001

Register your first application and create an ad unit (optional)

 

Ad_002

Enter application name:

Device type:

Ad unit name:

Ad unit size:

Select Ad category:

Excluded Url:

 

 

Ad_003

Step-3:

Create the Windows Phone application

1- Create a Windows Phone 7 Application project

Wp_Ad_001

2- Right click on project in solution explorer panel and click on Add Reference dialog box, click the Browse tab. Navigate to the location where you installed the Microsoft.Advertising.Mobile.UI.dll previously. Click the Microsoft.Advertising.Mobile.UI.dll to select it, and click OK.

Wp_Ad_002

Wp_Ad_003

3- Now configure Application Id and Ad Unit Id properties in the Ad Control.

Here is two ways to add “Ad Control” in the application using XAML and C# code behind.

Using XAML

Drag and drop the Ad Control to Windows Phone 7 xaml page and configure Application Id and Ad Unit Id properties in xaml.

See below code snippet:

<my:AdControl Foreground="Red"
AdUnitId="10020750" 
ApplicationId="e1e3c23b-3a59-4119-852e-8ad0a7f78f11" 
Height="80" 
HorizontalAlignment="Left" 
Margin="0,6,0,0" 
Name="adControl1" 
VerticalAlignment="Top" 
Width="480" 
IsAutoRefreshEnabled="True" />
Wp_Ad_004

Using (C#) code behind

Double click on the Windows Phone7 Page, it will automatically open the code behind of a page. And using the AdControl API which is a managed api. Include the Microsoft.Advertising.Mobile.UI namespace in the project. And create an instance of the AdControl Class and set the properties of the AdControl class instance or you can directly pass it to AdControl constructor.

See below code snippet:

private const string APPLICATION_ID = "";
       private const string AD_UNIT_ID = "";//
       private AdControl adControl;
        // Constructor
        public MainPage()
        {
            InitializeComponent();
            this.Loaded += new RoutedEventHandler(MainPage_Loaded);
            this.Unloaded += new RoutedEventHandler(MainPage_Unloaded);
        }
        void MainPage_Loaded(object sender, RoutedEventArgs e)
        {
            if (!string.IsNullOrEmpty(APPLICATION_ID) && !string.IsNullOrEmpty(AD_UNIT_ID))
            {
                adControl = new AdControl(
                    APPLICATION_ID,
                    AD_UNIT_ID,
                    true);
                // Make the AdControl size large enough that it can contain the image
                adControl.Width = 480;
                adControl.Height = 80;
                adControl.Keywords = "Windows Phone 7, Hotels, Travels, Gold";
                ContentPanel.Children.Add(adControl);
            }
            else
            {
                MessageBox.Show("To show ads in this application, insert the application ID and an ad unit ID into your code as explained..");
            }
        }
        void MainPage_Unloaded(object sender, RoutedEventArgs e)
        {
            ContentPanel.Children.Remove(adControl);
        }

Run the application by using F5 button, and you will see a sample of Monetization in Windows Phone 7 Application.

Wp_Ad_005

 

Thanks you!

 

Happy Coding Smile

3 comments:

Movies Gallery 2011 said...

Excellent pieces. Keep posting such kind of information on your blog. I really impressed by your blog.
WINDOWS PHONE 7 DEVELOPMENT| SEO tools

Adam Wheatley said...

Have you checked out WP7 Ad Rotator on Codeplex? This tool allows the rotation of multiple ad providers, including PubCenter, AdDuplex and a bunch more. I'm using it for my XNA game Alien Escape and love this tool!

http://windowsphone.com/s?appid=b37b78f9-7a80-4fde-8daf-c4a0c32e35e5

Blogger said...

If you are looking for a good contextual ad company, I recommend that you check out ExoClick.