Android: Testing an Intent Service

Note: The ServiceTestRule class does not support testing of IntentService objects. If you need to test a IntentService object, you should encapsulate the logic in a separate class and create a corresponding unit test instead.

There’s a handy thing in Espresso called the ServiceTestRule, which is for testing Services. Yay. I thought it was just what I needed until I read this bit of the documentation… OK, first up – refactoring my IntentService. This class already did very little, poking something else depending on the kind of Intent it received, and […]

Read More

Android: Touch to Change Image

On iOS I do this using a button (with different pressed state), and I figured it would be the same on Android, but turns out, no. Step 1: Add a second image to the XML, and set the visibility to “gone”. <?xml version="1.0" encoding="utf-8"?> <FrameLayout xmlns:android="" android:layout_width="match_parent" android:layout_height="match_parent" android:background="@color/processed_image_background"> <ImageView android:id="@+id/processed_image" android:layout_width="match_parent" android:layout_height="match_parent" android:scaleType="fitCenter" /> <ImageView […]

Read More

Further Adventures in Android Development

Danbo want to use my smart phone

I suspect one of my limitations as a programmer is that I don’t hack. I don’t beat away at something until it works. I read things, and I reason about it, and I write a lot of tests. This makes me very effective on platforms I’m familiar with, but I worry I’m as a result […]

Read More

Creating and Comparing Images on Android

A while ago, I wrote this blog post on creating and comparing UIImages. That code allowed me to develop the image processing part of the app against my unit tests, which was really, really helpful given that I rewrote it about four times to make it performant enough. So, when I started writing Android code […]

Read More

Cross-Platform Development Decisions

I’ve started to port Show and Hide to Android. There’s still a lot to do, but I hit a milestone of having it working end to end on the emulator last week, which was exciting. One of my friends asked if I was using any libraries to make it easier, and the short answer is no. But […]

Read More

iOSDevUK: Kenton Price: Teaching Your Client Android Design or Don’t be an iPhoney

android fragmentation 2014

The problem: Android devs generally given designs for iPhone. “But that’s just like Android, right?” Rid the world of these iPhoney apps now. Used to be like windows apps on Apple. People still do iOS first, Android is an afterthought. Android users want Android apps. Android users can tell when it’s an iPhone port. Android […]

Read More

My Inspiration App: App Concept

Rules of being creative #7

My app idea – a place to collect things that inspire, that can be found searching their tags, location, or type. I understand that people can and do use any number of other apps for this – Twitter favourites, for example, this is just supposed to be a purely happy and motivating place on our […]

Read More

Getting Set Up on Android

I used the event Programming Languages I’ve Been Meaning To Try But Haven’t Gotten Around To Yet at the Stripe offices (organised by Star Simpson) in San Francisco to get going on Android. Aside – I love the concept of this event. Great opportunity to hang out with your laptop, the only goal being to suck […]

Read More

Getting Started With App Inventor

app inventor

A colleague and I are running a workshop for high school teachers this week, and we plan to use App Inventor (which will now live at the MIT Media lab). So I had a play around with app inventor and it is so easy to get started. The beginner app is one where the kitty purrs […]

Read More