ReActiveAndroid is Android ORM based on popular library ActiveAndroid. Unfortunately, the author of the library stopped maintaining it, so I decided to continue maintain the library instead of him.


Add this to your app build.gradle:

implementation 'com.reactiveandroid:reactiveandroid:1.4.3'


Attention! Instant run must be disabled on first launch to to run this project correctly, as this project utilizes the ReActiveAndroid library, which to have issues with Instant Run.

Before we get started work with a database, we should to configure it, i.e. define the name and version. To do so, just create a new class and annotate it with the @Database annotation:

@Database(name = "AppDatabase", version = 1)
public class AppDatabase {

Note: database name should be specified without '.db' extension.

After that, we needed to initialize the library in onCreatemethod of the Application class:

public class App extends Application {

    public void onCreate() {

        DatabaseConfig appDatabaseConfig = new DatabaseConfig.Builder(AppDatabase.class)

        ReActiveAndroid.init(new ReActiveConfig.Builder(this)


Don't forget to add your application class to AndroidManifest.xml:


Since ReActiveAndroid supports to multiple databases, you can add several configurations of databases:

ReActiveAndroid.init(new ReActiveConfig.Builder(this)
                .addDatabaseConfigs(appDatabaseConfig1, appDatabaseConfig2, ...)

results matching ""

    No results matching ""