Android development is one of the core specialties of Brainbean Apps, so here are the 6 tools we use in literally every single Android project. While some of them remain popular in 2017 just because there is no alternative, number 6 is definitely expected to be a hit of the year.
1. Android Studio
Everything starts with Android Studio, the official integrated development environment designed by Google specifically for building Android apps.
The current 2.3.2 version contains a powerful code editor, an emulator, a Gradle-based build system and a lot of other developer and testing tools, so it’s generally the only must-have tool for any Android developer now.
Google has excellent documentation on it, but what’s more interesting is that just weeks ago Google unveiled Android Studio 3.0. It features Java 8 support, and for those who don’t like it for things like «null» handling or messy exception hierarchy, the new release also brings Kotlin support.
Apart of that, the update also contains over 20 more new features for developers so if you expect your app to run smoothly on the newest devices running Android O, Android Studio 3.0 will fit you best.
Gradle is the ultimate build automation system for Java projects.
Years ago, developers were using things like Apache Ant or Maven for creating software builds. Then Gradle took the best of it and made a ‘quantum leap’ in the Java world. So there’s no reason to speak of its advantages, as there are no worthy competitors on the market (yet).
Still, it’s worth mentioning that Gradle was designed and perfectly fits for big projects. It also runs a Groovy-based DSL instead of XML, simply because Groovy’s more clear and transparent for Java people thanks to its Java-like syntax, type system, package structure.
All in all, things like declarative builds, the wrapper, dependency based programming and other perks make Gradle one of the must-have tools for Android development in 2017.
RxJava is a ReactiveX library for Java that allows using Reactive Extensions for asynchronous programming on Android.
Nowadays, any application is asynchronous by its nature: most of its time it simply waits for user input that will interrupt the existing event loop. So basically speaking, RxJava helps developers to orchestrate various actions that need to happen when certain events occur.
In practice, if you use pure Java, you often need to create and set up a few AsyncTasks, a Semaphore and object-level fields for result storing, which is troublesome. With RxJava, you can forget about global state management and callbacks, and instead, express the necessary flow in one separate thread as a stream using a functional paradigm.
In April 2017, RxJava was rewritten from scratch to fit Reactive Streams, a new standard for asynchronous stream processing. RxJava 2.0 got performance improvements and a lot of important technical updates in its specifications, and this is why it will remain one of the dominating tools for Android development in 2017.
4. Data Binding Library
Most apps nowadays operate with data that is either downloaded from the Internet, created by a user or simply stored on the devices. The problem is you as a developer need to somehow connect this data with the user interface that should represent it to the users.
Previously, you needed to locate the target UI element, inflate a layout, and assign data to that element. Once a new UI element should be defined, you are forced to write even more of the very similar boilerplate code that requires no mental efforts.
With Android’s Data Binding library the initial goal gets much simpler. On compilation, it will automatically process your layout files, parse your code to recognize IDs, resolve dependencies and write data binders. Eventually, for instance, adding another UI element appears to be as easy as writing a single line of code.
Of course, there is much more to that than we described, but you’ve got the idea: Android’s data binding library is essential for an Android developer.
5. Dagger 2
Dagger 2 is a dependency injection framework for Android and Java. Initially, it was created by Square, but now it’s maintained by Google.
While there are a few alternatives, Dagger 2 is considered to be one of the fastest and that’s the reason why it gains popularity.
Generally speaking, dependency injection is a general programming technique needed by developers to clearly define how pieces of code depend on other pieces of code, which is a very common situation. What Dagger 2 does is it analyzes these dependencies to generate code for wiring them so that you would not need to write it.
In addition to that, with Dagger 2 it’s easier to access shared instances, configure complex dependencies and do integration and unit testing.
6. Android Architecture Components
With the alpha version released just in May 2017, Android Architecture Components is a new collection of libraries that lets us build apps even more effectively. With it, it gets easier to make your app modular, avoid memory leaks and do much more. As a result, you can write much less code to do things essential for every app.
Some of the core components of AAC (namely, Room, ViewModel LiveData and Lifecycle) dramatically simplifies the way an Android app can interact with its database connected to its UI, which is one of the basic things every developer does every now and then.
We can call Architecture Components a breakthrough tool for 2017 since it was originally created with the intention to help developers focus on app development areas where they can innovate. Indeed, a lot of stuff developers were complaining lately about was addressed with these libraries and tools, and it looks like guys at Google will keep rolling out even more new components. Well, we’re looking forward to it!
Of course, there are many other libraries, frameworks, and components that might be useful in Android development, and we regularly check up on them to see if they are useful and reliable enough to add them to our toolset. Onсe there will be five more of them, we’ll make another post.
In the meanwhile, if you plan to build an Android app anytime soon, feel free to write us at email@example.com should you have any questions or doubts on how to do that right.