How rhabbachi/pfe works
Project Type and Purpose
• This is a multi-module Android mobile application (“TunavMedi”) aimed at physicians. It uses Location-Based Services (GPS) to locate patients and retrieve their medical records.
• The project consists of three Android library/executable modules:
• tunavmedi: the main application (UI, services, broadcast receivers)
• tunavmedi_dal: an abstraction layer defining data access interfaces
• tunavmedi_dal_sqlite: a concrete SQLite-based implementation of those interfaces
File Structure Analysis
• Top-level: README, project metadata, postmortem deliverables (report/, poster/, presentation/).
• source/ contains three Android projects:
• tunavmedi/ – application source, resources, tests
• tunavmedi_dal/ – interfaces for authentication and patient handling
• tunavmedi_dal_sqlite/ – contracts and helpers to persist data in SQLite
• scripts/coordinate_generator.py – test data generator for fake geo-points.
Key Insights from README
• Core functionality: physician locates patient via GPS and retrieves medical data.
• Work in progress; MIT-licensed mobile app.
• No server component in code; all data is local or loaded via DAL abstraction (future remote DAL possible).
Main Architectural Components
a. UI Layer (tunavmedi module)
• Activities (LoginActivity, MainActivity)
• Fragments for patient list, display, options, fake-location generator
• Adapters (PatientsAdapter)
• Dialog fragments for user interactions
b. Application Controllers & Services
• PatientsService – background data retrieval and sync
• BroadcastReceivers (BatteryReceiver, ChargingReceiver, NetworkReceiver) to monitor environment and trigger actions
c. Data Abstraction Layer (tunavmedi_dal module)
• Interfaces: AuthenticationHandler, PatientsHandler
• Data types: Patient, Placemark
• ModuleLoader – selects which DAL implementation to use at runtime
d. Data Persistence Layer (tunavmedi_dal_sqlite module)
• SQLite contracts (CredentialsContract, PatientsContract, PlacemarksContract)
• Helpers (AuthenticationHelper, PatientsHelper, SQLFileHelper)
• DBSetup – initial schema creation
e. External/System Services
• Android LocationManager / GPS provider for patient geolocation
• Android SharedPreferences for storing credentials or settings
f. Testing
• Android instrumentation tests in tunavmedi/tests
• coordinate_generator.py for generating test inputs
Relationships and Interactions
• UI → Service: Activities/Fragments call PatientsService to fetch/update patient data.
• Service → DAL Abstraction: PatientsService invokes PatientsHandler interface.
• ModuleLoader → DAL Implementation: at startup, ModuleLoader picks the SQLite handler provided by tunavmedi_dal_sqlite.
• DAL Implementation → SQLite DB: Helpers read/write using Contracts and SQLiteOpenHelper.
• UI → Android LocationManager: Fragments or Services request location updates.
• BroadcastReceivers → Service/UI: environment changes (battery/network) trigger broadcast events handled by the app.
Architectural Patterns and Design Principles
• Layered architecture (Presentation → Service/Controller → Data Abstraction → Persistence)
• Strategy/Factory via ModuleLoader for swapping DAL implementations
• MVC/MVP flavor in UI (Activities/Fragments manage views and delegate logic to services)
• Separation of concerns: UI vs. business logic vs. data access
• Modularization: each module compiles and tests independently
Technologies, Frameworks, and Libraries
• Android SDK (Activities, Fragments, Services, BroadcastReceivers, SQLite, SharedPreferences)
• Java (core language), JUnit/AndroidTest for testing
• Python script for coordinate generation