Ryan Harter

Posts

Cloud Build Recipes - Saving the Build Cache

When building development projects on your local workstation speed is important. A quick feedback cycle can mean the difference between a productive day of test driven development and a day filled with distraction. Your continuous integration environment is different. Since CI is responsible for preventing bad code from being merged and creating production releases, most people value precision over speed. That’s why most CI environments utilise isolated build environments and always run all of the tests....

Cloud Build Recipes - Incrementing Build Numbers

Many CI services use an incrementing build number to identify builds. GCB, however, uses a randomly assigned unique identifier, as is common in large scale systems. While this is common and helps make GCB infinitely scalable, it makes it difficult to reason about the relationship between builds. Since I like to use the CI build number in my Android app versioning, I decided to reimplement this functionality using a simple script and text file stored in a shared location....

Google Cloud Build for Android

As I’ve written before, I’m always on the lookout for a great continuous integration and delivery system. For a long time I used CircleCI, but in the last month or so I’ve started hitting some limitations that I needed to work around. My requirements are pretty standard, I need something that works well with Android, requires minimal maintenance, and can handle somewhat larger projects. After a souring experience with CircleCI, and a short search for other hosted providers, I stumbled upon an early solution from Google that intrigued me....

Android Development on a Pixelbook

A couple of weeks ago I bought a Google Pixelbook. I’ve been doing a bit of Android Development on it, mostly to optimize Pigment for Chromebooks. It’s taken some experimentation and discovery to find out how to get things set up, largely because the Android documentation is slightly out of date, so I thought I would share my experience, hopefully saving others time. This post serves as a step by step guide to getting up and running with Android Studio on a Pixelbook (and, hopefully, other Chromebooks as well)....

Introducing Billingx

A few months ago I was tasked with rewriting the subscription code for Pigment, the coloring book app I work on at Pixite. Our users were suffering from a bug causing paying users to sometimes lose access to premium content, and the original implementation was somewhat hastily written, so I decided it made sense to invest the time to rewrite the billing code from scratch. Play Billing Library Google makes interacting with the Play Store’s in app billing infrastructure pretty easy with the Play Billing Library....

Continuous Delivery for Android

For a long time I’ve been in search of a good continuous integration server for Android. I’ve even written about one that I used years ago, which is no longer suited to Android development, in my opinion. As the Android community has grown, so has the wealth of tools available. In that time I’ve also moved from simply wanting continuous integration, to wanting continuous delivery. Continuous Delivery you say? Continuous delivery builds on continuous integration, but instead of just testing your source code when you commit, it is also published to the appropriate channels....

AutoValue Extensions

This is the third article in a series on AutoValue. The first article introduced AutoValue, the code generating annotation processor for value types. The second took a more in depth look at the code generated by AutoValue, and the benefits of compile time code generation. In a previous article introducing AutoValue, I briefly mentioned AutoValue Extensions. Now it’s time to go a bit more in depth to look at what extensions are, how they work, and how they can help you get even more out of AutoValue....

A Deeper Look at AutoValue

In my last article, I gave a basic introduction to AutoValue, the code generating annotation processor that makes immutable value types in Java easy. Now I’d like to take a bit of a deeper look at AutoValue and how it works. Compile Time Annotation Processing First things first, AutoValue is a compile time annotation processor. This means that it only runs when you compile your code, as opposed to when your app is running....

An Introduction to AutoValue

Value types in Java are hard. Well, not hard, but tedious. Google’s AutoValue library makes them much easier and has just received the long awaited update that adds the flexibility of extensions. Value Types in Java Before we can talk about how great AutoValue is, let’s look at the problem it solves: value types. A value type is simply an immutable objects whose equality is based on property values, as opposed to identity....

Dealing with AsyncTask in Unit Tests

There may be a shortage of love on the internet for AsyncTasks, but that doesn’t mean they don’t have their uses. I’ve found myself using them a fair bit in the latest project that I’m working on. All in all, they make offloading tasks from the main thread quite simple, but can pose some challenges, particularly in tested environments. The biggest challenge with using AsyncTask in tested code is that, since the code runs asynchronously, it can be difficult to ensure your tests get the right result for verification....