Who has two thumbs and has had a big couple of weeks? THIS GUY.

I have two amazing children and my wife has been pregnant with our third (and probably last). Our newest little guy was born Thursday, August 4th shortly after 11am. He was a whopping 9lb 7oz and has been a happy, healthy, good little baby. We named him Nico Jack. He has been a really good little guy. I would go on more but you’re probably here to see code so…onward!

At work I have been working with Mono for Android. I’m loving it. My company purchased Mono for Android from Xamarin a few weeks ago and I’m currently working on a mobile ecommerce application. For the most part it’s easy to find how things are done in Java and convert them to Mono but some things, such as passing extra data to an Activity, can vary quite a bit. Here’s a little snippit that has come in quite handy. It uses a simple Dictionary to cache results so that loading only happens once. It has several helper methods to actually fetch and cache the JSON (using fastJSON) but this is the main external method:

private static Dictionary<string, object> mCache = new Dictionary<string,object>();

public static JsonResult<T> GetJsonResult<T>(string url)
{
	JsonResult<T> jsonResult;

	// check cache
	JsonResult<T> cachedObject = GetCachedObject<JsonResult<T>>(url);
	if (cachedObject != null)
	{
		jsonResult = cachedObject;
	}
	else
	{
		string json = GetJson(url);
		jsonResult = new JSON().ToObject<JsonResult<T>>(json);
		CacheObject(url, jsonResult);
	}

	return jsonResult;
}