HttpClient for High-throughput Applications

It’s been a while since I’ve posted anything on the MobTowers blog. In the meantime, Mrs MobTowers and I have created a small human alarm clock. Lack of sleep makes me a bear of very little brain.

So, I’ve been busy! But I thought I’d jump straight into something tricky, and clear up some confusing points around the HttpClient, with particular focus on making it work well in high-throughput scenarios.

Continue reading “HttpClient for High-throughput Applications”

PowerShell Log File Viewer

Just a quick post today with a great tip for viewing log files with Powershell.

Get-Content .alltheerrors.log -wait

This command shows the content of the file line by line, and the -wait switch updates the output whenever the log file is saved, giving you a live feed of logged info.

Continue reading “PowerShell Log File Viewer”

C# – When to use the var keyword

As long as I’ve been programming with C#, there’s been a civil war. Only one subject polarises developers more than this one; tabs vs spaces anyone?

Essentially, when your app is compiled, the types of any variables declared with var are inferred by the compiler.

var myList = new List<int>();

In the above code, myList is inferred to be of type List<int>.

Generally, I don’t use var all the time, and here’s why.

Continue reading “C# – When to use the var keyword”

Thoughts on T4MVC

In short T4MVC uses a T4 template to convert your views, actions, and controllers into types which you can reference rather than using magic strings. T4MVC essentially adds static types to your MVC project, allowing you to catch misnamed views, actions, or controllers at compile time rather than at runtime. This is a great thing, but there’s a subtle problem here which I’ll go into further below. First, a brief overview of what T4MVC does.

Continue reading “Thoughts on T4MVC”

Custom Views in Xamarin.Forms

I’m a big fan of Xamarin. It is, in my opinion, the best solution for cross-platform mobile development. Xamarin enables you to produce apps for iOS and Android, written in C#, and to share a large proportion of the code, with only the UI layers for each platform being written independently. The apps produced run natively on each platform, using proper native views.

I’d like to present a quick introduction to Xamarin.Forms. Xamarin.Forms takes another big step toward code-sharing. It allows you to share the UI code as well. So you can write code such as the following in a unified shared mobile project.

Continue reading “Custom Views in Xamarin.Forms”

This is the second in a series of articles on image handling in Android. Check out my first post on using remote images in lists if you missed it.

Put simply, image handling can take its sweet time on slower devices. Once downloaded, or loaded from file, or processed, or all of the above, it would be ideal to cache any images to be quickly loaded from memory later. Simply caching images in memory creates another challenge, as there may not be much memory free on the device, and each app has a set limit.

An ideal solution to this problem is a cache which will automatically evict images once it’s full. Continue reading “Xamarin Android – Image Caching”

Create a website or blog at

Up ↑