CLM logo Development Blog by CLM

Strange situation with Anodia Lite downloads

We haven’t released any ‘numbers’ post yet because it takes some time to get all of the required statistical data and provide analysis (otherwise it’s somewhat pointless). Currently we are experiencing very strange numbers situation and we decided to share.

For some reason downloads of Anodia Lite raised a lot in the latest days and we have no idea what is the reason. Usually such situation is related to some review, holidays or mention in media, but it seems that this is not the case this time. This is affecting a lot of countries, not only the US. We checked the iTunes in the most popular countries, but there is no sign of being featured (App Annie says Anodia Lite isn’t featured too).

Here is the graph with Anodia Lite downloads from the last 3 months:

It’s needless to say, we hope it will last for a long period of time ;) . Anyone experienced such situation in the past?

Notes on using NSURLRequest

There are a few cases where NSURLRequest becomes handy. For example, we are using it to resolve redirects for URLs and decide where should we open the resolved URL (ie. inside App, Safari, AppStore). It’s possible to make a subdomain like http://review-game.yourdomain.com which redirects users to the AppStore. In my opinion this is a good separation between action and custom URLs — in case that Apple changes anything in review URLs, we can just change URL redirection on server and it works without the App update.

Review URL is a tricky example, because there is a direct link to the App review form for iPhone/iPod, but for iPad there is no such thing and we need to redirect user to App page. We solved it with a simple PHP script:

<?php
$userAgent = $_SERVER['HTTP_USER_AGENT'];
$iPad = strstr($userAgent, "iPad") ? true : false;
$iPodURL = "http://custom-link-for-ipod.com";
$iPadURL = "http://custom-link-for-ipad.com";
$URL = $iPad ? $iPadURL : $iPodURL;

header("Location: $URL");
exit;
?>

There is only one catch — there is no device information included in default NSURLRequest user agent! Default user agent is AppName/Version CFNetwork/485.13.9 Darwin/10.7.0 (versions may vary).

Fortunately it’s very simple to change it, but instead of NSURLRequest we need to use NSMutableURLRequest. Then it’s possible to change userAgent:

NSString* userAgent = @"My custom user agent";
[request setValue:userAgent forHTTPHeaderField:@"User-Agent"];

We decided to include App name, version and device information and that’s currently enough.

Anodia 2.0 Sneak Peek #1

The next Anodia update will be a big one and we decided that it will be 2.0 version. Don’t worry — it’s going to be a free upgrade as promised.

There will be a lot of new content, but probably most players are just waiting for new levels, so we decided to show two of them:


Anodia new level 1 Anodia new level 2

Technical debt

From Wikipedia:

Technical debt (also known as design debt or code debt) are synonymous, neologistic metaphors referring to the eventual consequences of poor software architecture and software development within a codebase.

One of the typical software development practices is to have fixes and workarounds in code that are not necessarily correct, but makes everything work fine from the user perspective. Such code is very hard to maintain and the longer it stays in the code base, harder it gets to get rid of it.

We made some sacrifices in our code base and processes to get Anodia released and we fixed this during development of the second update. This way we were able to release Anodia earlier, but it required extra time to get things right later. We could leave as it was before, but this is not approach that we want to follow. We are reusing a big part of our code base (encapsulated as a separate ‘framework’ project) and we need to be sure that it’s working correctly and we can focus on game development.

From our experience it’s fine to get some technical debt at the end of product cycle, but it’s required to pay it back at the beginning of the next cycle. If not, you might get maintenance time bomb and at some point there will be no time for new functionalities because of the bug fixing.

Why this is taking so long?

The question that we get very often is ‘Why it takes so long to get Anodia updated?’. The answer is very simple: it takes time to get things done.

Actually there are a few reasons why it seems that it takes forever:

  • Content — the first reason is the scope of the update. It’s going to be big because we’re not only adding new levels but also lots of functionality. To be honest, the new version will have twice as much content as the first version. Development of Anodia took about nine months prior to the original release and we have the same resources. It’s 7 months since release so it’s not so strange that the update is still in the works.
  • Organization — paperwork takes a lot of time and during the last half of the year we were doing a lot of this — registering the company, changing developer account from individual to company, etc.
  • Software — we made the transition to Xcode 4 and done some changes in our scripts to adapt everything to the new environment.
  • Hardware — we updated our hardware (especially one used for CI) and it took some time to get it configured.
  • Technical Debt — this one is so important that I’ll prepare separate entry about it. In summary: when you are making some compromises and workarounds in your code base and tools, you need to fix it at some point.

Hope that this clarifies the current situation a little bit, please be patient and we hope it will be worth it :) .

Debugging iOS HTTP connections with Fiddler

Recently we were experimenting with NSURLConnection and for some reason it was not working as intended. URL received in connectionDidFinishLoading was different than the one from redirects done on our server and verified in the browser. We double checked the implementation and decided to take a look under the hood and see how the connection is actually performed.

There is a great tool for Windows called Fiddler2, HTTP debugging proxy. With a very small amount of configuration it’s possible to see all HTTP requests done from the device.

In the Fiddler just check “Allow remote computers to connect” in “Tools” -> “Fiddler Options” -> “Connections”. On the device edit connection configuration and set IP address of the PC with Fiddler as the proxy address and 8888 as the proxy port (can be changed in Fiddler configuration). It’s as simple as that!

And what about our problem? We forgot about caching! After changing cachePolicy of NSURLRequest everything works perfectly.

It might be a little strange that iOS developers write about Windows tool, but we are using multiple platforms in our daily work. And if you’re looking for a cross-platform alternative there is one called Charles but it’s not indie friendly (paid, I mean).

The Road Ahead

Big update for Anodia is still under development, and the New Year is a great time to start a devlog.

The plan is very simple, we’re going to write about everything interesting that is happening with our projects, share technical details and provide some tips. Being an independent developer encourage us to share with the world as we get a lot of knowledge from other developers. Currently we want to keep our entries short, yet with as much information as possible.

There is no schedule, but we hope that we’ll get at least 2-3 entries every month.

Stay tuned!