ailon's DevBlog: Development related stuff in my life

Building Reference for XNA Library with Sandcastle Help File Builder

5/6/2011 11:25:50 AM

I was just building help files/references for AdDuplex Windows Phone Silverlight control and XNA library using the awesome Sandcastle Help File Builder. Silverlight portion went pretty smoothly. Just had to add references to a couple of phone specific assemblies. But with XNA I immediately got this error when trying to compile:

Error BE0067: Unable to obtain assembly name from project file '[projectFile]' using Configuration 'Release', Platform 'Any CPU'

Problem is that in XNA project the Platform is not “Any CPU” but “Windows Phone” (in my case). OK, but there’s no such option in SHFB list:


And there’s no way to expand that list with your own values.

Fortunately you can specify Configuration and Platform as properties for each documentation source separately in a free form text:


Problem solved. Hopefully this helps someone.

Tags: , ,

Troubles with OneNote image scaling on Windows Phone

5/4/2011 11:03:58 AM

During my trip to USA I’ve been burned by one issue with OneNote on Windows Phone which I think wasn’t the case before the NoDo update. I’m not 100% sure that it was OK back then and I don’t have a spare pre-NoDo phone and don’t want to rollback my primary phone just to verify this.

Anyway it’s not OK how it is now and I think it’s a bug that needs to be addressed.

The problem

Quite often I “print” some document or web page to OneNote. It is stored there as an image. I did so before the trip and “printed” various hotel, flight, car reservations, visa waiver info and other stuff this way. It looked perfectly fine on the PC. Here’s a sample:


Yes, the ASP.NET stuff going through is funny, but is not the point. The point is that the text is perfectly crisp.

So, the notebook is synced to my Windows Phone and everything looks fine. But when I open the note on the phone and zoom-in on the printout it looks like this


Not very usable. And as I mentioned above I don’t think this was the case few months ago.

I thought this could be some “optimization” to save network traffic, but I tried emailing the note from the phone to myself and opening it on the PC. Looks perfectly crisp. So this must be some scaling quality issue in OneNote on the phone itself.

Can you try it on your pre-NoDo (or even post-NoDo) phone?

I’m pretty sure I have successfully used OneNote in such scenario before. Unless I’m hallucinating. So I’d be grateful if you could verify that it was (or wasn’t) OK on your pre-NoDo phone. Or maybe it’s just me and/or my phone (Optimus 7) and it’s OK for others on post-NoDo phones too?

So to reproduce this “print” any document or web page with text to your OneNote notebook that is synced with your WP7, sync and open the note on the phone. Try zooming in on the image. How’s the quality?

Thank you!

Update: thanks to guys on twitter and WPCentral I’ve confirmed this has nothing to do with NoDo and has been an issue since day one. I’ve probably used it before in a slightly different scenario and didn’t notice the issue. Still it is something that is in desperate need of fixing and it’s kind of sad it wasn’t fixed in NoDo.


The State of Worldwide WP7 Publishing after MIX11

4/26/2011 10:11:58 AM

I’m back from MIX11 and a short vacation after that. It is now beside the point to write anything about general topics from MIX, but as I took on a duty of advocating expansion of Windows Phone marketplace accessibility, I’d like to address what was announced and changed after MIX11.

In this post I’ll talk about developer (publishing) accessibility.

8 (9?) new countries in more than a year. Really!?


I was still operating in moderate optimism mode (aka stupidity) before MIX. Hoping a lot of new developer countries will be announced (including Lithuania). I’ve got a couple hints that this won’t be the case and it wasn’t.

In more than a year Microsoft has managed to add support for 8 (or is it 9? (see below)) new developer countries. I’m pretty sure a single full time employee working on that could do more in a year, but oh, well. It’s clear now that this sort of expansion is not a priority for Microsoft or they are just waiting for Nokia to bring that part to the table.

Fortunately they at least did something to mitigate the issue.

Global Publishing Partners


Earlier this year MS announced Yalla Apps as their first official global publishing partner (aka proxy) for Middle East and Africa. I’ve seen different reactions to this – from awe to someone calling it a spit in the face of developers.

I consider it to be what it actually is – a workaround. Something that gets the job done in civilized, but not very elegant manner.

