Fragments suck. State is hard. Android is hostile. How can you write a crashfree, bug free app on such a buggy, fragmented OS? In the spirit of Jack Sparrow, I’ve come up with some guidelines for making Android development less of a headache. Talk would basically be about how we’ve adapted and used each of these in the Electric Objects companion app.
- There is a one to one correspondence between a wireframe screen and an Activity.
- Every Activity has it's own layout file.
- Reusable View code belongs in a View class.
- Fragments are not simple. Don't use fragments.
- Embrace state machines.
- Corollary: Every Activity is a State Machine.
- Override on configuration changed at your own peril (aka never)
- Retain nothing but state (and hardware adapters)
Lisa Neigut work at Electric Objects, hacking Android into a form that is artfully engineered. One of the first full time Android team members at Etsy, she has a few years experience of building beautiful apps, deep linking things, and talking about Gradle.
She currently works as the Android Engineer at Electric Objects.