Dev notes: Getting it out the door

It’s been busy lately, and I’ve been able to wrap up a big project: Doki is now available for download from the Windows Phone store.

The total development time was three months for the beta version, and another month for polishing and waiting for the Feedly API keys. I decided to shoot for an early MVP release and to continue with adding lower priority features.

On the one hand, it helps a lot to have other people checking for bugs, because there’s only so many combinations of settings and scenarios you can test on your own. On the other hand, there have been at least two other Feedly clients released while Doki was in development, and the unveiling of Windows 10 for Phones is looming on the horizon. There’s no telling which features and APIs will still be available, so each month of extra development time might mean a month less of total lifetime. The world of WP development is moving incredibly fast right now. Chances are that in less than a year, there won’t be any handsets left that are compatible with WP8.1 applications.

But anyway. There’s enough left to implement. And there’s lots of interesting techniques that made their way into this release.

WP8.1 doesn’t come with a built-in database anymore, so I went with flat file storage. Basically, it’s a bunch of XML that’s compressed in real-time. It’s actually faster to compress text and then save it to flash memory, instead of just saving the plain text data, because modern ARM cpus are fast and efficient enough for this kind of task. There are some other goodies in there that will eventually make their way into my big bag o’tools.

It’s surprising how many steps are necessary to achieve something as basic as listing a news feed. Parsing JSON, loading a favicon, counting articles, checking for read and unread ones… all this has to happen in real-time. This is where the asynchronous way of doing things in WP8.1 really shines. Update the UI, pretend you’re done, and just continue to do the time consuming stuff in the background.

Of course, this makes for a cesspit of race conditions under the surface, so there’s lots of mutexes controlling the file operations. Multi-threading is fun and games until you have to use a resource that can only be used once at a time – like the file system. Attempting to update the same file from two different threads at the same time can only end in tears.

I’m sure that there’s still a fair share of scenarios in the app where the right combination of UI input will result in corrupted files. Welp! Life would be boring if everything ended up perfect on the first try.

by