Converting JSON to Kotlin

Generating Kotlin data classes using Square's KotlinPoet

Have you ever got bored writing Kotlin classes which serialise a JSON payload? Me too. Fortunately, we’re going to write a Kotlin library that automates the whole process, using Square’s awesome KotlinPoet. We’re also going to create a command-line tool and Spring Boot application, then deploy both to production. Creating the core Kotlin Library We’ll start by generating an empty Kotlin project with a module named core. This module will contain all the conversion code, so we should define an API that encapsulates most of the gory details. [Read More]

The machine that goes PING

Developing a Gradle Plugin that detects build completion

Gradle is an 800lb magical gorilla that can be incredibly intimidating at first glance. We’re going to harness some of Gradle’s superpowers by writing a plugin that alerts us whenever a build completes. Essentially, this guide will teach you how to turn a shiny MacBook Pro into a machine that goes PING. What is Gradle Gradle is simply a tool that builds a project, and provides a very flexible API for manipulating each step of the process. [Read More]

Playing APK Golf

Reducing an Android APK's size by 99.99%

In golf, the smallest score wins. Let’s apply that principle to Android. We’re going to play APK golf, and create the smallest possible app that can be installed on a device running Oreo. Measuring a Baseline We’ll start off with a default app generated by Android Studio. Let’s create a keystore, sign the app, and measure the file size in bytes using stat -f%z $filename. We’ll also install the APK on a Nexus 5x running Oreo, to ensure that everything works. [Read More]

Hello World, Hello Android!

Migrating my Android portfolio to Hugo

Hello World, Hello Hugo, and Hello Android! This website originally started off as a portfolio site with some hacked together HTML. Over time, as I developed more Android applications, that workflow got a bit too complex. Therefore, I’ve moved the entire site over to the Hugo static site generator for the foreseeable future, which makes things a lot easier. The original focus of the site was just a portfolio displaying Android, iOS, and other mobile projects which I’d completed during my time in the Bath/Bristol area. [Read More]