Skip to content

NYN-05/Water_Remainder_Android

Repository files navigation

ROOT README — TEST MARKER

Water Reminder

Modern water‑intake tracker for Android with goals, reminders, history, and secure local sync.

Highlights

  • One‑tap water logging with a clean Material 3 UI.
  • Smart reminders (office, workout, travel) and active‑hours scheduling.
  • Goals, streaks, and weekly/monthly history charts.
  • Offline‑first storage with optional HTTPS sync to a local server.
Home Reminders Goals
Home Reminders Goals
History More
History More

Screens & features

  • Home: progress ring, quick log, next reminder.
  • Reminders: interval, active hours, smart modes.
  • Goals: daily goal, cup size, adaptive insights.
  • History: charts, summaries, and streaks.
  • Profile: theme selection and preferences.

Tech stack

  • Kotlin + Jetpack Compose + Material 3
  • Room + DataStore + WorkManager
  • Retrofit + OkHttp + Moshi
  • FastAPI (optional local server)

Project structure

  • app: Android application module
  • server: Optional FastAPI sync server

Quick start (Android)

  1. Open in Android Studio and sync Gradle.
  2. Run on an emulator or device.

CLI build (debug APK):
gradle -p C:\Users\JHASHANK\Downloads\water_android :app:assembleDebug

Install APK (adb):
& "$env:LOCALAPPDATA\Android\Sdk\platform-tools\adb.exe" install -r "C:\Users\JHASHANK\Downloads\water_android\app\build\outputs\apk\debug\app-debug.apk"

Secure local sync (HTTPS)

  1. Generate certs:
    python server/generate_certs.py
  2. Start server:
    python -m uvicorn server.main:app --host 0.0.0.0 --port 8000 --ssl-keyfile server/certs/server.key --ssl-certfile server/certs/server.crt
  3. Install server/certs/ca.crt on your device as a user CA.
  4. Base URL:
    • Emulator: https://10.0.2.2:8000/
    • Device: https://<YOUR_PC_IP>:8000/

Configuration

Build‑time

Set BASE_URL and API_KEY in app/build.gradle.kts.

Runtime override

Create /data/data/com.example.waterreminder/files/server_config.json:

{
  "baseUrl": "https://<YOUR_PC_IP>:8000/",
  "apiKey": "dev-key-123"
}

Push via adb:
adb push server_config.json /data/data/com.example.waterreminder/files/server_config.json

API summary

  • GET /health
  • POST /history
  • POST /device

Server writes:

  • server/data/history.csv
  • server/data/devices.json
  • ~/Downloads/water_export_YYYYMMDD_HHmm.csv

Troubleshooting

  • TLS error “Unable to parse TLS packet header”: server is running HTTP while app uses HTTPS.
  • 401 Unauthorized: API key mismatch between app and server.
  • Sync still failing: verify /health and inspect server/data/history.csv.

License

MIT (update if different).

# Water_Remainder_Android # Water_Remainder_Android

About

Water Reminder Android app with goal tracking, reminders, history, and sync.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors