Microsoft Pubcenter not showing ads in your windows phone 7 app?

The free apps I had in the marketplace were running Google’s Admob as adprovider because when I wrote the apps Microsoft Pubcenter wasn’t available in the Netherlands yet. When I was upgrading my Apps to Mango I found out that version 4.0.4 that is currently the latest release of the Windows Phone Admob SDK is broken will always give you exceptions when you include this control. Seeing Google wasn’t to keen on fixing this since it was mentioned a lot in admob sdk Google groups I decided to switch to Microsoft Pubcenter because it came available for Dutch people.

Implementing the control is easy by just installing the SDK, create an account, adding the control to your page and filling in the applicationid and the adunitid. if you still need a guide this one explains all the details:

http://blogs.msdn.com/b/urmila/archive/2011/03/10/displaying-ads-on-windows-phone-7-apps-the-basics.aspx

So the control is added to the page and you’re ready to go. If you followed all the instructions the ads should show up fine. Not for you?

I had the same problem when I was testing my application. I did most of my testing in the emulator and the ads would show up fine right there. When I started testing on my phone I noticed that only the ad placeholder was shown for really short time and after that the ad was hidden. Trying to find out what the differences could be between my phone and the emulator my first thoughts were the Culture of the phone since my phone is running in Dutch Culture nl-NL and the emulator is running en-US by default. When I switched the culture on the emulator to being Dutch the ads also stop showing there.

So what is the problem and how did I fix it?

The Pubcenter Adcontrol has a nice event called “ErrorOccured” and you can subscribe to this event to see what is happening. (or just attach the debugger and set it to break on exceptions)

   1: public MainPage()

   2: {

   3:     InitializeComponent();

   4:     adcontrol.ErrorOccurred += new EventHandler<Microsoft.Advertising.AdErrorEventArgs>(adcontrol_ErrorOccurred);

   5: }

   6:  

   7: void adcontrol_ErrorOccurred(object sender, Microsoft.Advertising.AdErrorEventArgs e)

   8: {

   9: }

In the adcontrol_ErrorOccurred eventhandler you can log your error the adcontrol is throwing or handle it the way you want to. The error I kept getting when using the Dutch Culture was:

Microsoft.Advertising.Mobile.Shared.AdException – No ad available.

My guess was that this was happening because there aren’t any Dutch ads yet so I tried to change the settings of the adcontrol by changing the CountryOrRegion, Language and even the Latitude and Longitude attributes to somewhere in the United States but this doesn’t help. I made a ticket at the Pubcenter helpdesk and they told me a new algorithm just went live and it can be that there aren’t to many ads yet so it’s possible to get a disappearing ad control once in a while when you’re running less common cultures. Trying to change the country or culture DOES NOT WORK so you’ll just have to wait (It’s not like Admob is a better alternative since that one isn’t working at all)

I would encourage everyone to just leave the ad in and the requests to the Pubcenter servers will show that there is a lot of space for ads to be sold so advertisers will jump in and use this space.

Nokia seems the first to jump in because the last few days I seem to receive Nokia Lumia ads when using a Dutch culture :)

Oh btw this method also works when you’re having other issues with your ad control ofcourse. just check the exception to see what’s going on. The one thing I keep forgetting every time I add the AdControl are the capabilities in the WMAppManifest.xml. when you do this you’ll get another AdException:

Microsoft.Advertising.Mobile.Shared.AdException – Required capabilities are missing from manifest (WMAppManifest.xml): ID_CAP_NETWORKING, ID_CAP_PHONEDIALER, ID_CAP_IDENTITY_USER, ID_CAP_MEDIALIB, ID_CAP_WEBBROWSERCOMPONENT.

Geert van der Cruijsen

Share on Facebook
Kick It on DotNetKicks.com
Shout it
Post on Twitter

PinPin 1.2 update now available in the WP7 Marketplace

First note I want to make: The “Error retrieving ATM locations” bug is fixed in this release!

Here is the story on how it all went down:

Since PinPin’s launch last week I’ve been loaded with feedback from people, most of them were positive but there was also a large group of people who weren’t able to get ATM locations. At first I didn’t have any idea how this was possible since I had tested at many locations in the Netherlands and had asked several colleagues to test the app and it worked for everyone.

