Thursday, November 27, 2014

Developing for Windows Phone - a story

Around three years ago I bought one of the first models of WP7 phones to appear - HTC Mozart 7 - which was very similar to the Android-based Nexus One. Wanted to see what's like to be an early adopter and early player in the app marketplace.

I managed to get a free app registered on the app store: Fast Offline Translator EN-DE.
I did it mostly for myself as I knew very little German. Not much has changed since.

This is the story of doing the development, deployment and update for that app.


In order to become a developer for WP you had to pay an anual fee of 100$ or 100 EUR, which seemed like a bit too much for a starter platform. In the meantime the fee has been reduced and eventually changed to a one-time payment.

In order to pay the fee the official website said something like "To be paid at the Zune Store" or XBOX store, cannot really remember, they haven't had their shop set up yet. The only way I could get money onto the XBOX store was to buy points - so I bought XBOX points worth of 100 USD.
You can see where this is going, the link and the information was wrong so I'm left with 12000 points of something. The payment had to be done via a different link, established especially for WP. Any ideas how the points can be redeemed?

In order to actually publish on the store you have to have your identity verified so I got a Skype chat from some guy, sent a copy of the passport via email/fax and had to stand on one leg with one arm out and one holding the nose.
I would rate it 5/10.


Starting an application requires that you have Visual Studio Express, some Blender-like designer program, the phone emulator and some supporting libraries. It was around a 2GB download size, probably around 8GB install size and it's spread throughout your system.
Compare this to a one-time download size for Android: Eclipse or Developer Studio, Android SDK and Java (included) - that's also portable, i.e. can be moved from one folder or even computer to another.

I haven't really used Visual Studio, I heard it's the industry standard for C-based programs, but it feels years behind Eclipse for Java. There's no hot code replace ( ), keyboard shortcuts are different and get in the way, visual design with XAML was a mess that's impossible to debug, code completion is worse and debugging feels more like an afterthought than a main feature.
Rating 3/10, I will detail this in the "Updating" section.


The API was really inconsistent, cannot remember right now but any API that you have to fight with it to do string replacement is wrong.
Quite a few strange paradigms and design patterns were used, it needs some time getting used to that. It also made debugging more difficult as some calls were delegated to the platform itself and ended up in some undebuggable DLL.
But I assume that's my problem, coming from Java where mostly everything is open-source and traceable.

The good part is that I managed to write a decent application within one or two days: a dictionary for English to German and viceversa translations.
Interesting technical detail: my target was to get a search match within 2 or 3 seconds so I've tried various database implementations and played with indices for a few hours - it still took more than 5 seconds. In the end I did it all  RegEx search inside a plain text file.


After filling more than twenty fields and providing some screenshots you can submit your app to the store. Unfortunately you cannot reuse those fields so you have to type them all over again.
Also, as far as I know you cannot just modify the description of the app without going through the whole process again.


After the first submittal the app went through the verification process. There was an actual human at the end of the chain! Someone actually played with the app and rejected it - one operation which took more than 2 or 3 seconds did not have an indeterminate (infinite) progress bar at the top.
I fixed that and resubmitted the app and it went through pretty quickly, probably only spot checks were done.

Tracking has some pretty useful graphs, nothing out of the ordinary though. Its around 2 days behind and has only some basic kind filtering - does not support phone type for example.

One really nice feature is the crash count per day: you can see if some updates broke or improved your app stability. You can also download stack traces from some of the crashes - it helped me find at least one bug.

I would say it does the job, 7/10


If you are staying on the same platform (only Windows Phone 7 for example) and keep the same OS on your computer (Windows 7) it would work fine. You still have to fill all the fields when publishing, upload new screenshots and have the app reapproved.
If only this was everything required it would probably score 7/10 - but it gets much uglier than that.

After two years I wanted to release an update for my app: the first WP iterations (7.0-7.2) only had support for a handful of languages and countries and you were stuck with only a handful of possible combinations that I have fully tested.
As the platform expanded to cover the entire world I started getting strange stack traces and negative reviews. It seemed quite a lot of handful of people chose one country, a different language and yet another country for the app store. These crashes plus the unavailability of the app on the new market stores determined me to publish an update.

In the meantime I had reinstalled my computer with Windows 8.1 so I had to redownload the new Visual Studio and phone developer tools: >5GB download size, >20GB installed size.
Surprise: the new tools do not support WP7 anymore so I cannot update my old app. I would have to have a Windows 7 installation somewhere just for this purpose. Also, developing for WP8 and above is not possible on Windows 7 anymore, AFAIK.
Importing the old project was painless but it required an irreversible update to the project. This means I will not be able to import it in an older version of Visual Studio, so I cannot reuse it for the above purpose (Windows 7 machine).

Also the new installation created a lot of new virtual network interfaces. Normally this shouldn't bother anyone but if you are wondering why your WORKGROUP loads really slow just try disabling those. It also installed MS Virtualization Server which caused some of my accelerated Oracle VirtualBox machines to break.
I ended up doing the required app update and uninstalling the WP developer suite. Don't ask for any more updates.
Rating 2/10. It can do the job, but why?

Developing bonus

To change the title of the application you have to make a new DLL project. You download the template off of somewhere, changes some things here and there, compile the DLL and copy it inside your app folder. All the strings are hardcoded at compilation time.
After I forgot how to do this anymore I ended up using a resource editor to change the strings in the DLL binary.
After 2 years, with the multiple languages rollout, my application somehow got renamed to a really strange string on locales that I did not considered. It took me quite a while to find out that this was caused by the forgotten DLL.


I guess the customer attractivity of the platform is caused by the low-cost phones. This means a huge growth rate, especially in developing countries. However the people there will most likely not buy any app.
Since developing for this is such a different process than everything else - and so convoluted - it makes little sense for a company to focus its efforts on a platform that has a pretty small penetration rate in developed countries. That's true especially considering the fact that none of the code can be reused.
There are a few cross-platform frameworks but many of those do not cover Windows Phone, probably because of the above. So it's a Catch-22 situation, really.
If you really want to develop cross-platform right now the best bet is to develop in plain HTML + Javascript and just repackage the app. Hopefully you also don't care about performance.

No comments:

Post a Comment