Feature 4.6 Daniel Clavijo - ISIS3510-MOBILE-T34/T34-Wiki-SpendiQ GitHub Wiki

Transaction Map Feature with Real-Time Updates

Overview

The Transaction Map Feature is a key functionality designed to provide users with a geographic visualization of their financial activities. It displays transaction locations on an interactive map, with real-time updates and offline capabilities. This multi-threading feature ensures smooth performance by handling location data synchronization and map updates in parallel, maintaining app responsiveness while processing complex geographical and transaction data.

Key Features

Real-Time Transaction Visualization

  • Shows transaction locations with color-coded markers (yellow for income, red for expenses).
  • Updates marker positions in real-time as new transactions occur.
  • Indicates transaction anomalies with visual alerts.

Multi-Threading Architecture

  • Utilizes background threads for data processing and synchronization.
  • Updates map markers without blocking the main UI thread.
  • Processes location data and transaction updates concurrently.
  • Performs periodic checks for new transactions every 30 seconds.

Offline Capabilities

  • Stores transaction location data locally for offline access.
  • Syncs automatically when connection is restored.
  • Provides visual indicators for offline mode and pending synchronization.

Location-Based Insights

  • Displays transaction amounts and types at each location.
  • Shows transaction history geographically.
  • Helps identify spending patterns based on location.

How It Works

Triggering Updates

  • The feature automatically monitors for new transactions in the background.
  • Updates occur when new transactions are added or when offline data is synced.
  • User location is captured at the time of transaction creation.

Multi-Threaded Processing

The feature uses multiple threads to handle different tasks:

  • UI Thread: Renders map and handles user interactions.
  • Background Thread: Processes transaction data and updates markers.
  • Sync Thread: Manages data synchronization with the server.
  • Location Thread: Handles location services and coordinate processing.

Network Connectivity Management

  • Monitors network state continuously.
  • Switches to offline mode automatically when connection is lost.
  • Queues updates for synchronization when connection is restored.
  • Provides visual feedback about connectivity status.

Data Synchronization

  • Automatically syncs local and server data.
  • Uses timestamps to track changes and updates.
  • Manages conflicts between local and server data.
  • Updates UI to reflect synchronization status.

Benefits

  • Visual Insights: Users can visualize their spending patterns geographically.
  • Performance: Multi-threading ensures smooth map interactions and updates.
  • Reliability: Offline support maintains functionality without internet.
  • Real-Time Updates: Immediate reflection of new transactions on the map.
  • User Experience: Seamless integration of location data with financial information.

Use Cases

Spending Pattern Analysis

  • View transaction concentrations in specific areas.
  • Identify frequent transaction locations.
  • Track geographical distribution of expenses vs. income.

Anomaly Detection

  • Spot unusual transaction locations.
  • Identify potential fraudulent activities.
  • Monitor spending patterns in unfamiliar areas.

Financial Planning

  • Understand location-based spending habits.
  • Identify high-expense areas.
  • Plan financial activities based on geographical insights.