Whether you have already adopted single Activity architecture in your Android apps or not, it can be a useful exercise to remind ourselves why this pattern works. To keep things interesting, I’d like to dig a little bit deeper than “because Google said so,” which they did (at Google I/O in 2018).
Before digging in, what is single Activity architecture? As the name suggests, your app has one activity (usually called MainActivity). It’s important to note that this Activity is as lean as possible and completely devoid of business logic. Each individual screen in your app is then represented by…
So you’ve landed an Android interview! Congratulations. Let’s get to work and set you up for success for your upcoming phone screen or (perhaps virtual) on-site.
I usually interview Android candidates at least once a week, which means I’ve talked to a lot of candidates over the years. I see similar knowledge gaps pop up again and again, and I’m hoping this list can help guide you on what topics to review before the big day.
First, let’s talk about the common structure of Android interviews. Some companies value core computer science concepts as well as Android expertise. Some companies…
Oh, JUnit tests. I’ve grown quite stubborn to insist on writing JUnit tests over Instrumentation tests (when possible, and when reasonable). If you’ve developed a few Android applications, we probably have this in common.
It’s an exciting time for Kotlin developers to adopt JUnit 5. Here’s a brief, and probably NOT all-inclusive list:
I know what you’re thinking — not another Dagger article. There are a ton of great resources out there that explain the basics of dependency injection with Dagger. This article is not one of those. I’m going to assume that you are familiar with Dagger, and I’m also going to assume that you’ve probably used Dagger in one of your applications.
The fundamental problem with Dagger and Android applications is that without
Dagger.android , any Android component that you want to inject has to know about how it is injected. We get a lot of code like this:
There’s a variety of different reasons you’d like to compose an image “behind the scenes” — and its actually quite simple.
I’ve built a custom view that has a base image and some text layered over it. The image is not stored on the user’s device, but rather on a server somewhere. I’d like the user to be able to click a button and share or save the final composition created by my custom view. The trick here is I would like to do this without visibly drawing my custom view on the screen.
What makes this tricky? Well, first…
This year at Google I/O, Android Studio 3.2 Canary was announced and released for download. Android Studio 3.2 has a variety of exciting features that support other I/O announcements, including Android Jetpack and Android App Bundle.
What better way to test these new features than to refactor an app I haven’t touched in nearly a year? Allow me to take you on a journey of refactoring a simple app that uses the New York Times Search API to retrieve news articles. You can find the source code here.
The first thing I noticed after opening Android Studio 3.2 Canary was…
Perhaps you have some sort of content that your users would like to email to their coworker or share with their Instagram friends. Perhaps you’d like to take it a step further, and get some insight into where your users are sharing your app’s content or kick off some background task once the user selects an app.
Intent createChooser (Intent target, CharSequence title,
An IntentSender is simply an abstraction around an Intent with some action you intend to perform…
Engineer, Activist, Cat Lady. Mobile engineering @ Lyft.