Must Have Libraries - meswapnilwagh/android_guides GitHub Wiki

Overview

There are many third-party libraries for Android but several of them are "must have" libraries that are extremely popular and are often used in almost any Android project. Each has different purposes but all of them make life as a developer much more pleasant. The major libraries are listed below in a few categories.

Standard Pack

This "standard pack" listed below are libraries that are quite popular, widely applicable and should probably be setup within most Android apps:

Name Description
Retrofit A type-safe REST client for Android which intelligently maps an API into a client interface using annotations.
Picasso A powerful image downloading and caching library for Android.
ButterKnife Using Java annotations, makes Android development better by simplifying common tasks.
Parceler Android Parcelable made easy through code generation
IcePick Android Instance State made easy
LeakCanary Catch memory leaks in your apps
Espresso Powerful DSL for Android integration testing
Robolectric Efficient unit testing for Android

The "advanced pack" listed below are additional libraries that are more advanced to use but are popular amongst some of the best Android teams. Note that these libraries may not be suitable for your first app. These advanced libraries include:

Name Description
Dagger 2 A fast dependency injector for managing objects.
RxJava Develop fully reactive components for Android.
EventBus Android event bus for easier component communication.
AndroidAnnotations Powerful annotations to reduce boilerplate code.

Keep in mind that the combination of these libraries may not always play nicely with each other. The following section highlights some of these issues.

ButterKnife and Parceler

Using the Butterknife library with the Parceler library causes multiple declarations of javax.annotation.processing.Processor. In this case, you have to exclude this conflict in your app/build.gradle file:

   packagingOptions {
        exclude 'META-INF/services/javax.annotation.processing.Processor'  // butterknife
    }

ButterKnife and Custom Views

Often you may find that using ButterKnife or Dagger injections defined in your constructor prevent Android Studio to preview your Custom View layout. You may see an error about needing isEditMode() defined. Essentially this method is used to enable your code to short-circuit before executing a section of code that might be used for run-time but cannot be executed within the preview window.

  public ContentEditorView(Context context, AttributeSet attrs) {
        super(context, attrs);

        LayoutInflater inflater = (LayoutInflater) context
                .getSystemService(Context.LAYOUT_INFLATER_SERVICE);

        inflater.inflate(R.layout.view_custom, this, true);

        // short circuit here inside the layout editor
        if(isInEditMode()) {
            return;
        }

        ButterKnife.bind(this);

Convenience

  • Dagger - A fast dependency injector for Android and Java. See this video intro from Square.
  • Spork - Spork is an annotation processing library to speed up development on your projects. It allows you to write less boilerplate code to make your code more readable and maintainable.
  • AutoParcel - Port of Google AutoValue for Android with Parcelable generation goodies.
  • Akatsuki - Handles instance state restoration via annotations
  • Hugo - Easier logging within your app
  • Logger - Much cleaner and easier logcat trace messages
  • Trikita Log - Tiny logger backwards compatible with android.util.Log, but supporting format strings, comma-separated values, non-android JVMs, optional tags etc
  • LeakCanary - Easily catch memory leaks as they occur
  • AndroidAnnotations - Framework that speeds up Android development. It takes care of the plumbing, and lets you concentrate on what's really important. By simplifying your code, it facilitates its maintenance
  • RoboGuice - Powerful extensions to Android using dependency injection.
  • Calligraphy - Custom fonts made easy
  • EasyFonts - Easy preloaded custom fonts in your app
  • AndroidViewAnimations - Common property animations made easy
  • AboutLibraries - Automatically generates an About this app section, with a list of used libraries
  • SDK Manager Plugin - Helpful plugin especially for group projects if you're missing an SDK version, haven't downloaded an API version, or your support library is updated.

Extensions

  • Otto - An enhanced Guava-based event bus with emphasis on Android support
  • EventBus - Android optimized event bus that simplifies communication between components.
  • Tape - Tape is a collection of queue-related classes for Android and Java
  • RxJava - Reactive Extensions for the JVM
  • Priority Job Queue - Easier background tasks
  • ACRA - Crash reporting made easy and free. Check the setup instructions and open-source backend.

Networking

  • Retrofit - A type-safe REST client for Android and Java which intelligently maps an API into a client interface using annotations.
  • Picasso - A powerful image downloading and caching library for Android.
  • Ion - Powerful asynchronous networking library. Download as a jar here.
  • Android Async HTTP - Asynchronous networking client for loading remote content such as JSON.
  • Chronos - Android library that handles asynchronous jobs.
  • Volley - Google's HTTP library that makes networking for Android apps easier and most importantly, faster.
  • OkHttp - Square's underlying networking library with support for asynchronous requests.
  • Glide - Picasso image loading alternative endorsed by Google
  • [IceNet] (https://github.com/anton46/IceNet) - Android networking wrapper consisting of a combination of Volley, OkHttp and Gson
  • Android Universal Image Loader - Popular alternative for image loading that can replace Picasso or Glide.
  • Fresco - An image management library from Facebook.

ListView

RecyclerView

Easy Navigation

UI Components

Drawing

  • Leonids - Simple and easy particle effects (See Tutorial)
  • AChartEngine - This is a charting software library for Android applications
  • HoloGraphLibrary - Newer graphing library
  • EazeGraph - Another newer library with potential
  • AndroidCharts - Easy to use charts
  • AndroidGraphView - library to create flexible and nice-looking diagrams.
  • AndroidPlot - plotting library for Android
  • WilliamChart - Flexible charting library with useful motion capabilities.
  • HelloCharts - Charts/graphs library for Android with support for scaling, scrolling and animations.
  • MPAndroidChart - A powerful Android chart view / graph view library, supporting line- bar- pie- radar- bubble- and candlestick charts as well as scaling, dragging and animations.

Image Processing

Scanning

Persistence

  • ActiveAndroid
  • DBFlow - A robust, powerful, and very simple ORM android database library with annotation processing.
  • greenDAO
  • SugarORM
  • RxCache - Reactive caching library for Android
  • ORMLite
  • SQLBrite - Lightweight wrapper around SQLiteOpenHelper
  • Cupboard - Popular take on SQL wrapper
  • StorIO - Fresh take on a light SQL wrapper
  • Realm
  • NexusData
  • Hawk - Persistent secure key/value store
  • Poetry - Persist JSON directly into SQLite
  • JDXA - The KISS ORM for Android - Simple, Non-intrusive, and Flexible

Compatibility

Scrolling and Parallax

This is a list of popular scrolling and parallax libraries:

Debugging

  • Stetho - A debug bridge for Android applications which could be used for multiple purposes not limited to Network Inspection, Database Inspection and Javascript Console.

Resources

Check out the following resources for finding libraries:

References