Now they’ve announced additional partners to cover a total of 102 countries. Each has some “focus” countries but actually accepts developers from all over the world (except for officially supported countries).


The funny part is that no one can tell what that “focus” really means. I’ve got some vague answers that it has something to do with partner using locally preferred payment methods, operating in closer time zone (for better support), etc. But Yalla Apps (which doesn’t “focus” on Lithuania) uses PayPal for payments (which is fine with me) and is located 1 timezone away from me, when our suggested partner (APPA Market) is 2 timezones away. So that “focus” aspect doesn’t seem all that important.

What really pissed me off during the session was this:


Paid updates are bad for EVERYONE

When APPA Market was announced I immediately went to their web site and saw a price table which had (and still has) this bullet point:

  • Application update £15

Yalla Apps had a similar (yet slightly cheaper) structure. I expressed my concerns to Todd Brix after the session and tweeted this


and to my surprise when I checked Yalla Apps prices yesterday they were like this:


(1 credit <= $1). Now 1 credit is not totally free but is negligibly cheap. Kudos to Yalla Apps for listening to the community. APPA Market is still where it was on April 14th.

I understand that these publishing partners are for-profit organizations and aren’t supposed to do charity work or something like that, but being an official partner already gives them way more exposure and business than they would get otherwise. On the other hand they let Microsoft be lazy in this area, so MS could chip in a little or make the process for partners as easy as possible (good APIs to publish updates automatically, etc.).

Paid updates are bad for …

  • Microsoft and Windows Phone ecosystem in general. Developers won’t publish minor updates or even critical updates for non-profit (or no profit) apps if it costs them 15 pounds for each typo. This would result in lower quality apps in the marketplace and is very bad for the ecosystem.
  • Global Publishing Partners. On paper it looks like partners would be making money with paid updates but in reality I think it would result in less developers joining them based on such fee structure and of those who joined fewer will be actually posting the updates. Speaking for myself I decided not to join any of them when I saw that fee structure.
  • Developers. Well, this is obvious. And it even more depressing when you see 1st class “citizens” not only getting direct service but paying incomparably less for it.


Based on what I saw I was planning to turn my back on actual WP7 development for another cycle and further concentrate on my related projects (AdDuplex and amCharts). But now, with updated Yalla Apps pricing, I’m seriously considering joining them. I’ll wait till APPA Market launches on May 1st and if their pricing doesn’t change I’ll go with Yalla even though they are not my “focus” partner.

Tags: , ,

See You at MIX11!

4/8/2011 9:14:02 AM

Yesterday I’ve wrapped up my main work stuff. Today I’m doing my final travel preparations. Packing my bags on Saturday. Sunday is the trip day – Vilnius –> Kiev –> New York –> Las Vegas. MIX11 starts on Monday.

I’ll be attending HTML5 and jQuery bootcamps on Monday. With 11 TBA (to be announced) Windows Phone sessions I decided not to plan any session schedule upfront and decide what to attend on the spot. I would love to go on the WP7 track but I have doubts Microsoft is going to make it easier for us in Eastern Europe to do WP7 development and publishing. This cripples my interest a lot.

Open Source Fest

On Monday I’ll represent amCharts Quick Charts during the Open Source Fest – an event with more than 50 open source projects. If there was an award for the longest project name I’d be a winner already.

Anyway, if you want to chat about any amCharts products come to the amCharts table and we’ll talk. I’ll be wearing this t-shirt (unless my luggage is lost):


And don’t forget to leave some chips in my jar (or whatever they give me)!

Silverlight MIXer


I won an invitation to the l33t Silverlight party (organized by the awesome John Papa) with this work of modern art (pictured above). Looking forward to meeting (almost) all of the coolest people in Silverlight community.

Let’s talk

Let’s meet and talk about WP7, Silverlight, WPF, amCharts, AdDuplex … anything. I’ve learned from my mistakes last year and I’m bringing identifiable wardrobe to MIX11. So I should be easy enough to spot.


OK. Back to last minute things…

See You at MIX11


Obstruction Detection in Silverlight for Windows Phone

4/3/2011 1:12:14 PM


AdDuplex Silverlight control is used quite often as a fallback for other networks. As a result it could be obstructed by the other network’s control at times. Problem is that in general case we can’t rely on developers always collapsing AdDuplex control when it’s not visible or informing it about this state in any way.

