[Tutorial Highlight] Tutorial – greenDAO From Scratch

greenDAO is an Android ORM library which offers an object oriented interface to work with date in SQLite. The library also provides advanced ORM features such as session cache, eager loading, and active entities. It is also claimed to insert, update and load data at rates of several thousand entities per second.


devteam83 introduces how to work with greenDAO in a series of 4 posts. It is the most detailed tutorial about greenDAO I’ve found.

Part 1

This part introduces library setup, data model and DaoGenerator.

  1. All theory, dear friend, is grey – our Datamodel
  2. Creating the project
  3. Download Dependencies
  4. Adjusting project structure
  5. Insert the Libraries
  6. Adjusting the Build-Script of the Generator-Module
  7. Creating the Datamodel
  8. Generating Classes

Part 2

Main objective of this part is to create a working RecyclerView with sample data. You will also know how to load data using greenDAO.

  1. Adding Libraries
  2. Adjusting the apps Build-file
  3. Create the main Activity
  4. Add RecyclerView
  5. Make RecyclerView work

Part 3
The developer move greenDAO session to Application to actually make the app work. RecyclerView’s onClick event is implement so user can click on a RecyclerView’s item to see its detail in a new Activity.

  1. Moving session routines to Application
  2. New Activity
  3. Add onClick Event in RecyclerView
  4. Loading detail data

Part 4

The last part of this tutorial covers how to add, edit and delete data.