Visit GitHub Repo

#droitatedDB License Version

The name

droitatedDB is a shortened version of Android annotated DB.

Android annotated DB

The result is droitatedDB

At a glance

droitatedDB is a lightweight framework, which frees you from the burden of dealing with the Android SQLite database directly if you don't want to but lets you access it directly if you need to.

With an annotation based approach you are able to get a database up and running in no time. Simply annotate your data classes and let droitatedDB do the work.


  • Annotation based implementation
  • No hard coded Strings in your code
  • Code generation for the ceremonial tasks
  • Compile time protection when renaming fields or tables
  • Fall back to Android default API is always possible


Add the android-apt plugin to your project-level build.gradle:

buildscript {
  repositories {
  dependencies {
    classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8'

After that, apply inside your module-level build.gradle the android-apt plugin and add droitatedDB dependencies:

apply plugin: 'android-apt'

apt {
  arguments {
    manifest variant.outputs[0]?.processResources?.manifestFile

dependencies {
  apt 'org.droitateddb:processor:0.1.9'
  compile 'org.droitateddb:api:0.1.9'

How do I use DroitatedDb?

For the full Tutorial check out our Wiki here: Tutorial
First we need to create our database:

@Persistence(dbName = "my_database.db", dbVersion = 1)
public class PersistenceConfig implements DbUpdate {
    public void onUpdate(SQLiteDatabase db, int oldVersion, int newVersion) {
        // here you can put your update code, when changing the database version

After that we can create our first entitiy:

public class User {

   private Integer _id;
   private String name;

	public User() {
		//droitatedDB needs an empty constructor
   public User(String name) {
   		this.name = name;

Now we can store data:

EntityService userService = new EntityService(context, User.class);
userService.save(new User("Bob"));

And read data:

EntityService userService = new EntityService(context, User.class);
List<User> allUsers = userService.get();


Check out the documentation and introduction here


Get into the API details reading the technical API

Release notes

Check out the release notes, to see what's new in droitatedDB

Watch and learn from our free Android videos