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…

Android 4.0 Feature Review at October GR Java Users Group

I had the luxury of building an Android application in mid-late 2010. It was a fun project to work on here at Atomic — building a mobile application for Spectrum Health — but there were certain aspects of the Android API that were not particularly exciting. That experience is why I enjoyed this month’s Grand Rapids Java Users Group meeting, where we briefly covered some new features in Android 4.0.

Read more on Android 4.0 Feature Review at October GR Java Users Group…

Android App Test File Distribution with Dropbox

This last summer a few friends and I were working on a couple of small Android applications. When it came to testing the application on various devices, some of the people we approached to help test the app were not as technologically advanced as we were. For most of the people we were working with, we had direct access to their devices to help load the compiled APK files (APK is the extension of a compiled Android application). For the few people we had little or no access to their devices, we set up Dropbox to become a simple file distribution. It was a hit and we continued to use Dropbox for everyone who tested the apps.

How Dropbox Helped

For those unfamiliar with Dropbox, it is a file storage and sharing application that lives in the cloud. You can sync certain folders or the default folder setup with your Dropbox storage online (from your computer). You can manually upload and download files via a Dropbox app for many mobile devices. The app is available for Mac, Linux, Windows, Android, and iOS, and you can get a free account with 2GB of storage here (premium account upgrades are available, including team licensing). Once you have an account, you can share your folders with others.

Read more on Android App Test File Distribution with Dropbox…

Building Android Application Bundles (APKs) by Hand

If you’ve ever tried to build an Android application package by hand, you might have gotten frustrated by the ‘comprehensive’ documentation, which states:

The other platform tools, such as aidl, aapt, dexdump, and dx, are typically called by the Android build tools or Android Development Tools (ADT), so you rarely need to invoke these tools directly. As a general rule, you should rely on the build tools or the ADT plugin to call them as needed.

That’s a perfectly reasonable suggestion for most applications but occasionally you need to get your hands dirty and do some plumbing yourself. If you find yourself in such a situation, below is a quick example of how to create an APK by hand.

Read more on Building Android Application Bundles (APKs) by Hand…