You know the feeling: too much to do, and too little time to do it. We’ve all been there. Writing good code while under pressure is obviously a great challenge.Fortunately, when it comes to development on Android, there are tools to speed up the process. We asked our Android Developers what tools are their must-haves at work. Check them out and make your work easier.
Our favorite tools to speed up Android development
Genymotion - Marcin Piesiak
Genymotion is one of the best emulation systems for Android. It’s available for Windows, Mac, and Linux and is free to use for non-commercial purposes. The emulator supports all versions of Android, yet remains fast and easy to use. Another advantage is its list of predefined devices, so you don’t need to constantly configure the emulator (though, of course, you have the freedom to do so, if you wish). Genymotion enables you to simulate all the built-in sensors that a given device model has, its GPS position, its battery charge level as well as the quality of GSM and WIFI connection. It’s also possible to simulate receiving an SMS or call.
The only thing you need to start using Genymotion is VirtualBox, which is a testament to the ease of use and installation of the software. Working emulators are visible to the system as normal mobile devices. The ability to create and configure a virtual device via a build.gradle file is another asset. It works perfectly with tools such as Jenkins, TeamCity and Bamboo. Genymotion also allows you to change the ID/IMEI/MEID of the emulated device while the system is working. Moreover, Genymotion also lets you record and take screenshots, which makes the developer-tester communication significantly easier.
HierarchyViewer is a tool included in the Android SDK, and is accessible through the Android Device Monitor. It enables you to quickly analyze the layout and view tree of your app for debugging and optimization. HierarchyViewer creates a visual representation of your app’s view tree and lets you zoom in and inspect, pixel by pixel. With HierarchyViewer, you can also check for redundant layouts and identify where they can be merged to flatten the view tree, increasing performance.
Finally, the tool provides all the information about the properties of a selected view as well as its performance measurements - how much time it takes to measure and draw your views - which can be compared with the view’s siblings, so you know where to look for optimizations. A simple and powerful tool, HierarchyViewer will let you take full control of the performance of your UI.
LeakCanary - Maciej Janusz
Fast development requires the ability to detect and tackle bugs on the go. With LeakCanary, at the cost of just one dependency and a few lines of code, no memory leak will escape your attention. Memory leaks are a type of bug that is exceptionally difficult to trace and often result in app-crashing OutOfMemoryExceptions.
Created by the people at Square, LeakCanary adds a module to your app that will pop-up a notification whenever a traced reference leaks memory, so you know where to look for the bug before you get any OOM errors. Information about detected leaks is stored in your phone, and a reference trace can be viewed at any time in a separate Activity, accessible from your device launcher. In addition, it will notify you of any high garbage collector activity that could result in annoying momentary app freezes. It’s an invaluable tool that saves a lot of time and effort, letting you focus on making a quality product and sparing you the need to spend hours hunting that elusive memory leak.
There are many solutions and apps that allow you to share screens between your Android device and PC via USB. Unfortunately, they are usually quite complicated or require rooting the device. But, thanks to the company ClockworkMod, which is widely known to Android power users, we can easily share the screen using nothing more than a Chrome plugin!
The quality isn’t perfect, but it certainly suffices for app presentation. Another great feature is the ability to share your device’s screen with your coworkers or clients using the Vysor Share feature. Imagine how much simpler the development process becomes when you can work on app features live with the client. No more long emails where you try to describe what you mean. You just show it instantly on a real device!
No one likes writing boilerplate code. It’s boring and time consuming. And time is the most precious thing we have. Butter Knife deals with boilerplate code and saves us time.
Butter Knife is a field and method binding solution for Android views. It lets us avoid writing slow (reflection based) boilerplate code to get a reference for a view, yet leaves our code much cleaner and more readable. So, the next time you start typing findViewById(int id) - pause and think about your time, your rate of coding, and the code’s readability. Think about Butter Knife!
Do you have any other tools to recommend to us? Please do so in the comments below. And if by any chance you’re looking for a job, check out 5 reasons why you should work at Netguru as an Android developer - don’t hesitate to join us!