whatisgithub

What is greendao?

greenrobot/greendao — explained in plain English

Analysis updated 2026-06-24

12,602JavaAudience · developerComplexity · 2/5Setup · moderate

In one sentence

An Android database library (now unmaintained) that maps Java objects to SQLite rows so you can store and retrieve data without writing raw SQL, authors now recommend ObjectBox instead.

Mindmap

mindmap
  root((greenDAO))
    What it does
      Android ORM
      Java to SQLite
      No raw SQL needed
    Key features
      Code generation
      Query builder
      Table relationships
    Optional
      SQLCipher encryption
      Custom type mapping
    Setup
      Gradle plugin
      Auto-generated classes
    Status
      Unmaintained
      Move to ObjectBox
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Store and query Java objects in a local SQLite database on Android without writing any raw SQL.

USE CASE 2

Use the query builder with named constants to avoid typo bugs in field names at compile time.

USE CASE 3

Store data in an encrypted SQLite database on Android by enabling the SQLCipher integration.

USE CASE 4

Model relationships between database tables and perform chained join queries using greenDAO's API.

What is it built with?

JavaAndroidSQLiteGradle

How does it compare?

greenrobot/greendaozhihu/matissefacebook/stetho
Stars12,60212,53512,675
LanguageJavaJavaJava
Setup difficultymoderateeasyeasy
Complexity2/52/52/5
Audiencedeveloperdeveloperdeveloper

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · moderate Time to first run · 30min

Project is no longer actively maintained, new Android projects should use ObjectBox, the authors' replacement library.

So what is it?

greenDAO is a library for Android that makes it easier to store and retrieve data in a SQLite database. Instead of writing raw SQL queries, you define your data as Java objects and the library handles converting them to and from database rows. This pattern is called an ORM (Object-Relational Mapper). The README prominently warns that this project is no longer actively maintained, and the authors now direct new users to ObjectBox, their newer database library. When it was actively developed, greenDAO's main selling points were its small size (under 150 kilobytes) and speed. It used code generation to create the database access classes at build time rather than using reflection at runtime, which the authors claimed made it one of the fastest ORMs available for Android. Setup involves adding a Gradle plugin to the project, and when the project builds, the plugin automatically generates helper classes for accessing each database table. The library includes a query builder that uses named constants instead of raw strings, which helps avoid typos in field names at compile time rather than discovering errors at runtime. It supports relationships between tables, including chained joins for more complex queries. Custom data types can be stored by mapping them to a supported column type, and there is optional support for SQLCipher if you need to store data in an encrypted database. greenDAO has been available since 2011 and was used in many Android apps over the years. Documentation and getting started guides are hosted on the greenrobot website. The same organization also produced EventBus (a message-passing library for Android) and Essentials (a set of general utility classes), both of which remain separate repositories.

Copy-paste prompts

Prompt 1
How do I add greenDAO to an Android project with Gradle and define a simple entity class that maps to a database table?
Prompt 2
How do I query all records from a greenDAO table where a specific field matches a value, using the query builder?
Prompt 3
How does greenDAO handle one-to-many relationships between two entities, show me an example with User and Order objects.
Prompt 4
How do I enable SQLCipher encryption in a greenDAO Android app so the local database is password-protected?
Prompt 5
greenDAO says it is no longer maintained, how do I migrate my existing greenDAO database to ObjectBox?

Frequently asked questions

What is greendao?

An Android database library (now unmaintained) that maps Java objects to SQLite rows so you can store and retrieve data without writing raw SQL, authors now recommend ObjectBox instead.

What language is greendao written in?

Mainly Java. The stack also includes Java, Android, SQLite.

How hard is greendao to set up?

Setup difficulty is rated moderate, with roughly 30min to a first successful run.

Who is greendao for?

Mainly developer.

Open on GitHub → Ask about another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.