Luckily  lots of people were able to find the feedback form in my app and when I received a mail from Marco who had a dev unlocked phone and was receiving the errors I found my chance to find out what was causing the bug. I made a version 1.1 and submitted it to the marketplace (that wasn’t smart because that’s why it took so long to get 1.2 out) but also mailed it to Marco so he could test. 1.1 had the option to save the errors and send a mail with the Error messages and a stacktrace so I could see what was going wrong.

With the error report I received from Marco I could see it was something in the response from the webservice I’m calling to get the ATM data but still couldn’t see what the error was exactly. I again added more logging to the app and asked Marco to test again. This time I could compare my request and response from the server to his and then I found out: The Dutch regional settings were screwing things up. Ofcourse this is a major concern for an app that is only used in the Netherlands Smile

I fixed the bug but had to wait untill version 1.1 had passed certification before I could submit 1.2 Wednesday night 1.1 was approved and I immediately submitted 1.2. Today I received another mail from Microsoft that 1.2 also passed certification. From now on everyone should be able to use PinPin!

If you find any bug in version 1.2 please let me know and I’ll try to fix it asap again.

It can take a while before you’ll get the 1.2 update notification from your phone but you could also manually uninstall your current PinPin installation and reinstall from the marketplace you’ll download version 1.2.

Big thanks to Marco and everyone else who has send feedback concerning this bug. Hopefully you can enjoy PinPin now and if you do don’t try to rate and review the app, it only takes a few seconds!

 

1_thumb 2_thumb 4_thumb2

Oh and if you didn’t have PinPin yet, you can download it here:

Download PinPin for WP7

 

Geert van der Cruijsen

Share on Facebook
Kick It on DotNetKicks.com
Shout it
Post on Twitter

Introducing: PinPin for Windows Phone 7

I’m proud to announce my 2nd Windows Phone 7 application available in the marketplace. The new app is called PinPin and is an app to locate an ATM near your location. The app is really simple at this first release, just open the app and the app will retrieve ATM location information near your GPS location.

At this moment PinPin only works if you are located in the Netherlands because there is no worldwide ATM location data available. I’m still looking for this data so if someone knows where to get this please let me know.

PinPin Logo

Below are some screenshots of the application:

1 2 3
4 5 6
7 8

PinPin is available for FREE in the Windows Phone marketplace. download it by clicking the button below:

Download PinPin for WP7

Special Thanks to Christiaan Veeningen for telling me to build this app :)

If like or dislike the app please let me know by rating the app or by submitting a review. You can also contact me through twitter @geertvdc or leave a comment here on my blog.

This is currently the first release of PinPin. I have more plans for the app in the future, here is a roadmap of what to come:

  • Add Dutch language
  • Get Directions (Will have to wait for Mango)
  • Add more Bank logo’s
  • Add more countries
  • Review Comments I get from you!

Hopefully you’ll enjoy this new app!

Geert van der Cruijsen

Share on Facebook
Kick It on DotNetKicks.com
Shout it
Post on Twitter

WP7 App hub error: The [NeutralResourceLanguage] attribute is missing on the entry assembly. (2003)

Today the Microsoft Windows Phone 7 App Hub got a makeover. My new app was ready for deployment yesterday so logging into the new App hub to deploy my app today was the plan.

After uploading my .xap file the app hub told me the “NeatralResourceLanguage” attribute was missing with the following error:

The [NeutralResourceLanguage] attribute is missing on the entry assembly. (2003)

Not sure what this error means I started looking in Visual Studio. and found the solution for the problem.

  • In Visual Studio 2010 rightclick your project and choose properties
  • At the application tab click the “Assembly information…” button
  • Fill the Neutral Language in the popup
  • Press ok!
  • You’re ready to go!

image

It seems that the new App hub Checks up on more things than the old App hub did. The neutral language is probably something a lot of people will forget so hopefully this helps others who are receiving this error.

The Assembly information can also be changed manually the following way:

  • Open the properties directory in your WP7 project
  • Open the AssemblyInfo.cs file
  • Add the following line at the end of the file:
[assembly: NeutralResourcesLanguage("en-US")]

you’ll also need to add the following line at the top:

using System.Resources;

 

Happy developing and deploying!

Geert van der Cruijsen

Share on Facebook
Kick It on DotNetKicks.com
Shout it
Post on Twitter

My Windows Phone 7 Mango Beta review