The other problem is that some of the other network controls (namely Microsoft’s pubCenter) don’t collapse when they have no ad to show, but rather either collapse some internal elements or just make them transparent. This allows underlying elements to show through but they still don’t get the touch events.

So I decided to solve this programmatically. It sounded really easy, but as usual there are some small things that stand in the way.

Meet ObstructionDetector

I’ve created a class with some helper methods that could be useful both in the above scenario and probably some other. You can find it in full at the end of this post.

The “title” method of this class is IsElementObstructed:

public static bool IsElementObstructed(FrameworkElement target)
var page = GetPage(target);
var frame = GetFrame(target);
var transform = target.TransformToVisual(frame);
var rect = TransformBoundsToPortrait(transform.TransformBounds(new Rect(0, 0, target.ActualWidth, target.ActualHeight)), page);
var covers = VisualTreeHelper.FindElementsInHostCoordinates(rect, page);

if (covers != null && covers.Count() > 0)
return !IsElementChildOf(covers.First(), target);

return false;

You just pass an element in question to it and it returns true if there’s something in the way of user’s eyes or fingers in front of this element.

The key technique is to use VisualTreeHelper.FindElementsInHostCoordinates() method. It returns elements residing in the same rectangle on the screen as our target. The elements are returned in the descending z-index order. So what’s left to do is to check if the first element in returned collection belongs to (is a child of) our target. If so, then there’s nothing in the way.

A few gocthas

Everything is portrait to VisualTreeHelper.FindElementsInHostCoordinates()

I’ve spent quite some time trying to figure out why the code worked fine in Portrait pages but didn’t work in Landscape. Turns out FindElementsInHostCoordinates() considers everything as portrait oriented even when other parts operate correctly. Apparently this is “by design”. So we need to adjust to this “feature”. For that I’ve added TransformBoundsToPortrait() method.

Get PhoneApplicationPage by going up the visual tree

It’s tempting to use Application.Current.RootVisual and assume it’s child is our PhoneApplicationPage, but it’s not the case in some cases (like page transitions in Silverlight Toolkit). So it’s safer to just go up the visual tree until we find the page.

Account for SystemTray

We need to create a transform based on PhoneApplicationFrame (not Page) since transforming from PhoneApplicationPage doesn’t include optional SystemTray and can result in offset in the results.

Known Issues

  • VisualTreeHelper.FindElementsInHostCoordinates() doesn’t return elements with IsHitTestVisible set to false. So if someone creates a cover for your control and set this property to false it won’t be detected. Any ideas?


I know this code is far from perfect, but it’s what I’ve got so far. I would really appreciated your feedback on how to improve it. The class is too small for a separate OS project or something like that, but I’d be happy if someone included it in some WP7 toolkit and improved on it.

The code

using System.Windows;
using System.Windows.Media;
using System.Linq;
using Microsoft.Phone.Controls;
namespace Ailon.Phone.Tools
    public static class ObstructionDetector
        public static PhoneApplicationPage GetPage(DependencyObject target)
            var parent = VisualTreeHelper.GetParent(target);
            while (parent != null && !(parent is PhoneApplicationPage))
                parent = VisualTreeHelper.GetParent(parent);
            return (parent as PhoneApplicationPage);
        public static PhoneApplicationFrame GetFrame(DependencyObject target)
            var parent = VisualTreeHelper.GetParent(target);
            while (parent != null && !(parent is PhoneApplicationFrame))
                parent = VisualTreeHelper.GetParent(parent);
            return (parent as PhoneApplicationFrame);
        public static Rect TransformBoundsToPortrait(Rect bounds, PhoneApplicationPage page)
            if ((page.Orientation & PageOrientation.Portrait) > 0)
                return bounds;
                Rect result;
                if (page.Orientation == PageOrientation.LandscapeLeft)
                    result = new Rect(bounds.Y, bounds.X, bounds.Height, bounds.Width);
                    result = new Rect(bounds.Y, 800 - bounds.X - bounds.Width, bounds.Height, bounds.Width);
                return result;
        public static bool IsElementObstructed(FrameworkElement target)
            var page = GetPage(target);
            var frame = GetFrame(target);
            var transform = target.TransformToVisual(frame);
            var rect = TransformBoundsToPortrait(transform.TransformBounds(new Rect(0, 0, target.ActualWidth, target.ActualHeight)), page);
            var covers = VisualTreeHelper.FindElementsInHostCoordinates(rect, page);
            if (covers != null && covers.Count() > 0)
                return !IsElementChildOf(covers.First(), target);
            return false;
        public static bool IsElementChildOf(DependencyObject element, DependencyObject parent)
            var current = element;
            while (current != null)
                if (current == parent)
                    return true;
                current = VisualTreeHelper.GetParent(current);
            return false;

