6 Architecture
Paul Schaub edited this page 2019-09-11 11:17:09 +02:00

Mercury Architecture

The Mercury-IM repository contains multiple modules that contain different functionality.

The idea behind this is to separate out different functionalities and concerns into modules that can be resused easily.

Module Dependencies

The database scheme currently looks roughly like this:

Database Scheme


The app submodule contains the main Android app. It depends on core and persistence-room. Basically this submodule embeds the logic of the core module in an Android environment.


  • Activities, Fragments
  • Layouts
  • Android-specific services
  • in general Android related stuff


The core module is a plain Java library which contains most of the XMPP logic which is unrelated to Android. It depends on persistence. The idea behind the core module is to have the XMPP related logic tightly packed so that at some point it will be easy to create a Mercury IM desktop app by simply embedding the core module in a UI framework like JavaFX.


  • Smack stuff
  • MercuryConnection
  • XmppEventHandler (Roster, Message...)


The persistence module is a plain Java library which defines a set of interfaces that represent persistence related classes like models and repositories.


  • Entities (Interfaces)
  • Repositories


persistence-room is an Android Library which extends persistence classes specifically for the use with Android Jetpacks Room Database.


  • RoomDAOs
  • RoomEntities
  • RoomRepositories