The beta of Windows Phone 7.1 codename “Mango” was released last week and in this post I’ll write down my experiences with Mango that I had using it since the launch of the beta.

I’ll try to update this post when I bump into stuff I didn’t write about yet.This post isn’t about describing all new stuff since there are already dozens of other great blog posts about that but I’ll try to write my opinions about how these features are working out or what I am still really missing in Mango.

WP7-Mango

 

Lots of small features that make your life easier:

One of the things I enjoy the most about Mango are the small things that really annoyed me with the 7.0 release of Windows Phone 7, for example the shutdown button that automatically turned of your phone even when the phone is locked. Now in Mango you have to slide down after pressing the power button so no more turning off your phone by accident. Also there is an option to set the pin timeout a bit longer so you don’t have to type in your pin every time you want to use your phone (15 minutes is max when you have policies applied).

One small feature I didn’t read about but seems missing is setting up the mail sync times. On my old phone I used to sync mail automatically with push mail between 7:00 and 23:00 so my phone wouldn’t make so much noise when it’s next to my bed when I’m sleeping. I haven’t found this feature so I think this is a big miss for the Mango release.

 

More Social:

Facebook integration was already great in 7.0 but it just got even better. The threading functionality sounds great but for some reason with US/English and Dutch live accounts something doesn’t seem to work. I really can’t wait for this to start working because seeing this in the movies is so nice!

The “Me” live tile became a lot more useful in Mango because you can get messages in the tile about new updates you have on Facebook. also when clicking on the tile you can use Facebook check in with only a few finger presses.

The use of groups is also added in Mango but I haven’t used this yet. I can keep up with my social updates but maybe this will change when twitter will start working in the retail version of Windows Phone 7.1 (In the Mango Beta twitter integration is not yet available).

Other integration will also be available like LinkedIn but this doesn’t seem to work for me in the Beta either.

 

Dutch Language:

Up until now I only had the English language available which is ok if you only type in English. Since 50% of my communication is in Dutch I really enjoy the added Dutch dictionary added in Mango!

 

Bing!

Before Mango I can’t say I actually used the Bing button other then pressing it by accident. but now 4 new cool features are added that seem to work really good. One of the features that I was really looking forward to is “Bing Vision”. With Bing Vision you can scan barcodes, qr codes, text but also books, cd’s and dvd’s. When you can a book you can automatically open apps like amazon to order this book or get more info about the book. Really great!

 

Besides Bing Vision there is also a button to listen to music like Shazam did in 7.0. Now this feature is build in and is working pretty good. There is also a “Nearby” feature added to Bing to get nearby restaurants, things to see, hotspots etc but there is no Dutch content yet so I only get the nearest locations in Germany….

The last option that is added to Bing is the voice to text search. but I don’t really see the big use of this. when I tested it it made a lot of mistakes and in the same time I could write it.

 

IE9:

What can I say… the old browser in wp7 was a disaster. All other mobile browsers were far superior but now IE9 mobile uses the exact same rendering engine as the desktop version so it is a great improvement. It can render HTML5. has more screen space because the address bar is moved to the bottom (Would hope there would be an option to hide it though to get even more space when reading for example). also when browsing in landscape mode you can now use the address bar which wasn’t possible in 7.0.  You can now also pin websites to your homescreen for fast access to certain websites you use often.

 

7.1 apps:

I have seen a lot of movies and demo’s about cool apps using Mango features but there is no possibility to test those myself except for writing your own apps of course (which I will do!) I do have really high expectations about these apps and all the new features

 

To do:

One major issue a lot of people were missing are tasks but now this is added to your calendar hub and can be synced with exchange.

 

Games hub:

I’ve read a lot about new features in the games hub and the integration with Xbox live but since my Xbox Gamer tag live id is Dutch it’s not possible to use this yet. The list of games is cleaned up though and is looking a lot better than it did in 7.0

 

What is not in but needs to be in?

The one super major thing I really need is Tethering. I can understand not all providers can appreciate this feature but I used it on windows mobile 6.5 and now with the same provider I can’t use it anymore. that’s a bit shame!