Tags: ,

Windows Phone 7 Users, We All Need to Chill!

3/26/2011 11:33:27 AM

Let me start by stating that I’m not happy with current situation around Windows Phone 7 updates. I have an unbranded WP7 device and have yet to see the NoDo update supposedly released to open market devices 3 days ago.

I should also say that, even though I know close to nothing about public relations, it’s a completely strange PR move to release this “happy face” video 2 days after you get 200+ unhappy comments to your blog post.

This would’ve been good for a general public TV outlet, but general public doesn’t watch videos on Channel 9. Only geeks do. And geeks are not happy.

That said…

… when I read comments about class action suits and stuff like:

It's been a long time since I've watched an interview that made me want to jump through my screen and strangle somebody like this one did.

It makes me go WTF!? Come on people, it’s just a f***ing update for a f***ing phone.

As I see it it’s a pure PR disaster, not technical disaster, not business disaster. Just an odd approach to informing the public.

When Microsoft says they’ve RTMed next version of Windows and you’ll get it in 3 months, we all go “Hooray!”. When Microsoft says they’ve shipped NoDo and you’ll get it in 3 weeks we all go like “What a bunch of a***oles and liars!”.

I see it simply as approaching this consumer device business the same way as enterprise or even consumer PC business. This is wrong but it’s far from “the sky is falling”. No one is going to die from receiving the update one month later than his neighbor. It’s just Microsoft’s PR pissing people off by leading them to perception of the process as a tragedy.

We’re cornering them by demanding more transparency and unfortunately they don’t know how to handle it. They are giving us a date and miss it a little. The new date is totally valid from their point of view. They’ve shipped the bits to “manufacturing”. The only problem – it’s not a milestone for us. We only care when we actually get it on our devices.

IMHO, they should have silently started rolling the update and publicly announced it on March 31. The new “late March” date would be met and there would be at least a few happy people with update on their phones to support their PR efforts.

So to sum up… We should definitely let them know that their perception of the process is incorrect from the consumers perspective, but going all crazy about this is definitely over the top. I really don’t want to associate with these crazy people so I’m just going to shut up about this update business.



2/28/2011 12:32:52 PM

eco_badge_130There’s a Silverlight ECO Contest in progress with a theme of forest management and a grand prize of a trip to MIX11.

I’ve decided that it’s targeted mostly at designers and copy-writers at first and decided not to even try. Then I had an idea and decided to give it a try. When I was like 2/3 way through the implementation I decided again that I’m not a designer and quit. The files were left unattended on my disk for a couple of weeks.

Today I thought that there’s no reason for me not to submit what I’ve done. I’m not embarrassed by the idea, I still like it a lot, and I’m not a designer to be embarrassed by my design skills (or lack of them).

So, I took 1/3 of what I’ve done, packaged it and submitted to the contest.

You can check it out here, VOTE for it by clicking 5 leafs at the bottom and send me to MIX11.


Tags: , ,

Don’t “monetize” your WP7 apps on Day 1

2/4/2011 1:29:25 PM


Disclaimer: I’m the creator of AdDuplex. That said the thinking outlined in this post is what led to creation of AdDuplex and not the other way around.

From Zero to Hero

Obviously money is not the main and/or only reason most of us are in business of creating of Windows Phone 7 apps. That said getting paid for the time we spent on creating that nice app is what most of us wouldn’t mind at all. But here’s a news flash. A sad one, I must add. Not even the top independent WP7 publishers have bought themselves nice Lamborghinis with WP7 money.

Most of the developers of top WP7 apps are doing OK for a side gig, but not more than that. And most of them were there at launch and gained their momentum from being one of the first apps in their respective category.

