Dependency Injection (DI) is a common pattern used in all forms of development for a number of reasons. Thanks to the Dagger project, it’s taken off as a pattern used in Android development. Recently changes in Android 9 Pie have meant that we now have more options when it comes to DI, specifically with the new AppComponentFactory
class.
Dependency Injection is huge when it comes to modern Android Development. It allows for less code overall when trying to get reference to services you share across classes, and decouples components nicely in general. In this article, we’ll be focussing on Dagger…
Welcome to the third instalment in this series of byte-sized blog posts, where we look at Android Then and Now. We’ll go through bits and pieces of Android development that have changed, and look at why and how they are what they are today in less than five minutes of reading. We’ll cover things like layouts, dependency management, background work, camera usage, navigation and much more!
Today we’re looking at Navigation, from ActivityGroup
to Composable
s.
Multi-Activity navigation is where it all started. An Activity
gives you access to a Window
, and the intent system lets you move between Activities without…
Welcome to the second instalment in this series of byte-sized blog posts, where we look at Android Then and Now. We’ll go through bits and pieces of Android development that have changed, and look at why and how they are what they are today in less than five minutes of reading. We’ll cover things like layouts, dependency management, background work, camera usage, navigation and much more!
Today we’re changing tack, and looking at a style of programming which is slowly becoming less prevalent in Android development: Callbacks.
Callbacks are all over the place in Android Development. That’s simply because they…
Earlier this week I mentioned to a colleague that for the longest time enum
s were discouraged in Android Development. To developers new to Android this fact is apparently pretty mind-boggling — just look at the code we write today with Kotlin! Android development has changed a lot over the years, and looking back at things like enums shows just how far Modern Android Development has come.
Join me in this series of byte-sized blog posts where we look at Android Then and Now. We’ll go through bits and pieces of Android development that have changed, and look at why and…
View Binding is an upcoming feature in Android, available in Android Studio 3.6 Canary 11+ which allows you to more easily interact with Views. It’s quick and easy to enable, and allows for type-safe view access. We’re likely all going to be using it in Fragments. Let’s explore how we can use it, in a safe and easy way!
Let’s take a look at the example from the View Binding Documentation. First we define some layout file:
result_profile.xml
<LinearLayout ... >
<TextView android:id="@+id/name" />
<ImageView android:cropToPadding="true" />
<Button android:id="@+id/button"
android:background="@drawable/rounded_button" />
</LinearLayout>
This then generates a “binding” class, ResultProfileBinding
. This…
If you work on an application which uses Firebase Remote Config or something similar, you’ve probably wanted to test remote changes and run in to some trouble. Making sure config changes work before shipping them to the public can be painful without complex bespoke solutions. We wanted to make it easier for both our developers and our testers, so we developed Konfigure.
Konfigure makes the use of tools like Firebase Remote Config easy by simplifying what it takes to wire up properties to actual remote values, saving you time and making things tidier. It’s built for extension, and can do…
In the previous articles we’ve seen what property delegation is, how we can use it to seperate concerns, and implement complex getting and setting functionality. This article takes a different approach, looking at a real world problem and evaluating a bunch of different solutions. In this article we’ll see how Property Delegation, in some cases, can be comparable to Dynamic Proxies and Annotation Processing + Code Generation.
One common component required for large Android applications is some form of application configuration. This allows developers and product owners to roll out or tweak features remotely, and measure user impact. One choice…
In the first entry of this series we looked at Kotlin Property Delegation in its most basic form, the ReadOnlyProperty
and ReadWriteProperty
. These provide a simple way of us extracting getter and setter functions into a separate, portable class. As we saw in the last post, there are some things we haven’t used yet — the thisRef
, and property
parameters. In this article we’ll look at what we can do with these, and put them together into useful property delegates.
ReadWriteProperty
Let’s first have a look at the definition of ReadWriteProperty
, to get an idea of how these extra parameters come…
Kotlin is an extraordinary language, which is gaining traction at an incredibly fast pace. From it’s 1.0 introduction in February of 2016, it’s quickly become the primary language for Android development for a lot of people.
In this series of short posts, we’re going to explore one specific part of Kotlin which I think is underutilised — Kotlin Property Delegates. We’ll start with the basics, go further to see how far we can take them, then compare them to what we had in Java.
Delegation is the act of delegating, defined by a quick Google Search as
Delegate: entrust (a…
Trade Me is an old company, about 20 years old. Throughout its time it’s been one of the largest eCommerce sites in New Zealand, allowing kiwis to connect and trade goods in a safe manner. Recently we’ve reached a huge milestone — more than 2 billion listings created on the site since Trade Me’s inception. Just over 2 billion actually, 2,147,483,647…
Google I/O 2019 introduced In-App Updates in Android via the Play Core library. Using it you can ensure users keep up to date by prompting them passively, and you also have the ability to force the user to immediately…