6 Best Android ORM Libraries to Use

When your app requires lots of database activities, using an ORM is the best way to reduce your workload so you can focus on other aspect of the app.

I hope you can choose a suitable Android ORM after reading this post.


During Google I/O 2017, Google introduces Room persistence library as a new library in their effort for clean architecture in developing Android apps. Room is a SQLite object mapping library. Room fits well with clean architecture.

@Entity(tableName = “user”)
public class User {

@PrimaryKey(autoGenerate = true)
private int uid;

@ColumnInfo(name = “first_name”)
private String firstName;

@ColumnInfo(name = “last_name”)
private String lastName;
//getters and setters go here

Website: https://developer.android.com/topic/libraries/architecture/room.html


Object Relational Mapping Lite (ORM Lite) is a simple and lightweight Java ORM. The ORM is supported in many Java platforms such as Spring.

ORMLite supports native calls to Android SQLite database APIs and its main website has separated documents for Android only.

@DatabaseTable(tableName = “account”)
public class Account {
@DatabaseField(id = true)
private String username;

@DatabaseField(canBeNull = false)
private String password;

Account() {
// a must defined no-arg constructor
public Account(String username, String password) {
this.username = username;
this.password = password;
//…getter and setter methods can go below

OrmLite is open source and can be found on GitHub.

Website: http://ormlite.com.


I use ActiveAndroid for most of my projects. ActiveAndroid is an active record style ORM which allows you to save and retrieve SQLite database records without ever writing a single SQL statement. The library takes care of all the settings and SQLite stuff, and all with just some simple code lines and few simple steps of configuration.

You can either download the JAR file or compile the library folder using ant command.

@Table(name = “Books”)
public class Item extends Model {
@Column(name = “Name”)
public String name;

@Column(name = “Price”)
public float price;

@Column(name = “Publisher”)
public String publisher;

Website: http://www.activeandroid.com/


I haven’t tried greenDAO yet but I assume it is better to use the library when your project contains lots of data tables. greenDAO is considered to be the fastest ORM for Android. There are many top Android apps such as Pinterest, Path are relying on greenDAO. Many of them have over 10 million installs.


Example of creating an object and adding properties to the object:

Entity account = schema.addEntity(“Account”);

Website: http://greenrobot.org/greendao


SugarORM is an ORM developed only for Android in order to simplify the interaction with SQLite database.

public class Game extends SugarRecord {
String title;
String developer;

public Game(){

public Game(String title, String developer){
this.title = title;
this.developer = developer;

//Add new
Game game = new Game(“Uncharted 4”, “Naughty Dog”);
//find and delete a game
Game game = Game.findById(Game.class, 1);
//list all games
List<Game> games = Game.listAll(Game.class);

Website: http://satyan.github.io/sugar/index.html


DBFlow is a simple and powerful android database library with annotation processing. It is designed to be fast, high performance, and easy to approach. It reduces codes for dealing with databases with its powerful and simple API. DBFlow is boasted as a more efficient and powerful alternative to the other Android ORMs. According to the developer’s own benchmark, DBFlow is the fastest Android ORM.

//define a database
@Database(name = AppDatabase.NAME, version = AppDatabase.VERSION)
public class AppDatabase {
public static final String NAME = “App”;
public static final int VERSION = 1;
//define a table
@Table(databaseName = AppDatabase.NAME)
public class TestModel1 extends BaseModel {
@Column(columnType = Column.PRIMARY_KEY)
String name;

Website: https://github.com/Raizlabs/DBFlow

Other good Android ORM libraries

These are also good ORM libraries which I haven’t tried yet.

Requery. It is a modern SQL based query & persistence library for Android. Requery provides a modern set of interfaces to perform and persist queries.

Ollie. Ollie is a compile-time active record ORM for Android. It supports RxJava.

RushOrm. Similar to other libraries, RushOrm replaces the need for SQL by mapping java classes to SQL tables. It can be used in projects with complex data structures and projects that communicated with a REST API.

7 thoughts on “6 Best Android ORM Libraries to Use”

  1. I was experimenting things with Room api these days but honestly i got stuck in few places. I think we shouldn’t use Room api for now until more resources are available from community

  2. Check out JDXA ORM for Android. Based on [KISS Principles](http://softwaretree.com/v1/KISSPrinciples.html), JDXA is a simple yet powerful, non-intrusive, and flexible ORM.

    JDXA easily supports complex object modeling including inheritance, one-to-one, one-to-many, and many-to-many relationships and offers a POJO (Plain Old Java Objects) friendly non-intrusive programming model, which
    does not require you to change your Java classes in any way:

    – No need to subclass your domain classes from any base class
    – No need to clutter your source code with annotations
    – No need for DAO classes

    JDXA also offers convenient persistence for JSON objects.

    Here are some JDXA ORM code snippets: http://softwaretree.com/v1/products/jdxa/code-snippets.html

Leave a Comment

Your email address will not be published. Required fields are marked *

By continuing to use the site, you agree to the use of cookies. more information

The cookie settings on this website are set to "allow cookies" to give you the best browsing experience possible. If you continue to use this website without changing your cookie settings or you click "Accept" below then you are consenting to this.