Back in December, 2010 Jeff Webber has posted some sales numbers for Krashlander – one of the top paid (if not THE top) indy games on WP7. The numbers are obviously a little outdated, but unless you are sitting on something you consider deserving to be a supermegahit, you should look at these numbers as top limit for the nearest future.

Sigurd Snørteland has posted download and sales data for his 4 apps more recently in addition to previously posted data. His Tetris7 game is #12 free app at the time of this writing. Meaning it’s close to the maximum possible downloads for the app at the moment. His cumulative download stats show that Tetris7 had an install base of not more than 170,000 on January 8, 2011.


Considering that each of these installs shows 1 ad per day on average (which is wishful thinking, imo) and he gets $1 per 1000 impressions this results in about $170 per day or about $5000 per month. Not that bad until you consider that this number is based on wishful thinking and it’s one of the top apps. Plus it’s Tetris and I’m still not sure how legal the game is anyway.

And I’ve posted my more than modest numbers for Tic-Tac-Toe 3D. Consider that free version is #606 free app in Marketplace (#726 overall) right now.


Which is still in top 10% of the apps in the marketplace.

You can see the picture, so make your own conclusions.

Go Free, Ad-less or AdDuplex

During gold rush periods people tend to forget general business rules. If you are in it for a long run your goal at launch should be building reputation, buzz and as a result popularity for your app, not turning a profit.

So, unless your app is a novelty app or related to some specific event in time, I would strongly argue that your best bet is going free right now. Remember that you can switch from free to paid later, but not the other way around.

It’s probably not wise to run paid ads at the beginning either, considering that the returns won’t be sizeable at first and overall situation in advertising space on WP7. By far the most income generating ad network on WP7 is Microsoft’s own pubCenter but it’s limited to USA (both developers and users) and even US people experienced some issues getting signed up. Other networks seem to be working on pay-per-click (not per-impression) basis and don’t generate any substantial revenue according to reports from developers using them.

In the R.I.P. GooNews blog post in addition to describing issues with pubCenter Shawn Wildermuth writes:

I went with AdMob to serve ads.  The experience there isn't great as their pay model is per-click not CPM (so I haven't received any revenue from GooNews' ads) but at least they were serving ads across the world, not just in the USA.

So, basically there aren’t many options for generating reasonable revenue from the free app at the moment anyway. And, as I stated above, I would argue that this is not what you should be thinking about at this point in marketplace evolution.

So I’d say either go ad-less or use the ad space to promote your own apps, products or services. It is wise to be prepared for the moment when your app gets popular enough and the number of phones in the market increases to the point when it makes sense to try and make money from the advertisements. When that time comes you might find yourself in a situation when there’s no screen real estate you can dedicate to ads. So think ahead (but don’t overthink) of a place you can incorporate the ads if you decide to go ad-supported.

Another option is to use the advertising space to get free promotion for your app by helping other developers promote their. I’ve created AdDuplex with that particular idea in mind and that what it does. Once you are ready to make money from your app you can intermix AdDuplex ads with ads from commercial network of phase it out altogether. But for the time being popularity of your app is what you should be concerned with the most. This is how I see it.


Tags: ,

Windows Phone 7 Marketplace – Excel Economy

2/1/2011 3:36:08 PM

Yesterday I’ve posted about Trial vs. Free Windows Phone 7 app usage. Since I’ve already started analyzing statistics, I decided to look at it from other angle.

One aspect of my “WP7 activism” in recent months has been a “fight” for worldwide expansion of Windows Phone 7 marketplace (they are not awarding WP7 MVP awards for that ;). About 1400 people have signed a petition asking for action or at least information on the subject (have you?), but Microsoft keeps it’s silence. So I decided to look at my app usage data on a country basis.

Note: the data is taken from Google Analytics based on IP addresses. So it’s not affected by people from around the world using US or UK LiveIDs.

The Sad Reality of Excel Economy

I’ve taken the data for Tic-Tac-Toe 3D Free game (available for only 2 weeks) and grouped usage statistics by countries based on whether the country has WP7 Marketplace support or not. The app was used about 3,500 times from 68 countries. Here are the results:


As you can see unsupported countries make up only 13% of free app usage. This means that developers and Microsoft are getting only about 13% less revenue by supporting only 17 countries (actually 16 since, as far as I know, you can’t buy apps in India) instead of the whole world. So on paper (or in Excel) worldwide expansion of marketplace services probably looks like something not worth the effort.

