There are numerous libraries for Android development. But not every small library makes sense. A collection of the most exciting Android libraries that really gets your project moving.

Anyone who programs an Android app, encounters a problem and does a bit of research, often finds solutions through suitable libraries. But not for every little problem should be resorted to libraries. Because that also causes a dependency: from the support of the library, since it must always be kept up to date, should your app also stay up to date. In addition, some programming libraries often offer more features than they actually need, and blow up your app with superfluous code. You should therefore think twice more about whether the problem can be better solved with a few self-written lines of code.

However, there are some sophisticated libraries that are not without reason very widespread: they often simplify complex problems immensely and are always updated. Among them, for example, Gson, which is developed by Google itself. We introduce some exciting Android libraries.

Querying, storing and processing data

Nothing works without data. Not even with Android apps. The appropriate libraries for REST API queries, Json parsing, and SQLite alternatives can be found in the following section.

retrofit

Retrofit provides an elegant solution for executing REST API requests. Queries are simply written as an interface and the methods only get matching annotations. This could be an example with retrofit:

public interface RestApiInterface {
    @GET("/api/email")
    User getEmail(@Query("email_id") int emailId, Callback callback);
}

// Die zugehörige URL der API muss gesetzt werden
RestApiInterface restApiInterface = new RestAdapter.Builder()
            .baseUrl("https://example.com/").build()
            .create(RestApiInterface.class);

// Email-Abfrage mit der ID 12345
restApiInterface.getEmail(12345, new Callback() {
    @Override
    public void success(Email email, Response response) { }

    @Override
    public void failure(RetrofitError retrofitError) { }
});

Gson

If you work with API, you often need to be able to process Json files. The Gson libraryhelps to convert such files into objects of a suitable class with just one call. Also Retrofit already uses Gson and therefore can save the REST API queries directly as matching objects. Without retrofitting, the parsing of a Json file can be realized with a few lines of code:

String emailJSON = new Gson().toJson(email);
Email email = new Gson().fromJson(emailJSON, Email.class);

Room

Room is an Android-provided library that abstracts SQLite, making it possible to design a robust database that can be accessed through common SQL queries. If you work with rather small datasets, you should rather use Realm and Objectbox instead of the following two libraries.

Realm

Not every time an activity is restarted, the required data should be queried again with slow calls. One possible solution is to store the data in a local database. Realm is one of the most popular object-oriented solutions to this problem –  not least because of its ease of use and detailed documentation .

Objectbox

With Objectbox, there is still a fairly new alternative to Realm in the market. Advantages are a simple implementation and the reduction of code. Also, the library should be significantly more powerful than SQLite.

The result of Objectbox's open source benchmarking app. (Graphic: Objectbox)
The result of Objectbox’s open source benchmarking app . (Graphic: Objectbox)

Parceler

If an object is to be passed on to it when a new activity is started, the Parcelable interface is frequently used. However, multiple methods and a matching creator must be written for each class. This is cumbersome for several classes, especially since the implementations are almost identical. Parceler greatly reduces overhead by requiringonly one annotation and two simple method calls:

@Parcel
public class Email {
    public Email() { }
}
// So wird das Objekt übergeben...
Intent intent = new Intent(this, MyActivity.class);
intent.putExtra("email", Parcels.wrap(emailObject));
startActivity(intent);

// ...und so wieder ausgelesen
Email email = (Email) Parcels.unwrap(getIntent().getParcelableExtra("email"));

picasso

The following library lives up to its name. It is not about Pablo Picasso and his paintings, but rather a more modern and digital way to “create” images: How can images be efficiently downloaded and cached? Picasso tackles the problem and can do just that with just one line of code.

Picasso.get().load("https://example.com/image.png").into(imageView);

Android libraries for the eye

Android offers some simple views and animations by default, which also follow the guidelines of the material design. If that’s not enough, the following libraries will help.

Lottie

Airbnb brings movement to your Android app with Lottie . With the library, Adobe After Effects animations that are exported as Json files can be easily integrated into the app. There is even a selection of free animations .

That's just a very small selection of what's possible with Lottie. (Graphic: Airbnb)
That’s just a very small selection of what’s possible with Lottie. (Graphic: Airbnb)

Style Able Toast

Styleable toast turns the boring Android toasts into colorful and easily customizable messages. Whether with icons, round or angular corners, colorful background or text. All you have to do is create a matching theme in the style.xml or with the builder pattern.

With Styleable Toast, you'll be looking at your otherwise boring messages. (Screenshot: Github / Styleable-Toast)
With Styleable Toast, you’ll brighten up your otherwise boring messages. (Screenshot: Github / Styleable-Toast)

Transitioner

Apps give a much more coherent appearance, when the transitions have a matching animation when starting a new Acitivity. Fitting in this case means the transformation of layouts that find themselves in a different way in both activities. However, the reasonable implementation with the resources provided by Android is rather complicated. Transitioner simplifies that significantly.

With the Android Library Transitioner really nice activity transitions can be conjured up. (Photo: Dev Labs)
With the Android Library Transitioner really nice activity transitions can be conjured up. (Photo: Dev Labs)

Tap-Target-View

To introduce the features of your app and give the user an overview when they launch their mobile app for the first time, Google recommends the Tap Target feature . An implementation of the design policy is provided by Keepsafe with the  Library Tap Target View  .

An implementation of Tap-Target. (Screenshot: Github / Keepsafe)
An implementation of Tap-Target. (Screenshot: Github / Keepsafe)

Chat Kit

Also for the integration of a chat service, there is a completely separate library for the user interface called Chat Kit . Flexible, customizable and file management are the key features.

Quickly create the complete UI for a chat. Chat Kit makes it possible. (Graphic: Github / stfalcon-studio)
Quickly create the complete UI for a chat. Chat Kit makes it possible. (Graphic: Github / stfalcon-studio)

Conclusion

There are countless Android libraries on Github with a variety of features. Including Android apps, which consist to a large extent of libraries. This can quickly become a huge problem when a library is no longer supported or is not compatible with the latest version of Android. For this reason, it should always be considered whether a library makes sense.


Continue Reading...

There are numerous libraries for Android development. But not every small library makes sense. A collection of the most exciting Android libraries that really gets your...

Read Post

There are numerous libraries for Android development. But not every small library makes sense. A collection of the most exciting Android libraries that really gets your...

Read Post