Skip to content

covidtracker192/KASH

Repository files navigation

KASH (Android)

Android app built with Firebase and Google Maps to help users report COVID-19 status, view nearby affected users, and let health workers log in, mark patient counts, and browse a basic forum.

Features

  • Location-gated launch that prompts for GPS and location permission before entering the app.
  • User flow: phone verification → profile capture (name, age, blood group, medical info) → home dashboard with quick links to maps, emergency contacts, prevention info, and donation links.
  • Map view (UserMapsActivity) showing nearby affected users via GeoFire + Google Maps with live marker updates.
  • Worker flow: email/password login → worker home with patient marking and access to the forum.
  • Forum: simple Firebase Realtime Database feed listing submitted cases/treatment experiences; workers can post via post_forum.
  • Background services: locationupdate/Location_Services for location tracking hooks (permissions required).

Tech Stack

  • Android SDK 29 (minSdk 24), Android Gradle Plugin 3.6.3
  • Firebase Auth, Realtime Database, Analytics
  • Google Play Services: Maps, Location
  • GeoFire for geo queries
  • AndroidX + legacy support libs (appcompat/constraintlayout)

Project Structure

  • Root Gradle settings in settings.gradle; app module at app/.
  • Key activities under app/src/main/java/com/example/kash/:
    • MainActivity: splash, GPS/permission gate, routes to login_global.
    • login_global: entry selector for user vs worker.
    • login_user and user_verification: collect phone/profile data and persist to Firebase (Users, Unaffected).
    • home: user dashboard with navigation to maps, emergency contacts, prevention info, donations.
    • UserMapsActivity: Google Map + GeoFire markers for nearby affected users.
    • login_worker and worker_home: worker auth and home; stops location service, opens forum/patient marking/settings.
    • forum + forumdb: reads Realtime DB FORUM entries and renders them.
    • Other screens: patient_num, mark_worker, post_forum, profile, settings, settings_worker, preventive_measure, emergency_contact, password_change, etc.

Prerequisites

  • Android Studio (3.6+ recommended) with Android SDK 29.
  • A Firebase project with Realtime Database and Authentication enabled.
  • A Google Maps API key (placed in app/src/main/res/values/google_maps_api.xml).

Setup

  1. Clone the repo and open the root folder in Android Studio.
  2. Firebase config: place your google-services.json under app/ (file is already referenced in the repo path).
  3. Maps API key: update google_maps_api.xml for debug/release with your key.
  4. Sync Gradle. If you see play-services/Firebase version clashes, align to a single BoM or bump the versions (the project mixes AndroidX and legacy support libs).

Build & Run

  • From Android Studio: Run the app configuration on a device/emulator with Google Play Services.
  • From CLI:
    • ./gradlew clean assembleDebug
    • Install the APK from app/build/outputs/apk/debug/ onto a device with Google Play Services.

Permissions

  • Location: ACCESS_FINE_LOCATION, ACCESS_BACKGROUND_LOCATION, FOREGROUND_SERVICE used by maps and tracking services.
  • Network: ACCESS_NETWORK_STATE for connectivity checks.

Data Flows

  • User profile writes to Firebase paths Users/{uid} and Unaffected/{uid}.
  • Worker login uses Firebase Auth email/password; email is cached in shared preferences (ID).
  • GeoFire reads/writes from Locations to place markers for affected users.
  • Forum posts live under FORUM in Realtime Database; forumdb is the model for entries.

Notes & Caveats

  • Location permission is mandatory; the app exits if GPS is disabled.
  • The code mixes AndroidX and old support libraries; consider migrating fully to AndroidX to avoid conflicts.
  • Ensure proper database rules and authentication in Firebase before deploying.

About

Karnataka State Health

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors