Using Android Java libraries with Xamarin (pt. 1)

This is part 1 of a 2 part series: part 2

In this part, I will show you a cool feature of Xamarin.Android that you probably don’t know about: the ability to embed .java files directly in your C# project and then execute that Java code.

Java? Why?

Have you ever Google’d for how to do something in Android and found some Java code?

What are the options for using that Java code in your Xamarin app?

If it’s a large library, like an SDK, then you’ll want to get the .jar and create an Android Binding Library. That’s the topic of Part 2 in this series and we won’t talk about that further today.

If it’s a small bit of code, then your options are: 1. Convert the Java code to C# manually, 2. Include the Java code in your app and call it (the topic of this post)


I first learned about this feature by stumbling across a Xamarin sample.

If you’re not familiar with the Xamarin samples library, I recommend that you have a look through

Xamarin have a comprehensive library of samples for all areas of the platform. They’re really good at keeping them up to date as new versions of Xamarin are released.

It’s a great way to discover features that might come in handy one day.

Read more »

Native cross-platform mobile apps with C# and Xamarin.Forms

And now for something completely different!

For the last 9 months I’ve been working on a mobile application built with Xamarin.

The first version of the app was built for Android using MvvmCross.

When I joined the project, we were just about to start the iOS version of the application and I put forward a proposal to switch out native layouts and MvvmCross and go with Xamarin.Forms instead.

Since then, I’ve learned a lot about mobile app development and Xamarin in particular. Using Xamarin.Forms in a production application has been fascinating, especially dealing with the ups and downs of building a cross-platform application.

Last month I had the pleasure of speaking at DDD South West 6 on building cross-platform apps with C# and Xamarin.Forms.

Here is a recording of the session and also the companion slides:

Creating A New Blog With Jekyll

This is part 2 of a n part series: part 1

Running Jekyll Locally

In the last post I went through some of the reasons why I wanted to convert my blog to Jekyll and GitHub Pages.

I mentioned that you will setup your blog scaffolding once. Then for each post you’ll write simple markdown files. GitHub will convert these markdown files to HTML.

The thing is, it’s nice to know how you’re site is going to look before you commit your post to GitHub.

When working on posts it’s not really necessary. When working on the original scaffolding of your blog though, you’re best to test the changes locally before committing to GitHub. You don’t want to trash your site, do you?

So you should install the Jekyll environment - and you should install it in exactly the same way that GitHub Pages does.

GitHub has published a step-by-step guide on how to setup your environment.

Read more »

Converting A Wordpress Blog To Jekyll

This is part 1 of a n part series: part 2

What’s wrong with Wordpress?

I know a work colleague who is a PHP developer and I’ve learned a very important lesson while having beers after work: don’t mention Wordpress.

I’m a lot more forgiving. I started my first blog on Wordpress because it was easy. There are lots of competitively priced hosting options that provide pre-configured environments with PHP, MySql and other components required to run a WordPress site.

Additionally, it’s incredibly easy to add functionality through plugins. For example, levelupcoder we had 8 plugins installed that added nice features things like automatic backup, social media sharing buttons, Google Analytics, automatical image optimization etc.

So when my PHP friend mentioned that he hosts a blog on GitHub Pages with Jekyll, I was wondering what that was all about.

Read more »

Report Protractor Test Results on TeamCity


You’re probably using Jasmine to run your Protractor tests.

By default, Jasmine reports test results in a human readable form:

Default reporting in Protractor

While this is great for us, it doesn’t mean a lot to TeamCity. If you use the default configuration these tests will not show up on the builds ‘Test’ tab.

Show how can you report Protractor test results on TeamCity?

The good news is that TeamCity expects a standard format for reporting test results.

If your testing framework can emit test results in this format then TeamCity will show the results in the “Tests” tab of the TeamCity UI.

Read more »

Using Protractor mocks for AngurlarJS tests without backend (pt. 3)

This is part 3 of a 3 part series: part 1, part 2


In the last post I showed how to write Protractor mocks to test an AngularJS application without a live back-end system.

In the sample application on Github, I mocked out a response to a GET API call and tested that the application displayed the results in the AngularJS application correctly.

That worked well for the mocking out the GET, but what about applications that are CRUD (create/read/update/delete) in nature? To test this type of application you would also want to mock these type of calls also.

Also, how can you test how your application behaves when your API returns errors - like “Not Found” (404), “Precondition Failure” (412) etc?

Read more »

Using Restangular and ETags for optimistic concurrency (pt. 2)

This is part 2 of a 2 part series: part 1

I’m going to step you through an ETag implementation based on a sample application I’ve written on Github

The Application

Let’s see the ETag implementation in action:

  1. Open the solution In Visual Studio 2013 and press F5 to run the application.
  2. Once the web page loads you’ll see a list of employees.
  3. Click on an the name of an employee and you’ll go to the “Edit Employee” screen
  4. Now open a new browser tab and navigate to the same employee
  5. In tab 1 - change the name of the employee, then click save. No error should occur.
  6. In tab 2 - (without refreshing the page) change the name of the employee, then click save. An alert should appear:

Read more »

Using Restangular and ETags for optimistic concurrency (pt. 1)

This is part 1 of a 2 part series: part 2

Restangular and ETags

I’ve mentioned Restangular in a couple of previous posts. It’s a really cool AngularJS service that simplifies access to REST back-end APIs.

One of the cool, but little talked about, features built into Restangular is support for ETags…

What is an ETag and why do I want to use them?

ETags were originally conceived for caching purposes.

Read more »