Skip to content

Native Android productivity platform featuring an Offline-First architecture (SQLite + Firebase). Engineered with Actionable FCM Notifications, Sensor Fusion (Accelerometer), and a Probabilistic RPG Combat Engine.

Notifications You must be signed in to change notification settings

bteodora/questlog-android-native

Repository files navigation

QuestLog Core

Gamified Productivity & Social RPG Platform for Android

Android API 33 Java 17 Firebase Hybrid DB Actionable Notifications Sensor Fusion

QuestLog is a meticulously engineered native Android application, pushing the boundaries of mobile productivity by integrating sophisticated MMORPG mechanics. It establishes an "Offline-First" distributed data architecture, features a robust probabilistic combat engine, and leverages advanced Android OS capabilities for real-time, actionable, and context-aware user engagement.

📄 Read the full Specification (PDF) »
📄 View Engineering Specification (PDF) » | 🏛 Explore Architecture » | ⚙️ Engineering Deep Dive »



1. Executive Summary

QuestLog redefines habit tracking by transforming mundane daily tasks into an engaging, progressive RPG narrative. This platform addresses critical shortcomings in user engagement by implementing a complex Gamification Metagame (algorithmic progression, itemization, boss encounters) coupled with a Real-time Social Ecosystem (Alliances, cooperative missions).

From a software engineering standpoint, QuestLog is a comprehensive demonstration of Android SDK mastery. It transcends typical mobile applications by featuring:

  • Offline-First Data Architecture: Ensuring seamless user experience regardless of network connectivity.
  • Advanced System Integration: Leveraging background services, foreground services, and hardware sensors for context-aware interactions.
  • Robust Algorithmic Core: Implementing deterministic and probabilistic logic for character progression, combat, and reward distribution.
  • Bi-directional Communication: Pioneering actionable, real-time notifications for critical social and gameplay events.

2. Architecture and Data Flow

The application is structured around a Layered Architecture (Presentation, Business Logic, Data Access) within an Offline-First paradigm. This ensures high responsiveness and data integrity, even during network outages.

2.1 Hybrid Persistence Strategy

To achieve both offline capability and real-time cloud synchronization, QuestLog employs a sophisticated Hybrid Persistence model:

  • Local Data Store (SQLite): Serves as the primary, high-performance local cache. All mission-critical user data (task lists, XP, HP, inventory) is stored in a normalized relational schema. This guarantees zero-latency UI updates and uninterrupted gameplay.
  • Cloud Data Store (Firebase Firestore / Realtime Database): Firebase acts as the central, authoritative source of truth. It stores user profiles, social graphs (friends, alliances), and shared mission states. Background services orchestrate asynchronous, eventually-consistent synchronization between SQLite and Firebase, implementing conflict resolution strategies.

2.2 Background Synchronization & Event-Driven Updates

Maintaining data consistency and delivering real-time social interactions requires robust background processing.

  • Firebase Cloud Messaging (FCM): The backbone for push notifications. FCM payloads trigger specific BroadcastReceivers and JobIntentServices to process updates in the background, even when the app is not active.
  • Real-time Database Listeners: ValueEventListeners on Firebase Realtime Database are meticulously managed to subscribe to critical social events (e.g., Alliance Chat messages, Boss HP changes), ensuring instant, low-latency updates.
  • WorkManager/AlarmManager (Implicit): Implicitly, complex, time-bound tasks (like long-running Alliance missions) would leverage WorkManager for guaranteed execution or AlarmManager for precise scheduling, ensuring integrity of the game state.

3. Engineering Deep Dive

3.1 Advanced Notification System

QuestLog redefines mobile user engagement through highly interactive and context-aware notifications.

  • Actionable Intents & Remote Input: Notifications are not passive. Users can reply to Alliance chat messages or accept/decline Alliance invitations directly from the notification shade using RemoteInput. This minimizes friction and enhances social immediacy.
  • Deep Linking & Back Stack Management: Clicking a complex notification (e.g., "Alliance Boss Raid has started!") navigates the user directly to the relevant Fragment within the application, constructing a synthetic back stack to preserve navigational context.
  • Notification Channels: Adheres to Android's NotificationChannel API for granular user control over notification categories and priorities, enhancing user experience and compliance.

3.2 Deterministic & Probabilistic Game Logic

