Getting Started: NAX and Windows Phone 8

[UPDATE]

NAX has been discontinued and rolled up into Inneractive accounts]

Original Post

The purpose of this post is to demonstrate how easy it is to get started using the Nokia Ad Exchange (NAX) SDK with your Windows Phone 8 (WP8) app. Although there is no specific SDK for WP8, the process is the same with only one difference. You need to manually check off the capabilities your app will use. Let’s get started.

Step One: Go to Nokia Ad Exchange and sign up. It’s free and you’ll be confirmed in a couple minutes.

Step Two: Download the SDK. Important- Make sure you unblock the binaries before unzipping the folder. To unblock the files simply right click on the compressed folder that contains the SDK, select “options”, click the button titled “Unblock” and then click OK. Now you can unzip the folder to wherever you want to the SDK to reside. I personally like having a “Downloaded SDKs” folder in my documents library.

Where do you get the SDK? Once you’ve logged into the NAX portal, you need to go to the SDK tab and click the download button underneath the Windows Phone SDK in the list. Here is what you should see under the SDKs tab:

SDK list

Step Three: Once the SDK has been downloaded, unblocked and expanded. Add the DLL to your project. To do this right click on your project’s references folder and choose “Add Reference”. You’ll be presented with the dialog window shown here (click to enlarge):

AddReference

Select “Browse” in the left column, then click the “Browse” button at the bottom. Locate the folder you expanded the NAX SDK into. You’ll find the Inneractive.Nokia.Ad.dll file under the InneractiveAdSdk folder, select that file and then click “OK”.

Step Four: Now that you have the proper reference in place, let’s go create a new ad. Go back to your NAX portal and select the “Add App” tab. You should have this form in front of you:

AddNewAd

Go ahead and fill out the boxes with the appropriate information. For now, under the “Use Location” box select NO, I will write another blog post on how to use location in your ads. Click “Create” when you’re done. It will show a busy indicator and then present you with this view (click to enlarge):

NewAdUnitID

Notice the box titled “Your AppID”. You will be using that ID in your app. With this Id the server knows who you are and knows what Ad unit to serve your app based on the values you selected when creating the App ID. Leave this page open, we will return to it shortly.

Step Five: Go back to your application and open your WMAppManifest file (find it inside the Properties folder of your project. Select the “Capabilities” tab and make sure you have checked off the ID_IDENTIFY_DEVICE checkbox (if you plan on using location, you will also need to check off the location capability as well).

CapsAvailable

Step Six: Open the page you will be using the ad in, I am placing it on the MainPage in this example. There is no need to reference the namespace in the page header, as the pointer is within the instance itself. To instantiate a new ad placement, simple use this XAML (NOTE: Make sure your namespace matches the DLL you have. It could also be Inneractive.Ad.dll).

Just ad XAML

Notice the AppID property? This is where you use the App Id you got when you finished step 4. The AdType property gives you the choice of a banner or text ad to be displayed. You also can set the ad’s reload time with the ReloadTime property.

Go ahead, build and deploy your app now. I placed my ad at the top of my page to keep it out of the user’s normal finger reach to prevent accidental launch. Here is what the finished result looks like, have fun and make some money!

Running Success

8 thoughts on “Getting Started: NAX and Windows Phone 8

    1. Lance says:

      They are two different solutions. microsoft uses Microsoft advertising, NAX uses 120 different ad providers through Inneractive.

      Reply
    1. Lance says:

      Yes, you normally would want to place the namespace pointer in the page header. However to keep this demo as simple as possible, I place it within the instance itself. See the second line of the ad’s XAML, you’ll see “xmlns:ad” is referenced.

      Reply
  1. natedogg52 says:

    If any one had the attention to detail that was a little slow like me, the name space needs to match the file that was down loaded. My .dll file was not named “Inneractive.Nokia.Ad” it was close “Inneractive.Ad”. Just wanted to help if some one else like me was out there trying to figure it out for twenty minutes! Great post Lance! Thanks for your Expertise!

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.