“Easy Wins” of Droidcon NYC 2015
“Let Me Explain You” Droidcon
Droidcon is a global developer conference series focusing on the best of Android. These conferences offer some of the best presentations and talks the industry has to offer from companies such as Square, Twitter, Soundcloud, and even Google itself. With the wealth of knowledge shared at Droidcon NYC, it can be hard to extract the good stuff from the great; so we sifted through the various presentations to highlight the presentations that will lead to some “easy wins” when developing your Android apps.
LeakCanary – Pierre-Yves Ricau (Square)
If you have ever developed an Android app, chances are you’ve encountered the dreaded OutOfMemory error. In short, a memory leak typically occurs when a chain of references holds an object in memory after it should have been garbage collected. Luckily, the wonderful engineers at Square have provided a tool in combating this issue during development. LeakCanary was open sourced by Square back in May of this year and is an invaluable tool in helping you reduce the number of memory leaks within your application. It is ridiculously easy to set up, and the value gained from including it in your development and QA process is enormous.
More details on LeakCanary.
Vector Support in Android Studio 1.4 – Roman Nurik, Nick Butcher, and Chris Banes (Google)
Remember that time when your designer gave you an asset only to change it a day later, forcing you to re-import the asset in multiple different densities all over again? Well, those days are over. Android Studio 1.4 now adds the ability to import vector assets. Your designers can now provide you with SVG assets which are easily imported into your project using Android Studio. That’s all well and good for Lollipop and up devices, but what about all of the users running older versions of Android? Luckily, backwards-compatibility has been added in the latest version of the Android gradle plugin! (Please note: at the time of writing, the plugin is still in beta). At build time, this plugin will rasterize the SVGs and then generate the required assets for different densities. This will make your designers extremely happy and really streamline the designer-to-dev process. Oh, and if your app is strictly using Material icons, you can even cut out the designer completely; the vector import wizard in Android Studio supports directly importing assets from the Material icon library.
Debug Builds: A New Hope – Matt Precious (Square)
The development of an app can be tough at times. Bugs seemingly crop up at random, APIs may or may not be ready, and the timeline for delivery may be rather short. How can you ease the development process on yourself and others within your team? Enter U2020 and the Debug Drawer. U2020 has been around for awhile now, but it has been constantly improved with new and interesting features. Jake Wharton and Matt Precious of Square were generous enough to include a slew of tools that they use to reduce the pain points of the development process. To highlight a few:
- Endpoint Selection (Debug/Staging/Production etc.): Seamless switching of environments.
- Mock “Fake” Mode: Allows you to easily mock your server responses. This can be helpful when testing or developing a feature without having to rely on a server.
- In-app bug reporting: Thanks to Matt Precious and his Telescope library, bug reporting is as simple as holding two fingers on the screen. You are then given the option to include logs along with a screenshot and a description. This is highly customizable. The report could simply be sent to an email or uploaded to an issue-tracking service like JIRA or Pivotal.
- In-app logging: See an issue with your app when you’re not connected to your computer? Check the logs in the app itself and send them to yourself!
- Screen State Verification: Many times views will have multiple view states such as loading, content (aka success) and error. This tool allows you to quickly force the different view states of your app to verify they are correct.
There are a ton of other great debug features included within U2020 and the Debug Drawer. Check out the slides from the talk or the U2020 source code for even more great features.
Accessibility 101 – Haley Rose Smith (Slack)
Accessibility in Android should not be overlooked. Users of your applications have various needs and will interact with your applications in a variety of ways. There are a couple of really simple checks you can do to your app that result in big gains for your users.
- Make sure enabling “Large Text” doesn’t break the app.
- Use sp instead of dp when specifying font sizes. Using sp will scale for both screen size and the user’s text size preference.
- Bring your app out into the sunlight. Strong contrasts help combat screen glare!
- You know that annoying lint message you sometimes receive when editing your layouts?Add contentDescription to everything that might be relevant to a user. Haley gave a great example for the Slack Android app: The TabLayout in Slack uses icons/images rather than text. Without contentDescription set, TalkBack gives no useful info to user about what the different tabs do.
At Prolific, we are already reaping the benefits of implementing these “easy wins”. You won’t just be helping yourself and your product –you will be helping your users.
There were plenty of other great takeaways from Droidcon NYC 2015. The full list of presentations can be found here on Github. Touchlab did a wonderful job organizing the event, and we can’t wait for next year’s!
Videos of the various presentations are available via their Youtube channel, and we highly recommend checking them out.
Note: “Explanation for Let Me Explain You” can be found here.