-
Notifications
You must be signed in to change notification settings - Fork 2
Android Notification Client
The Aniketos Android Notification Client is an Android application that enables users to subscribe to notifications of different services.
The graphical interface of the Aniketos Android Notification Client was made relatively simple, so that users could subscribe directly to services, instead of allowing them to choose the exact type or sub-type of notification of the service to subscribe to.
In that sense, he will retrieve all types and subtypes of notifications of the services he subscribes to. However, each of the notifications are presented in the application GUI with theirs types, subtypes, values, etc.
The application uses MQTT for subscribing to the topics in the ActiveMQ broker and therefore retrieving the notifications as soon as they are published (or the ones that have been published while the client was offline). It also stores the notifications in a local sqlite database, so they can be viewed offline and after the application is restarted
The Aniketos Android Notification Client has been built so it supports both android tablets and mobile phones. When using through a mobile phone, the main gui consists of the list of services, notification or notifications per service, where that list is controlled by a top tab. When using it on tablet, the list of services is fixed on the left pane of the GUI and the right pane holds the whole list of notifications or the list of notifications per service.
The client application was built as one central Activity (MainActivity) supported by a Notification Data Content Provider (defined in the classes under the data package), an Service class (MQTTSubscriberService) responsible for the MQTT communication with the broker, and Application class (MqttApplication) for storing global data and managing properties shared within the application (such as the list of subscriptions) and several Fragment classes for responsible for the different GUIs.
The mqtt communication was implemented as a local service in order to isolate it from the Activity code and keep the connection when the Activity was in background. On the other hand, the usage of Handlers for the communication between the Activity and the MQTTSubscriberService, makes it easy to change it into a global service (available to other applications) if wanted. The mqtt handling of connections was developed through asynchronous methods using the Fusesource mqtt client library.
The Notification Data Content Provider was developed in order to support the Observer Pattern in the application and let the list of notifications in the GUI be automatically updated (through Android Loaders) when new notifications arrive through MQTT and are inserted in the content provider. Currently, the Notification Data Content Provider is a local content provider, but it could be made global so other applications could have access to the local notification data.
Finally the usage of Fragments for the different parts of the GUI, made it easier to re-use those components in the tablet version of the application.