A comprehensive Android application designed to empower users in managing their pain through tracking, prediction, and motivation. The app combines machine learning with Firebase backend services to provide personalized pain level predictions and visual analytics.
Pain Project is a pain management application that helps users:
- Track pain entries with symptoms and severity levels
- Receive AI-powered pain predictions based on historical data
- Visualize pain trends through interactive charts and analytics
- Maintain motivation with inspirational quotes and mood tracking
- Monitor daily streaks and progress
- Secure user registration with email and password
- Profile creation with personal and location information
- Firebase Authentication and Firestore for data persistence
- Session management with logout functionality
- Log pain entries with customizable date and time
- Select from a comprehensive symptom list
- Rate pain levels on an intuitive slider (0-100 scale)
- All entries automatically saved to Firestore
- TensorFlow Lite model trained on real pain data
- Predicts pain levels based on:
- Day of the week
- Month
- Symptom type
- Instant predictions displayed on the home screen
- Lightweight on-device inference for privacy and speed
- Personalized greeting with user's name
- Current pain prediction for selected symptoms
- Mood tracking with four mood states (Sad, Neutral, Happy, Amazing)
- Daily streak counter to encourage consistency
- Quick navigation to other features
- Interactive charts visualizing pain trends over time
- Filter pain data by:
- Date range selection
- Specific symptoms
- AAChart powered visualization
- Historical data analysis to identify patterns
- Inspirational quote display
- Random motivational messages to encourage users
- Dedicated motivation screen accessible from home
- Language: Java
- Platform: Android
- Min SDK: 24
- Target SDK: 36
- Gradle: Build automation with dependency management
- Firebase Authentication: Secure user login
- Firebase Firestore: Cloud database for user profiles and pain entries
- Google Play Services: Credentials and authentication
- TensorFlow Lite (v2.1.1): On-device ML inference
- Pre-trained Model:
pain_predictor_real_data.tflite - Privacy-first approach with local model execution
- Material Design: Modern Material 3 components
- Android Material Library: Native UI elements
- AAChartCore: Advanced charting and analytics
- MPAndroidChart: Alternative charting library
- Jetpack: Navigation, Fragment management, Constraint Layout
- Bottom Navigation: Multi-screen navigation
- Jetpack Navigation: Screen-to-screen navigation
- Fragment-based architecture with NavGraph
- Bottom navigation with 4 main screens
Pain_Project/
├── app/
│ ├── src/
│ │ ├── main/
│ │ │ ├── java/com/example/pain_project/
│ │ │ │ ├── MainActivity.java # Main activity & nav host
│ │ │ │ ├── PainApplication.java # App initialization & symptom loading
│ │ │ │ ├── PainPredictor.java # TensorFlow Lite model loader & predictor
│ │ │ │ ├── HomeScreen.java # Dashboard with prediction & mood tracking
│ │ │ │ ├── PainLog.java # Pain entry logging screen
│ │ │ │ ├── ChartFragment.java # Data visualization & analytics
│ │ │ │ ├── MotivationFragment.java # Motivational quotes screen
│ │ │ │ ├── logIn.java # User login screen
│ │ │ │ ├── Register.java # User registration screen
│ │ │ │ └── PainEntry.java # Data model for pain entries
│ │ │ ├── res/ # UI resources
│ │ │ └── assets/
│ │ │ ├── pain_predictor_real_data.tflite # TensorFlow Lite model
│ │ │ └── symptoms_map.json # Symptom code mappings
│ │ ├── test/ # Unit tests
│ │ └── androidTest/ # Instrumented tests
│ ├── build.gradle # App-level dependencies
│ └── google-services.json # Firebase configuration
├── gradle/
│ └── libs.versions.toml # Centralized dependency versions
├── build.gradle # Project-level configuration
└── README.md # This file
The app uses a bottom navigation bar with 3 main screens:
- Home Screen: Dashboard with pain prediction and mood tracking
- Pain Log: Entry form for logging new pain data
- Charts: Analytics and visualization of historical pain data
Authentication screens (Login/Register) are shown before the main app and do not display the bottom navigation.
- Android Studio (latest version recommended)
- Java 11 or higher
- Firebase project with Firestore database
- Android device or emulator (SDK 24+)
-
Clone the repository
git clone <repository-url> cd Pain_Project
-
Open in Android Studio
- File → Open and select the Pain_Project folder
-
Configure Firebase
- Create a Firebase project in the Firebase Console
- Generate a
google-services.jsonfile for your project - Place it in the
app/directory
-
Sync Gradle
- Android Studio will prompt you to sync Gradle files
- Ensure all dependencies resolve successfully
-
Build & Run
- Build → Build Bundle(s) / Build APK(s)
- Run on an emulator or connected device
users/
└── {userId}
├── name: string
├── email: string
├── phone: string
├── address: object
│ ├── state: string
│ ├── city: string
│ ├── street: string
│ └── houseNumber: string
└── painEntries/
└── {entryId}
├── year: number
├── month: number
├── day: number
├── hour: number
├── minute: number
├── symptomCode: number
├── painLevel: number
└── mood: string
The pain prediction model uses TensorFlow Lite and expects input in the following format:
- Input shape: [1, 3]
- Input features:
- Day of week (0-6, where 0 = Monday)
- Month (0-11, where 0 = January)
- Symptom code (from symptoms_map.json)
- Output: Predicted pain level (0.0-100.0)
androidx.appcompat:appcompat- Backward compatibilitycom.google.android.material:material- Material Design componentsandroidx.navigation:navigation-*- Navigation frameworkcom.google.firebase:firebase-auth- Firebase Authenticationcom.google.firebase:firebase-firestore- Firebase Databaseorg.tensorflow:tensorflow-lite:2.1.1- TensorFlow Lite model inferencecom.github.AAChartModel:AAChartCore- Advanced charting library
For complete dependency list, see gradle/libs.versions.toml and app/build.gradle.
- Navigate to the Pain Log screen via bottom navigation
- Select a date and time using the provided pickers
- Choose a symptom from the symptom list
- Adjust the pain level slider
- Submit to save to Firestore
- From the Home Screen, tap "Pick Symptom"
- Select a symptom from the dialog
- The app instantly shows a predicted pain level using the TensorFlow Lite model
- Navigate to the Charts screen
- Optionally filter by date range or symptom
- View trends and patterns in the interactive chart
- Multi-language support
- Push notifications for pain tracking reminders
- Advanced analytics with trend detection
- Export pain data as PDF/CSV
- Wearable device integration
- Enhanced ML models with additional input features
- Dark mode support
- Offline mode with sync
- Verify
google-services.jsonis in theapp/directory - Check Firebase project settings and API keys
- Ensure internet permission is granted
- Confirm
pain_predictor_real_data.tfliteexists inassets/ - Check file permissions in the build process
- Verify
symptoms_map.jsonis inassets/ - Check JSON format and encoding (UTF-8)
MIT
For questions or issues, please submit an issue on the project repository.
Last Updated: February 2026
- Lidor Kalfon
- Dana Mund
- Shaked Avdar