Setting Up Amazon’s Dash Replenishment Services and Login with Amazon on Android

On my current project, we’re integrating Amazon’s Dash Replenishment Services (DRS) into an Android app. DRS allows “smart” devices to automatically reorder supplies from Amazon if users of the device (and accompanying apps) opt in. For example, a washing machine might order more detergent, or an electronic device might order more batteries. The order is triggered once that refillable item gets down to a certain point. 
Read more on Setting Up Amazon’s Dash Replenishment Services and Login with Amazon on Android…

Sending Data Between Activities in Android

Android Intents are objects used to trigger actions from other Android Activities. One of the most common uses of Intents is to open a new Activity in your app. Often, you will want to pass information to the new Activity. In this post, I’ll discuss a few ways to pass data between Activities using Intents, including passing primitives, Strings, and object types.
Read more on Sending Data Between Activities in Android…

Getting Android ListView Right the First Time

ListView is an Android UI element commonly used when you want to display a scrollable list of items. Unless you have a simple, static list of items, you’ll probably end up subclassing BaseAdapater in order to provide content for Android ListView. The basic process of doing this is fairly straightforward, but there are a few mistakes that are easy to make if you’re not careful.
Read more on Getting Android ListView Right the First Time…

Espresso – Testing RecyclerViews at Specific Positions

My team recently added a RecyclerView to a screen in an Android app we’re working on. It’s a horizontal view that allows a user to scroll left and right to see content that’s offscreen. One of the challenges we’ve faced while working on this view has been testing it in our Espresso tests—specifically, testing the contents of items at certain positions. In this post, I’ll show you an Espresso matcher that can be used to aid in testing RecyclerViews.
Read more on Espresso – Testing RecyclerViews at Specific Positions…

Automating an Android Instrumentation Test Run

I recently spent some time working through ways to automate running an Android test suite on my MacBook Pro. I found helpful bits and pieces all over the place—from Stack Overflow answers to blog posts talking about how to get Android into various CI servers (Travis, Jenkins, etc.)—but the information was scattered. In this post, I’m going to document what I learned while writing an Android test script.

Read more on Automating an Android Instrumentation Test Run…

Evil Android Styling

I love writing applications for the Android platform, partly because I find that there are a lot of very nice abstractions in the Android APIs. One of my favorite features is how easy it is to style the platform widgets.

If you haven’t worked with Android styling before, I’d like to introduce you to some of the key concepts by having a little fun and breaking as many design guidelines as possible in a one-page application. We’ll create rounded rectangles, borrow iOS patterns, and promise to apologize afterwards for being “evil”.

Our Application

I’m going to use a very simple application with just two activities. The first one includes a few stock widgets, and the second activity includes the same widgets, with our non-Android styling. You can clone the application repository from Github if you’d like to play around with the code. Read more on Evil Android Styling…