Search This Blog

Saturday, 16 August 2014

How to use Google AdMob in Windows Phone app

Step 1. Firstly download Google Admob SDK for Windows Phone from the link below
Step 2. Go to your AdMob account and create an ad unit for your app
Fill in the details to create an AdUnit as follows
  • Fill in your app name and select platform
  • Select the type of AdUnit and fill in the name for the AdUnit. You can customize the look of the ad whenever you want
  • Click on save and an AdUnit id would be generated.All done you are ready setting thing up for AdMob.
Step 3. Unzip the SDK files and you will find a GoogleAds.dll file in it. Create a new project and add a reference to this dll file in your project.















Note: If the GoogleAds.dll is showing as incompatible then follow these steps
  • In the file explorer, navigate to the Google Ads.dll
  • Right click the dll file and click ‘Properties’
  • In the ‘General’ tab, at the bottom, there will be an ‘unblock’ button
  • Unblock the dll file and add it again in your project
You will need to add the following capabilities in your app for ads to appear!
  • ID_CAP_NETWORKING: Access to network services is required when requesting ads.
  • ID_CAP_WEBBROWSERCOMPONENT: Required since the AdView is a web browser.
  • ID_CAP_MEDIALIB_PLAYBACK: Provides access for currently playing media items.
  • ID_CAP_MEDIALIB_AUDIO: Provides read access to audio items in media library.
That's it... :)
now run the emulator...and wait for a while..adds will appear...!!!

Create an add unit with Google AdMob

Create an ad unit

Complete the following steps to create an ad unit for an existing app.
  1. Sign in to your AdMob account at https://apps.admob.com.
  2. Click the Monetize tab.
  3. Select your application from the All apps list on the left-hand side.
  4. Click + New ad unit.
  5. Click Banner or Interstitial.
  6. Provide the following details for the ad unit:
For Banner:
  1. Ad type: Choose the ad type(s) allowed for this ad unit. You can choose any combination of text and image by checking the boxes. Checking both boxes is recommended since unchecking either of the boxes might limit the revenue generated by the ad unit. Unchecking all of the boxes will result in an error. You must choose at least one ad type for each ad unit.
  2. Automatic refresh Determine how often a new ad impression is generated. You can choose not to refresh or to refresh ads every 30 to 120 seconds. We recommend setting a refresh rate between 45 and 60 seconds.
  3. Text ad style: Select a text ad style that complements your app. You can use the standard style or customize your own style.
  4. Ad unit name: Enter a unique name and description that will help you find this ad unit later (e.g., Top Banner on Home).
For Interstitial:
  1. Ad type: Choose the ad type(s) allowed for this ad unit. You can choose any combination of text, image, and video by checking the boxes. Checking all three boxes is recommended since unchecking some of the boxes might limit the revenue generated by the ad unit. Unchecking all of the boxes will result in an error. You must choose at least one ad type for each ad unit.
  2. Interstitial timeout: Determine how long the app should attempt to receive an ad. You can select from 3 to 10 seconds and it must be a whole number.
  3. Ad unit name: Enter a unique name and description that will help you find this ad unit later (e.g., Interstitial on level complete).
7.  Click Save. You'll see the ad unit ID for this ad unit on the top.
8.  Click Done to return to the Monetize tab or click Send an email with these instructions to have instructions sent to you via email.