[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.

Leave a Comment

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

We care about your privacy and data security. Google serves cookies to analyse traffic and show ads on this site. By using this site you agree to these cookies being set. 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.