Never miss a beat

Join my newsletter.

Tag: android

What is Android's SurfaceFlinger

Published: 3/4/2019

Android’s SurfaceFlinger is a system service provided on the Android Operating System. Now that that is out of the way… What does it actually do? If you’ve worked with scrolling, you’ll know that “flinging” is an action that a user can do, but it’s not related to that. Actually, the SurfaceFlinger is a service that plays a critical part in determining what is rendered on the screen on any Android device. It’s important to note that the SurfaceFlinger doesn’t directly render anything to the…

The Complete Guide to Dimensions in Android

Published: 2/8/2019

Figuring out when to use dimensions in Android can be a tricky time. Should all values be a dimension? How about none of them? You could argue that both of these are valid, but I’d like to clear the air with the statement “sometimes you should use dimension values.” But how do you know when? Dimensions for Reusability The simplest reason to use a dimension value is when you know that value needs to be reused. If you were to change this value in one place, you would want to change it elsewhere…

Formatter Objects: Testable Fragments

Published: 1/24/2019

Let’s face it — Fragments are a pain to test and it’s predominantly due to how the Android operating system works. Sometimes, you’ll find yourself writing business rules regarding how a view is displayed. Likely, some data will come back from a web server and you’ll have to format some text differently or color something differently. Nothing crazy, but all this code adds up and needs to be tested. Ideally, you’ll have some form of automation coverage to help tackle this problem, but Espresso…

Using ButterKnife with Kotlin

Published: 5/16/2018

Butterknife is a simple but fantastic tool for Android development. When this was introduced, it really simplified my thought process regarding view bindings in my activities, fragments, or view holders. As Kotlin adoption grew, Jake Wharton (creator of ButterKnife) also created KotterKnife , for kotlin-esque view bindings. KotterKnife isn’t bad, but I prefer the annotation syntax of ButterKnife instead! Implementing ButterKnife with Kotlin has a few gotcha’s however, that may be a bit…

What the heck is Android's Proguard?

Published: 2/21/2018

Hello there Android developer or curious onlooker. Welcome back to another blog post talking about your favorite, my favorite, and the world's favorite mobile operating system. Today we're going to talk about Proguard and what that means for Android Developers.

Android: Pending Intents

Published: 4/3/2017

So you’ve been working with Android for weeks now, and you’ve all but mastered the ability to start a new activity with an intent. Here’s the kicker – There’s far more to Intents than starting a new activity when a user clicks a button, and today I’ll share my knowledge of pending intents. Note: This is an abstract piece on pending intents. Code is minimal to show the essential pieces of pending intents and provide clarity on what they do. This code is not copy/paste friendly nor will we be…

Android: ListView, RecyclerView, Adapters

Published: 9/27/2016

I recently started working on part three of my Zero-To-Hero series, which gives us a chance to leverage a RecyclerView and List Adapter for our Todo/Habit application. Though I cover them in that tutorial as well, I feel like they deserve a post to themselves to go a bit more in depth. Code examples are taken from the Turnip app that we build in the Zero-To-Hero series. ListViews So what is a ListView? It’s a very commonly used view group in the Android ecosystem and is used to display a…

Zero to Hero: Android App - Part 2 - Database

Published: 9/26/2016

Oh, hey, didn’t see you there. Glad that you’ve came back for the next part of my Zero to Hero series! Let’s get right into it! Last time, we created an Android app from Android Studio and manually created the View (or the visual representation of one of our screens) for our application. If you’ve missed out on that piece, you probably want to go back and start there, as all of the other posts in this series build off of that one. You can find it here . In this post, we’re going to talk about…

Zero to Hero: Android App - Part 1 - Views

Published: 9/15/2016

App development is never a straight-forward task. In fact, apps are built from many components that handle specific needs. It’s up to you, the app developer, to determine which components you need, how they should be implemented, and how they should interface with the rest of the app. The most common component is called a View. Android Views Look around. What do you see? Sure, the specifics of what you and I see are different, but they both represent the same concept. We both see things that…

Zero to Hero: Android App - Part 0 - Overview

Published: 9/13/2016

I’ve decided to try something new with this post and start a new series called Zero to Hero . The concept behind this is simple – From no knowledge about the proposed domain, we’ll create something cool and get you started with the fundamentals of that domain. Zero knowledge isn’t to say I’ll teach you how to build something as if you have never touched a computer, but it’s, for example, an interactive and fun way to learn Android given: You know what an Android phone is, you’re somewhat…

Overriding Button Styles in Android

Published: 8/22/2016

Android comes with a ton of widgets, gizmos, and gadgets (maybe just widgets) out of the box, but it can be difficult to find one that works exactly how you would expect it to. My advice is this – find one that functions the way you want it to and override the styles to make it look the way you’d like. If that doesn’t work, you can always create a custom view, too! For now, let’s assume that will work, and I’ll show you a recent example where I decided to use Android’s ToggleButton, a widget…