in Android App Development

Top 10 Android Libraries Every Developer Should Know About

Android development can be as easy or as painful as you want. With a collection of these ten essential android libraries, we hope you’ll notice that the grass is actually greener on the other side!

Given them a spin, and start doing more for less effort.

Top 10 Android Libraries Every Developer Should Know About
#1 Active Android

If you’re not used to working with an ORM in Android, it’s high time you got started! And just in case you’re put off by the sheer magnitude of something like Hibernate, Active Android offers a lighter, simpler Active Record-based implementation of an ORM.

Here’s how simple it gets to define relationships in Active Android:

@Table(name = “Items”)

public class Item extends Model {

   @Column(name = “Name”)

   public String name;

   @Column(name = “Category”)

   public Category category;

}

And the reverse relationship:

@Table(name = “Categories”)

public class Category extends Model {

   @Column(name = “Name”)

   public String name;

       // This method is optional, does not affect the foreign key creation.

   public List<Item> items() {

       return getMany(Item.class, “Category”);

   }

}

Check out the library here.

#2 Universal Image Loader (UIL)

Android apps have to work extensively with images. But managing images on smartphones is not an easy task – hundreds of them can get created in a single day, slowing down apps to a grind.

UIL is a highly popular open source alternative to this problem. It loads, displays and caches images asynchronously, letting your app carry on with its core task.

Check out this awesome library here.

#3 Robolectric

Effective unit testing is crucial to any development process, but running tests on an emulator is not always convenient. It would be much better to have our Android tests run on the JVM, but alas, the implementation of core classes is missing.

Fear not, because Robolectric fills that gap neatly. It uses shadow classes to rewrite the Android core libraries on the JVM, helping you run your unit tests in a flexible manner!

Get Robolectric here.

#4 Event Bus

Different components in Android manage communication in different ways – Intents, Listeners, Broadcast Managers, and what not. There’s nothing wrong with them, except that these tools promote strong coupling with the Android subsystem. And as developers of large-scale back-ends have taught us, there should never be platform- or technology-specific coupling in messaging systems.

A neater way to communicate in Android is to use a central messaging broker like Event Bus. Event Bus facilitates a publish-subscribe pattern for your app. Messages originate from publishers and are pushed automatically to components that have subscribed to them. It’s a fascinating and unifying way of handling communication in your Android app.

Check out this amazing library here.

#5 Jackson

This cool-named library also does some really cool work – serialization and deserialization (or marshaling and unmarshaling, as it’s more commonly known as in the Java world). Unless you’re hamstrung by some weird organizational policy or XML-era hangover, chances are you’re using JSON as your default communication format. But converting your models or API endpoints to and from JSON can be a real pain in the rear.

Make it easy with Jackson! There are (better, according to some people) options like Google’s Gson library, but Jackson has a more loyal following because it’s fast.

#6 LeakCanary

Memory leaks make us tear our hair and smash things made of glass. LeakCanary is an attempt at detecting and reporting memory leaks within your app.

Here’s how cool its reporting is:

LeakCanary

Explore more here.

#7 RxJava

Reactive programming is the rage these days, with frameworks like Node.js leading the way. If you miss this cool way to program while doing Java development, RxJava is the answer. With no dependencies, a Jar file under 1 MB, and support for Java 8 Lambda features, there’s no reason for you to not use this extension library.

Get RxJava here.

#8 Cardslib

If you love designing with cards, you’ll enjoy Cardslib as it simplifies creation and management of UI cards. But like all good things, there’s an aesthetic limit to the use of cards; as the library author says: “Before using this library I recommend that you check out the new Google Material Guidelines. Don’t over cardify your UI”!

In you want to see the library in action before you invest time into it, there’s a Google Play demo app available.

The library is here.

#9 Scissors

Rarely does a library come along that not only offers a very useful functionality but also has an API to kill for. Scissors make image cropping butter-smooth and super-easy in your Android projects.

Here’s how you’d save a cropped file:

cropView.extensions()

   .crop()

   .quality(87)

   .format(PNG)

   .into(croppedFile))

Part of the charm is that it was developed by none other than Lyft! Check out the library here.

#10 Hugo

Last but an equally important library is Hugo. Hugo was developed to make logging easy. A typical logging cycle during development involves calling the logger, printing a methods arguments and return values, as well as some profiling mechanism that tells you how long the method took to execute. Well, Huge gives you all of this with just a simple annotation: @DebugLog

Check out this enormous productivity-booster here.

Now don’t keep thinking about how awesome it’s going to be once you start using these libraries. Instead, get working and try them out now!