the other thing I already mentioned and that is setting up times to sync your stuff and times it shouldn’t but it seems I’m the only one wanting this feature :(

Loads more is in!

Steve Balmer promised us 500 new features so I only touched on this a little but but I hope you enjoyed reading my first opinions about Mango and the Beta. I see a bright feature for WP7

Share on Facebook
Kick It on DotNetKicks.com
Shout it
Post on Twitter

Using the WP7 system color in live tiles and application icon

I’m currently building my first WP7 application for a contest that is held by Avanade Netherlands for all its employees. Who can create the best app in a small amount of time.

My app is almost finished and I was trying to set up the live tile and application icon. Of course I wanted to use the system color which the user has selected to display on the background of my live tile. How to do this? here is how, it is actually quite simple.

when you open your solution you’ll automatically get your background.png and applicationicon.png. both icons have a black/greyish background. like shown in the example below.

livetile1

to switch the background to use the system color follow the following steps:

  • Open up your background.png in any decent image editing tool like Paint.net.
  • Use the magic marker to select the background

live tile selected

  • press delete so you get a transparent background

 

live tile deleted

  • save the icon back to your visual studio solution.
  • compile
  • enjoy!

 

livetile2livetile3

 

Ofcourse the next step would be to do the same for your application icon (the icon in the application list).

I tried it and it didn’t work… after some research I found out that this is for Microsoft and official partners only.. Bummer!!

 

Guess we are going to be stuck by using greyish application icons after all.. hopefully Microsoft will fix this in the future.

 

Hopefully this post was helpful to you. In my opinion there are to few good resources to be found on WP7 development so every small thing helps.

Geert van der Cruijsen

Share on Facebook
Kick It on DotNetKicks.com
Shout it
Post on Twitter

First impression of the HTC Trophy and Windows Phone 7

A few weeks after the official release of windows phone 7 our entire company (Avanade Netherlands) moved to Windows phone 7. Every Employee (225) received a HTC Trophy today and tonight i’ve put my new phone to the test. Here are my first impressions:

the hardware:

The phone is feeling really robust and the screen is looking really well. the captative screen works very good aswell. all menus and buttons are reacting really fast and Microsoft really did their best in getting the UI right.. And they did! After testing the Camera i have to say that this is probably the worst part of this phone. when it’s a bit dark the pictures get really bad. i also don’t like the “hardware”/tip buttons under the screen. ofcourse you dont need them that much but when i compare this to my girlfriends HTC Desire i have to say i prefer real hardware buttons.

booting it for the first time:

after booting it you get a small tutorial to set stuff up. i choose to skip the windows live id and to just get started. within 1 minute my phone was ready to go. I’ve started setting up my exchange mail since all my contacts/mail/agenda stuff is in there. the setup was also done really easy, just add an exchange account, add your username/password and press ok. everything just worked. after this i’ve added my facebook account. after i did that all contacts were synced and merged perfectly. my exchange contacts have facebook pictures etc. looking pretty slick.

After this i tried setting up my live id.. stubborn as i am i ofcourse added my dutch liveid to see what would happen.. first it would ofcourse sync my mail/contacts etc.. that was the positive part. then i tried to open the marketplace but that wasn’t working. i tried to deinstall the live id but that isn’t possible. so a hard reset was a fact :D (within 5 minutes after i first touched it).

after playing with facebook/mail/apps etc i tried the most important thing a phone has to do: call someone. to make this extra hard i called someone while i was on my way home through my parrot carkit. some windows phone 6.5′s wouldnt even make this test but sound quality was really good with my new phone. also the ui of the call screen and contact screen  is really well thought off.

next try: setting up a US based live id and adding my dutch live id after. Perfect. i get all the contacts/agenda/mail from my dutch live id and i can get to the marketplace through my US live id.

ofcourse i had to set my facebook/exchange stuff again but that was done in a few minutes.

after playing around with it for a few hours this evening i have a pretty good feeling about this. my conclusions for now:

pro’s:

  • WP7 is really responsive and intuitive
  • overall hardware is robust and looking nice
  • everything just works (except dutch live id’s )
  • most important thing calling works really good (nice contact screen, nice call screen)

cons:

  • camera is a bit flaky
  • power charge is on the side of the phone (i am left handed and can’t even hold it normally when the power cable is in….)
  • Support for dutch marketplace / xbox live missing (will be there in april 2011)
  • no tethering (will come someday)

i’ll update some more about the new phone after i’ve played with it a bit more after a few days (battery use for example)

Geert van der Cruijsen

Share on Facebook
Kick It on DotNetKicks.com
Shout it
Post on Twitter