Store and query Java objects in a local SQLite database on Android without writing any raw SQL.
Use the query builder with named constants to avoid typo bugs in field names at compile time.
Store data in an encrypted SQLite database on Android by enabling the SQLCipher integration.
Model relationships between database tables and perform chained join queries using greenDAO's API.
Project is no longer actively maintained, new Android projects should use ObjectBox, the authors' replacement library.
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.
← greenrobot on gitmyhub — every repo by this author, as a profile.
Verify against the repo before relying on details.