The core gamification engine is a blend of mathematical precision and calculated risk.

  • Algorithmic Progression: User leveling and Boss HP scaling follow complex, dynamically calculated formulas based on current level and historical performance. This ensures a balanced and challenging progression curve.
  • Probabilistic Combat Engine: Boss battles incorporate a sophisticated probabilistic algorithm where the "Hit Chance" is dynamically calculated based on the user's real-world task completion success rate over a defined period (e.g., last 7 days). This ties real-world habits directly to in-game success.
  • Deterministic Formulas: XP allocation, currency rewards, and item drop rates are governed by meticulously defined deterministic formulas, ensuring fairness and predictability within the game economy.

3.3 Sensor Fusion & Physical Interaction

QuestLog integrates directly with device hardware to create immersive interactions.

  • Accelerometer Integration: Utilizes the SensorManager API to listen for raw accelerometer data. Custom signal processing logic detects specific "Shake" events, transforming physical user movement into impactful in-game combat actions (e.g., attacking a Boss).
  • QR Code Integration: Seamlessly integrates ZXing for generating and scanning QR codes, facilitating effortless friend discovery and Alliance invites without manual input.

4. Functional Modules & Implementation Details

Module Technical Implementation Highlights
Identity & Session Management Secure Auth: Firebase Authentication (Email/Password) for robust user identity. Local session persistence using SharedPreferences with custom encryption for sensitive user settings.
User Statistics & Analytics Dynamic Visualization: MPAndroidChart integration to render real-time, interactive graphs (line, bar, donut charts) displaying progress metrics (XP velocity, task categories, success streaks) directly from optimized SQLite queries.
Social Ecosystem & Alliance Raids Real-Time Presence: Firebase Realtime Database manages Alliance membership and chat. Cooperative Boss Mechanics: Alliance-wide Boss HP scales with member count, requiring synchronized task completion to defeat.
Virtual Economy & Inventory Transactional Integrity: Manages in-game currency (Gold) and equipment acquisition/utilization. Complex logic for item activation, temporary/permanent buffs, and weapon upgrades with statistical modifiers.
Task Management & Scheduling Flexible Task Lifecycle: Supports single-shot and recurring tasks with granular scheduling. Manages task states (Active, Completed, Paused, Canceled, Failed) with time-sensitive auto-transitions.

5. Technology Stack

Core Android Development

  • Language: Java 17 (leveraging modern language features)
  • Framework: Android SDK (API Level 33+)
  • Architecture: Adheres to a strict Layered Architecture (Presentation, Business Logic, Data Access) within the Android component model (Activities, Fragments).
  • Concurrency: Robust use of ExecutorService, HandlerThread, and AsyncTask for efficient background task execution, ensuring UI responsiveness.

Backend-as-a-Service (BaaS) & Cloud Integration

  • Authentication: Firebase Authentication (secure, scalable user identity management).
  • Databases:
    • Cloud Firestore: Primary cloud store for user profiles, items, and structured game data.
    • Firebase Realtime Database: Optimized for low-latency, real-time social interactions (chat, live Boss HP).
  • Messaging: Firebase Cloud Messaging (FCM) for push notifications (unicast and topic-based).

Advanced Libraries & Integrations

  • Data Visualization: MPAndroidChart for high-performance, interactive graph rendering.
  • Animations: Lottie for fluid, JSON-based vector animations, enhancing UX feedback (e.g., loot box opens, boss hit effects).
  • QR Codes: ZXing QR Code Scanner for seamless camera integration and QR code functionality.
  • UI/UX: Material Design Components for a consistent, modern visual language and DayNight themes for adaptive UI.

6. UI/UX Gallery

The application implements a meticulously crafted UI/UX, featuring full adaptive theming with DayNight resources to automatically switch between light and dark modes based on system preferences.

Authentication & Core Profile

Secure Registration Seamless Login Dynamic User Profile

Alliance & Social Interaction

Friend Discovery Alliance Hub Real-time Chat

Inventory & In-App Economy

Virtual Shop Active Inventory User Statistics

7. Demo & Engineering Specification

Demo Video

Full Engineering Specification

About

Native Android productivity platform featuring an Offline-First architecture (SQLite + Firebase). Engineered with Actionable FCM Notifications, Sensor Fusion (Accelerometer), and a Probabilistic RPG Combat Engine.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •