DroidCon NYC 2016 Summary
This past week, I had the pleasure of attending DroidCon NYC 2016. It was a great event with a ton of interesting content. The following is my impressions of the talks and the event itself. This is a very long article, but hopefully it will give you a sense of what people are talking about at DroidCon!
Coldstart (Vikram Bodicherla)
The first talk I went to was an interesting talk about measuring cold start in your app continuously. Strictly speaking, Vikram wasn’t talking just about bare-bones cold start (i.e., the time it takes before any of your application’s code gets run), but more about the time it takes from a fresh launch of your app until the user can actually see useful data.
Mostly, this was a pretty high level overview of techniques for measuring cold start — which essentially boils down to stopwatches. The interesting piece was the idea of creating a visual breakdown of the phases of your app’s startup cycle. And even cooler was the fact that the Yahoo team had this data output automatically from their CI tool, which let them continuously debug and watch for regressions.
Andrea Falcone from Twitter gave a highly engaging talk on Fastlane. Fastlane is a suite of tools that aims to help reduce the pain of pushing releases. The tools are still mostly iOS focused, but the Android suite is growing rapidly.
I really don’t have much to say about this talk; the content speaks for itself. Fastlane seems pretty damn awesome, and I’m excited to integrate it into our app at Blue Apron Engineering. :-)
Pintrest’s Design Language (@tprimke)
Thorben Primke and Lin Wang from Pintrest gave an interesting talk about the design language used at Pintrest. I was really intrigued by this talk, since at Google we found establishing a design language saved us a ton of time and energy working on Play Games.
The most interesting concept from this talk was the concept of Brio, which is what Pintrest calls its grid-based layout. The idea is that all devices/platforms/screens are basically laid out on a grid with 12 columns and 13 gutters. Gutters are always 4 “brio points” wide, and the columns have flexible width to fill the rest of the content.
The concept of a “brio point” is an interesting one. The idea is that the dimensions of a brio point (bp) are scaled based on the device screen size. If all content is always designed in bp, it frees designers from worrying about exactly how things look on different screens.
I’m definitely interested in this kind of thinking. It seems like a model that could be pretty useful, especially when designing cross-platform content. Very thought provoking, although less immediately actionable for me.
I couldn’t find slides for this talk — so no link for the moment.
Android is for Everyone (Kelly Shuster)
Kelly Shuster gave the DroidCon 2016 keynote about accessibility. This is an incredibly important topic that frankly doesn’t get enough love. (I shudder to remember some of the accessibility testing we had to do on Play Games — always came in late, and always caused problems for us)
Kelly’s an awesome speaker who truly killed it. Beyond being a truly bad-ass example of how to give a talk, though, this was a really inspiring and informative session. She talked about how accessibility tends to make things better for everyone — and after all, at some points in our lives, we’re all going to be impaired to various degrees. So designing accessible software is going to benefit you at some point in your life!
The basic take-aways for me here: turn on accessibility rule linting ASAP, and download the Accessibility Scanner app to sanity check things. Basic prevention early can stop a ton of pain later and really make things better for our users.
Radical Recycler View (Lisa Wray)
This was one of my favorite talks of the conference. RecyclerView is a really cool tool, but it takes a bit of getting used to (to put it mildly). I personally know just enough about RecyclerView to be extremely dangerous to myself and others, so this was a super helpful talk.
Some of the cool concepts Lisa pointed out in this talk were around how to structure your code more cleanly for recycler views, as well as how to use data binding and other tools. In particular, I enjoyed seeing some ideas on how to get rid of the nasty switch statements around view type that end up appearing in most Android apps I’ve seen.
I’m also intrigued by the Groupie library she’s released at Genius. It seems like a cool approach to hiding some complexity of RecyclerView — although I confess that I haven’t played around deeply enough to have a feel if it’s the right approach for the Blue Apron app.
Custom Annotations(Ryan Harter)
Ryan Harter gave an awesome talk about an area that has always intrigued me: custom annotation processing for Java. He went through and pretty thoroughly demystified the process of generating code from those crazy @ symbols you see in modern Java code.
Mostly, this was an introductory talk covering the mechanics of annotation processing and code generation, but I found it very helpful to clarify my understanding of annotations as a concept. I also enjoyed the pointer to the JavaPoet library as a tool for generating Java class files — it seems like this tool makes it much easier.
I’m excited to try out writing some custom annotations! The example Ryan worked through around generating code for a Builder pattern was really neat, and highly applicable to anyone who’s ever gotten frustrated typing out yet another Builder class.
Constraint Layout (Dave Smith)
Dave Smith’s talk about Constraint Layout was an awesome introduction to the power of this layout. I’ve never played with these personally, but it sounds like they have the potential to make doing complex layouts much easier.
In particular, I was fascinated to learn about the guideline tool. Basically, these are invisible views that can be added to the ConstraintLayout and used to position elements cleanly. This seems way better than many of the other hacks I’ve used before to position Android UI elements.
ConstraintLayout isn’t for everyone — I’m a big advocate of keeping your views as simple as possible, since that generally leads to better performance. But it does seem like it might be more efficient to use for certain types of UI, which is always a cool thing to see.
Testable Android Architecture (Chuck Greb)
Chuck Greb from Mapzen gave an interesting talk about their take on building Android apps with an eye to testability. This is obviously near and dear to my heart, so I was excited to hear it.
When we talk about testable architecture on Android, we mostly end up discussing some form of MV* pattern (MVC, MVP, MVVM, etc). At the end of the day, I find most of these patterns to be pretty similar in their philosophy — get the Android framework separated from your business logic as much as possible to make it easier to test. Code that doesn’t rely on Android’s classes can be tested under a pure vanilla JVM with JUnit, which means you can test way more easily.
The basic model presented in this talk was MVPC, where you have both a Presenter and a Controller. The idea is that this lets you cleanly visualize the Controller as an interface that your Activity implements, allowing you to swap out the implementation with a test version.
I think this makes a lot of sense — it generally lines up with how I view separating concerns. That said, I’m not 100% sure if implementing this all the way provides enough benefit. When you start adding more classes and interfaces, you can run into performance issues. So as with all things in engineering, there’s a balancing act here between testability and performant code. Finding the right line there is why we engineers have jobs. :-)
Play Services Task API (Doug Stevenson)
To be honest, I was underwhelmed here. The talk itself was fine for what it was, covering how to use the Task API concept. But realistically, this isn’t a good API. The Task concept is basically just Futures — we already have this programming concept well established, and we really don’t need more. To make matters even worse, Google Play Services already has this concept in the form of PendingResult.
Here’s where we veer into personal rant territory: I was part of the team that helped create the PendingResult API, so the following may be somewhat biased.
IMHO, this is a case of Google shipping its org chart. The Task API exists because it was used for Firebase code. When Firebase was being integrated into Google Play Services, there were some very tight deadlines to meet. So you can imagine that refactoring wasn’t high on the list of priorities.
In a sane world, the decision would have been either to refactor Firebase code to use PendingResult or to decree that Task was a superior API and refactor the existing code to use Task. Shipping both APIs honestly makes no sense for end users, and is just confusing.
Once again, I couldn’t find slides. Will update when I can locate them.
Efficient Layouts (@danlew42)
Dan Lew from Trello gave a talk about efficient layouts on Android. One of the biggest sources of jank in your app can be highly complex view layouts — Dan’s argument was basically to use the simplest layouts possible, which is very sound advice.
He gave some very good best-practice tips around how to set up themes and styles for code sharing, as well as a few tips for optimizing your layouts. It’s probably best to just go through the slides yourself — I’m likely to botch his advice if I duplicate it here.
The other piece of this talk was about VectorDrawable. This is a tool included in Android now to allow the use of vector graphics instead of scaling PNGs. VectorDrawable isn’t quite SVG, though, since not all the features are supported. Designers, however, tend to speak in SVG instead of VectorDrawable.
Trello has released a library called Victor to help deal with this. The purpose of the library is to help deal with the SVG->VectorDrawable conversion automatically. Seems like a promising tool, but still very early.
Custom Views (Huyen Tue Dao)
This was an awesome talk from another Trello engineer, Huyen Tue Dao. The basic premise was exhorting the audience to not be afraid of building custom views. (And gets bonus points in my book for using the slogan/iconography from Edge of Tomrrow for her title slide! :-) )
I thought this was a fascinating perspective. Custom views or ViewGroups can be a very powerful tool, but you can also find yourself going down some deep dark rabbit holes very quickly. Huyen walked through the basic rendering cycle on Android (measure, layout, draw) and explained how these steps relate to each other. She then gave a quick breakdown of the different possible approaches to implementing custom views.
I’ve seen custom views used to good effect before. (On Games, we had a view for the Player Avatar that was used everywhere) Overall, I thought this talk was an excellent introduction to thinking about custom views — the tradeoffs are real, but going custom can definitely be the right choice at times.
Realm (Donn Felker)
Donn Felker gave a talk about the basics of using Realm as a data store on Android. I was really excited for this talk, since I’ve been considering using Realm for Blue Apron for a bit now. I think this talk may have convinced me to pull the trigger.
Realm is a fascinating idea. The basic concept is that they wrote an Object-based storage system for mobile to replace tools like SQL. Designing a wholly new style of database from the ground up is a big challenge, but everything I’ve seen so far makes me think it could be really cool. I think the programming model looks really nice, and I love the fact that the core engine is now open sourced so I can really dig in to understand it. The Realm browser for OSX and true cross-platform support are also incredibly appealing to me.
The one downside appears to be that the idiom of Realm requires some getting used to. Notably, you can’t pass Realm objects between threads — so there’s some thought required as to how to make that work cleanly. But that seems surmountable with a bit of developer education.
Really interesting talk. I’m going to be doing some digging on Realm here soon, and will likely end up writing up my thoughts in the future.
Fingerprint Authentication (@benlikestocode)
Ben Oberkfell gave a short-and-sweet talk about how to implement fingerprint authentication on Android. Basically, it boils down to “send a signed request to your server”.
OK, not quite. There’s some intricacies around how exactly to interact with the fingerprint manager, as well as obtaining the right public/private keys to use in a secure fashion. Very interesting stuff!
Fingerprint auth is definitely the wave of the future. It definitely seems like a nice way to help your users sign in more easily once they’ve created their accounts. Going forward, I expect to see this in more and more apps — so it was good to get some grounding in it now.
Slides and source here: https://github.com/benoberkfell/android-fingerprint-demo/
Animated Vector Drawables (Marcos Paulo)
Marcos Paulo gave a cool talk about building out animated vector drawables. These are a hot topic right now, since VectorDrawables are really useful on Android.
On API 21+, you can do all of the animations natively. Below that, you can rely on VectorDrawableCompat to expose most properties for you. The basic idea of vector graphics is pretty simple: we provide a series of commands controlling a draw cursor. So with that framework in mind, animating these objects is also simple: just transform strokes from one location to another.
Of course, the details are where it gets interesting. I thought this talk was a really nice overview of what’s actually going on when you build these animations.
Instagram Architecture (Kang Zhang)
Kang Zhang from Instagram gave a great talk about the history of the Instagram app. The team has grown from 2 engineers to 40, and still managed to keep the APK size almost the same over the past 5 years. That’s incredibly impressive!
The basic idea in this talk is that all the components of the Instagram app are treated like parts of a race car: highly optimized, incredibly efficient, and highly scrutinized. I found myself grinning wildly while listening to this talk, since I completely agree with so many of his points.
What really resonated was his points about being cautious with new frameworks. Too often engineers want to adopt some new tech because “it’s so shiny and new!” That can be incredibly dangerous thinking. You shouldn’t adopt a new framework/pattern/library/etc because it’s new; rather, you should adopt one if it solves a problem you actually have. Every line of code you include in your app hurts your performance to some extent, so you want to be very careful about what you bring in.
Kang wasn’t arguing against the use of libraries, though. He was just arguing that you need to be very selective. Do what’s easy first, and then optimize what matters. He talked a lot about Instagram had to build a custom JSON parser because existing techniques were too slow. That really brought me back to the initial work on Google Play Services, where we had to do the same type of thing.
There was a ton of great content here — this really felt like “How to build an engineering culture 101”.
I can’t find these slides either — will link when I can find something.
Android Studio Like A Boss (@pbreault)
The final talk over the conference for me was Philippe Breault’s talk about Android Studio. I felt a little dumb going to a talk about a tool I use every single day — but hey, I figured I might learn something useful!
Boy did I ever. Wow, Android Studio has some awesome features I never knew about. In particular, Structural Search/Replace seems really bad-ass. It lets you conduct search/replace with awareness of Java structure. So instead of searching for the word “log” everywhere, you can actually search for calls to Log.* instead. Even more powerful, you can check these rules into source control so the whole team can share it. Basically, this lets you build really awesome custom lint extensions easily. Very cool.
He also talked about Live Templates, which make it way easier to type common operations. Android Studio has a bunch of these built in (logt alone will save me tons of time), but you can also define your own.
I really enjoyed this talk. I’m excited to put some of these tips into practice!
I had a great time at DroidCon. I got to meet a bunch of really interesting people and talk about cool stuff. Honestly, I haven’t been this excited to be an Android developer in quite a long time. The venue was nice, and everything flowed really well. The only tiny hitches were around some of the more popular talks where people couldn’t get into rooms — and even those were few and far between. Huge shout-out to the touchlab folks who organized and put this whole shindig on — awesome job!
It’s going to take me a while to digest the content I’ve picked up here. Over the next few weeks, I’m going to try and see how I can apply the tools/tricks/tips I picked up here to help make the Blue Apron app truly awesome. I’m looking forward to diving back in!