How gotify/android works
Based on our review of the file tree and README, this is an Android mobile client for Gotify (which works together with the gotify/server). The project is split into two subprojects. The “app” component contains the core Android application (written largely in Kotlin) and handles UI displays, notifications, message listing/deletion, login, logging, settings, and background services (like maintaining a WebSocket connection for notifications). The “client” subproject is a Swagger-generated API client (written in Java) that abstracts the network calls to the backend server and manages the REST API interactions.
Main Components
• Mobile App (Android Client)
– User Interface Layer: Consisting of various activities (e.g., LoginActivity, MessagesActivity, LogsActivity, ShareActivity) and layout resources.
– API Module: Represented by packages under “api” (both on the app side and as part of the client subproject) that handle REST API calls to gotify/server.
– Messaging Module: Contains classes to process and display messages (e.g., MessagesModel, MessageFacade, MessageRequester, ListMessageAdapter, etc.).
– Notification & Service Modules: Components related to push notifications and background tasks (WebSocketConnection, WebSocketService, NotificationSupport, etc.).
– Settings & Miscellaneous: Includes settings activities, utility classes, logging functionality (with LoggerHelper & UncaughtExceptionHandler), and resource files.
• API Client (Swagger-Generated Client)
– This module encapsulates network operations, API endpoints, authentication classes (like OAuth, API Key authentication modules), and models for data communication.
• External Gotify Server
Relationships and Interactions
• That the Messaging Module interacts with both the UI and API Client modules to fetch, display, and delete messages.
• Optionally, indicate background logging and crash handling as a separate feature that streams exceptions to a local Log Activity.
Architectural Patterns and Technologies
• Modularity. The separation into “app” (UI, background services, notification handling) and “client” (API interface) suggests a clear separation of concerns, which is beneficial for unit testing and maintainability.
• Use of Android-specific architectural components (Activities, BroadcastReceivers like BootCompletedReceiver, services for WebSocket, etc.).
• Usage of the Swagger-codegen approach in the client submodule – which abstracts much of the boilerplate for API communication.
• External libraries if desired (e.g., Coil for image loading, Markwon for markdown processing, etc.) as supporting technologies.
Final Assembly
• Client subproject as either a separate module within the mobile app or as a shared library that interfaces with the Gotify Server.