How onlyinamerica/glancereader works
Main Components
• Android Device / User Interface – This element includes all user-facing parts of the application.
• App Module – This is the core component and includes:
• Android Manifest and Gradle build files.
• UI components: Activities (MainActivity, CommunityActivity, PreferencesActivity), Fragments (FeedFragment, SpritzFragment, PreferencesFragment, etc.), and Adapters.
• Business logic classes for reading formats (like Epub, HtmlPage, UnsupportedFormatException) and utilities (FileUtils, GlancePrefsManager).
• Integration with in-app billing (billing package with IabHelper, Purchase, Security, etc.).
• Event handling components (classes under the events package for various UI and logic events).
• HTTP and networking support (TrustManager and related classes).
• Lib Module – This secondary module encapsulates a reusable library (for Spritzer functionality) with its own set of activities/test cases, shared UI components, event classes, and utility functions.
• External Libraries – JAR files such as Parse-1.5.1.jar and epublib-core-latest.jar that provide additional functionality (e.g., parsing feeds, epub handling).
Relationships and Interactions
• The UI layer (Activities/Fragments) in the “app” module interacts with business logic classes and util classes to control and update the display.
• Adapters in the “app” module manage the data presentation for lists or structured views.
• The billing component interfaces with Google’s in-app billing services via AIDL (see IInAppBillingService.aidl) and the helper classes in the billing package.
• Communication between different parts of the app is facilitated through event classes (e.g., ChapterSelectRequested, NextChapterEvent, etc.), establishing an event-driven architecture.
• The lib module provides reusable Spritzer functionality which is incorporated into the main app, suggesting a clear dependency from the UI to this library for text rendering and animation.
• External libraries (Parse, epublib) serve as stand-alone modules that the business logic uses for retrieving feeds or processing EPUB files.
Architectural Patterns and Design Principles
• Modular Design: Separation between the “app” and “lib” modules helps in maintaining a clean separation of concerns.
• Event-driven Architecture: Use of event classes indicates a design that leverages event posting and handling for inter-component communication.
• Utilization of Android native components: Activities, Fragments, Adapters ensure adherence to standard Android paradigms.
• Use of Gradle for build management, demonstrating a modern Android project structure.