This is what we call “Excel Economy” at work. A few years ago our local government in the face of financial crisis decided to increase taxes in order to increase budget income. It looked like they’ve just changed tax rate in an Excel spreadsheet with data for last year and looked how the number in the “Total” column increased. Unfortunately this is not how things work in real life.

Same goes for this app usage data. Who knows why this number is so low? Do these all “other” countries really make up only 13% of potential buyers? Or maybe they don’t use apps at all because their Zune desktop client doesn’t show “Marketplace” tab at all? Or maybe they didn’t buy WP7 device in the first place because they were told that they won’t have access to the Marketplace?

Here’s another slice of the “Excel Economy”


Looks familiar? USA, Germany, UK, France and Italy make up 85% of the usage while 11 other supported countries only 15%. Why support them?

Anyway, I still don’t understand what’s the problem of supporting more countries is. So don’t 1400 signatories of the petition. But Microsoft likes keeping us in the dark. The same way they let users of Yahoo! Mail loose money on 3G traffic for a month while they solve their corporate problems instead of providing a quick workaround to mitigate the issue.

But I guess some things can’t be explained by logic. Especially when dealing with corporate monsters. It’s time to learn that.


Windows Phone 7: Trial (Paid) vs. Free

1/31/2011 5:58:24 PM

It’s been about 2 weeks since I rereleased Tic-Tac-Toe 3D for WP7 as a free version. First days have seen a peak of interest from being a “new” free app, so I waited for some time to pass before making any conclusions. It seems that usage has stabilized over the past week, so let’s take a look at the stats.

The Stats


That’s “visits” which roughly represents the number of times the game was launched during a day. The average is 147 visits per day (~116 visitors per day).

At the same time a paid version of the same game demonstrated this usage:


That’s a whooping 3.7 “visits” per day. That’s almost 40x difference.

There are a couple of interesting points about these stats:

  1. the paid version has a free trial which is a fully functional single player game
  2. I promoted the paid version when it was released to some extent (video, featured in couple WP7 blogs, etc.) and did nothing for the free one (aside from using it as a case study app for AdDuplex)

The Economics

Despite huge difference in usage the economics of both versions could be pretty similar. The paid version sold 22 copies in 7 weeks which is about $15 after MS takes it share (where’s that Ferrari dealership phone number?) and the free version displays about 3300 ads a week which would be about 23,000 in 7 weeks. Assuming $1 CPM rate (which I guess is reasonable if I ran pubCenter instead of awesome AdDuplex) that would be $23 which is comparable to the revenue from the paid version.

But that’s not what I want to emphasize. Remember that paid version has a free trial which is a fully functional single player game (I guess the vast majority of the users use that anyway).

Trial API != Lite API

When Microsoft introduced a Trial API on WP7 it was in part targeted to be used to create Lite and Premium versions in one. What my stats above show is that the system doesn’t work in this capacity. The current trial mode is only good for making, well, trial – a mode which demonstrates application’s capabilities but is essentially unusable.

No one is looking at paid apps without intention to spend money. Even if the app has a fully usable free trial (with some premium features available to paid users) no one is going to try it. That’s a sad reality.

For my game it’s safe to assume that at least 80% of users would be satisfied with functionality available in the trial of the paid app (no 2 player mode and no high scores board). So the usage of the “paid” app should be no more than 20% less than for the free one, not 40 times.

The conclusion for the moment – for Lite/Premium combo your best bet is creating 2 apps.

We Need Lite API

Actually we don’t. I think it can work with current Trial API with these modifications on organizational level:

  • developers can specify (when submitting to Marketplace) that the app is Lite/Premium, rather than Trial/Full. All using the same Trial API
  • some procedure should be in place for testers to verify that Trial mode is actually Lite mode (no time bombs, fully usable basic functionality, etc.)
  • Lite/Premium apps are listed in Free section of the Marketplace.

Makes sense?

P.S.: on a side note you should check my Tic-Tac-Toe 3D game. It’s pretty nice and engaging. Zune links: free with ads, trial/paid without ads.


Copyright © 2003 - 2014 Alan Mendelevich
Powered by BlogEngine.NET