Android Care Provider Application - Detailed Structure

Project: Psyter Android Care Provider
Package: com.psyter.www (client flavor) / com.psyter.www.careprovider (careprovider flavor)
Version: 2.0.33 (Code: 68)
Last Updated: November 5, 2025


📁 Root Structure

AndroidCareProvider/
├── app/                           # Main application module
│   ├── src/                       # Source code
│   │   ├── main/                  # Main source set
│   │   ├── test/                  # Unit tests
│   │   ├── androidTest/           # Instrumented tests
│   │   ├── client/                # Client flavor resources
│   │   └── careprovider/          # Care provider flavor resources
│   ├── libs/                      # Local library files (JARs)
│   ├── build.gradle               # App-level build configuration
│   ├── google-services.json       # Firebase configuration (production)
│   ├── google-services_dev.json   # Firebase configuration (development)
│   └── proguard-rules.pro         # ProGuard/R8 rules
├── duo-navigation-drawer/         # Custom navigation drawer module
├── intlphoneinput/               # International phone input module
├── gradle/                        # Gradle wrapper files
├── release/                       # Release builds
├── build.gradle                   # Project-level build configuration
├── gradle.properties              # Gradle properties
├── settings.gradle                # Project settings
├── gradlew                        # Gradle wrapper script (Unix)
├── gradlew.bat                   # Gradle wrapper script (Windows)
└── README.md                     # Project documentation

📦 Main Application Module (/app)

Build Configuration

File: app/build.gradle

Purpose: Defines app configuration, dependencies, and build variants with product flavors

Key Configurations:
- Compile SDK: 33 (Android 13)
- Min SDK: 21 (Android 5.0 Lollipop)
- Target SDK: 33
- Version Code: 68
- Version Name: 2.0.33

Product Flavors:

flavorDimensions "environment"

productFlavors {
    client {
        dimension "environment"
        applicationId "com.psyter.www"
    }

    careprovider {
        dimension "environment"
        applicationId "com.psyter.www.careprovider"
    }
}

Purpose of Flavors:
- client: Base flavor for testing/development
- careprovider: Production flavor with separate package ID for Play Store

Build Features:
- Data Binding enabled
- View Binding enabled
- NDK support (version 23.1.7779620)
- Language splitting disabled
- Packaging options to exclude META-INF conflicts

New Dependencies (vs Android Client):
- VideoSDK: live.videosdk:rtc-android-sdk:0.1.31 - Modern video calling SDK
- Lottie: lottie:5.2.0 - Animation library
- Calendar: awesome-calendar:2.0.0 - Advanced calendar component
- YouTube Player: androidyoutubeplayer:core:12.1.0 - Embedded YouTube videos
- Audio Recording: AudioRecordView:1.0.5 - Voice note recording
- Facebook SDK: facebook-android-sdk:latest.release - Social integration
- Permissions: android-permissions:3.8 - Simplified permission handling
- Fragment: androidx.fragment:1.6.2 - Modern fragment support
- Glide (Updated): 4.16.0 - Latest image loading
- GIF Support: android-gif-drawable:1.2.22 - Animated GIF rendering
- Image Cropper: android-image-cropper:4.3.3 - Profile photo cropping
- In-App Review: play-services:review:2.0.1 - Request app reviews
- App Update: play-services:app-update:2.1.0 - In-app updates
- Asset Delivery: play-services:asset-delivery:2.2.2 - Dynamic feature modules


📱 Source Code Structure (/app/src/main)

1. Android Manifest (AndroidManifest.xml)

Purpose: App configuration, permissions, and component declarations

Key Permissions (Additional to Client):
- POST_NOTIFICATIONS - Push notification permission (Android 13+)
- BLUETOOTH_CONNECT - Bluetooth connectivity
- All permissions from Android Client app

Application Configuration:
- Custom Application Class: MainApplication.java
- Facebook Integration: Meta-data for Facebook SDK
- Network Security Config: Enforces HTTPS
- Picture-in-Picture: Supported for video calls

Main Components:
- 80+ Activities declared
- Firebase Messaging Service
- Background services for calls
- Floating window service
- WorkManager workers
- Broadcast receivers

Entry Point:
- Launch Activity: Registration.Activities.SplashActivity

Special Activities:
- OneToOneCallActivity:
- Launch mode: singleTask
- Picture-in-Picture enabled
- Config changes handled (orientation, screen size, keyboard)
- Task affinity for separate task stack


2. Java Source Code (/java/com/psyter/www)

🎯 Package Organization

Root Level (com.psyter.www)

Application Class

File: MainApplication.java
- Purpose: Application-level initialization
- Key Functions:
- Initialize VideoSDK
- Setup Crashlytics
- Configure global error handlers
- Initialize Firebase
- Setup memory leak detection (debug)
- Configure Glide
- Lifecycle:
- onCreate() - App start initialization
- Setup dependency injection (if used)
- Connections:
- All activities and services
- Singleton pattern for app-wide resources

Firebase Services

File: MyFirebaseMessagingService.java
- Purpose: Enhanced FCM handling with video call support
- Key Functions:
- Receives push notifications
- Handles incoming call notifications
- Shows notification UI with call accept/reject
- Background/foreground differentiation
- Notification channel management (Android O+)
- Special Handling:
- Video call notifications with custom actions
- High priority notifications for calls
- Sound and vibration patterns
- Heads-up notification for incoming calls
- Actions:
- Accept Call → Launch OneToOneCallActivity
- Reject Call → Send rejection to backend
- Open App → Navigate to relevant screen

File: MyFirebaseInstanceIdService.java
- Purpose: FCM token management
- Enhanced Features:
- Token refresh handling
- Send token to multiple backend endpoints
- Provider availability status sync
- Token Usage:
- Push notifications
- Video call signaling
- Chat messages

Observable Pattern

File: MessageObservable.java
- Purpose: Event bus for real-time message updates
- Pattern: Observer/Observable pattern
- Use Cases:
- Chat message received
- Call status changed
- Appointment updated
- Notification received
- Methods:
- addObserver(Observer o) - Register listener
- notifyObservers(Object data) - Broadcast event
- deleteObserver(Observer o) - Unregister listener

Custom Listeners

File: CustomOnClickListener.java
- Purpose: Interface for custom click events
- Type: Callback interface
- Usage:
- Prescription item clicks
- Appointment item clicks
- Client list item clicks

File: OnClickPrescriptionList.java
- Purpose: Specific interface for prescription interactions
- Methods:
- onPrescriptionClick(PrescriptionModel)
- onEditClick(PrescriptionModel)
- onDeleteClick(PrescriptionModel)


👨‍⚕️ Care Provider Package (/CareProvider)

Purpose: Core care provider functionality - main focus of this app

CareProvider/
├── Activities/                # All provider-specific activities
├── Fragments/                 # Provider dashboard fragments
├── Adapters/                  # RecyclerView adapters
├── DataModels/               # Data models
├── Schedule/                  # Scheduling management
├── NavigationListener.java    # Navigation interface
├── OnSelectMedicine.java      # Medicine selection callback
└── OnSelectMedicineDiagnose.java  # Diagnosis selection callback

Activities (/CareProvider/Activities)

Core Activities:

1. MainActivityCareProvider.java
- Purpose: Main dashboard and navigation hub
- Layout: Bottom navigation + navigation drawer
- Tabs:
- Home/Dashboard
- Appointments
- Clients
- Schedule
- Profile
- Features:
- Real-time appointment count
- Notification badges
- Quick actions
- Revenue summary
- Upcoming sessions widget
- Navigation:
- Fragment transaction manager
- Back stack handling
- Deep link support

2. OneToOneCallActivity.java
- Purpose: Video consultation interface
- SDK: VideoSDK (live.videosdk:rtc-android-sdk)
- Features:
- HD video rendering
- Audio-only mode toggle
- Screen sharing capability
- Picture-in-Picture mode
- Network quality indicator
- Call timer
- Participant list
- Chat during call
- Recording controls
- UI Components:
- Local video preview
- Remote video view
- Control buttons (mute, camera, end)
- Screen share view
- Connection quality indicator
- Lifecycle:
- onCreate() - Initialize VideoSDK
- onPause() - Handle background state
- onPictureInPictureModeChanged() - PiP handling
- onDestroy() - Clean up resources
- Permissions Required:
- Camera
- Microphone
- Draw over apps (for floating window)
- Network Handling:
- Automatic quality adjustment
- Reconnection on network change
- Poor connection warnings
- Data Captured:
- Call duration
- Connection quality metrics
- Recording files (if enabled)
- Call notes

3. CreateOrJoinActivity.java
- Purpose: Create or join video call session
- Use Cases:
- Provider initiates call
- Provider joins client-initiated call
- Group session creation
- Features:
- Meeting ID input
- Generate meeting ID
- Join existing session
- Configure call settings
- Settings:
- Audio/video toggle
- Select camera (front/back)
- Microphone selection

4. AppointmentDetailsActivity.java
- Purpose: View and manage appointment details
- Sections:
- Client information
- Appointment date/time
- Session type
- Payment status
- Session notes
- Prescription history
- Documents
- Actions:
- Start session
- Reschedule
- Cancel (with reason)
- Add notes
- Write prescription
- Upload documents
- Send message
- Access:
- From appointments list
- From notifications
- From calendar events

5. ClientProfileActivity.java
- Purpose: View complete client profile
- Tabs:
- Overview (basic info)
- Medical History
- Session History
- Prescriptions
- Documents
- Homework
- Diary/Mood logs
- Overview Section:
- Photo, name, age, gender
- Contact information
- Emergency contact
- Insurance details
- Assigned by (referral info)
- Medical History:
- Past diagnoses
- Current medications
- Allergies
- Comorbidities
- Treatment history
- Session History:
- All past sessions
- Session notes
- Progress tracking
- Charts and graphs
- Actions:
- Schedule appointment
- Send message
- Make referral
- Add diagnosis
- Request documents

6. PrescriptionActivity.java
- Purpose: Create and manage prescriptions
- Features:
- Multiple medications
- Dosage and frequency
- Duration
- Instructions
- Diagnoses link
- Templates for common prescriptions
- Medication Fields:
- Medicine name (searchable database)
- Form (tablet, syrup, injection, etc.)
- Strength (mg, ml, etc.)
- Dosage (1 tablet, 2 teaspoons, etc.)
- Frequency (daily, twice daily, etc.)
- Duration (days, weeks, months)
- Route (oral, topical, etc.)
- Special instructions
- Actions:
- Save draft
- Submit prescription
- Print/PDF generation
- Email to client
- Share with pharmacy
- Validation:
- Drug interactions check
- Allergy warnings
- Dosage safety limits

7. AddPrescriptionActivity.java (in /views/activity)
- Purpose: New prescription creation form
- UI:
- Step-by-step wizard
- Medicine search
- Dosage calculator
- Preview before submit
- Integration:
- Medicine database API
- Drug interaction checker
- Client allergy checker

8. SessionNotesActivity.java
- Purpose: Document session observations and notes
- Sections:
- Chief complaint
- Present condition
- Observations
- Mental status examination
- Assessment
- Plan
- Homework assigned
- Features:
- Voice-to-text
- Templates
- Auto-save
- Private notes option
- Format:
- Rich text editor
- Bullet points
- Sections
- Tags

9. HomeworkActivity.java
- Purpose: Assign therapeutic homework
- Types:
- Worksheets
- Exercises
- Journals
- Reading assignments
- Practice tasks
- Fields:
- Title
- Description
- Instructions
- Attachments
- Due date
- Points/grading
- Templates:
- CBT worksheets
- Mindfulness exercises
- Mood tracking
- Activity scheduling

10. HomeWorkCheckActivity.java
- Purpose: Review and provide feedback on submitted homework
- Display:
- Homework details
- Client submission
- Submission date
- Attachments
- Feedback:
- Text comments
- Score/rating
- Mark as complete
- Request revision
- Actions:
- Approve
- Reject with feedback
- Grade assignment
- Schedule follow-up

11. HomeworkFeedbackHistoryActivity.java
- Purpose: View history of homework feedback
- List:
- All homework assignments
- Completion status
- Feedback given
- Client progress
- Filters:
- By client
- By date range
- By completion status

12. RevenueActivity.java
- Purpose: Financial dashboard for provider
- Metrics:
- Total earnings
- Earnings this month
- Earnings this week
- Average session fee
- Payment pending
- Payment received
- Charts:
- Earnings trend (line chart)
- Sessions by type (pie chart)
- Monthly comparison (bar chart)
- Transaction List:
- Date
- Client name
- Amount
- Payment method
- Status
- Filters:
- Date range
- Payment status
- Client
- Export:
- PDF report
- CSV export
- Tax documents

13. ReserveSlotActivity.java
- Purpose: Block time slots for reservations
- Use Cases:
- Client wants to book but needs approval
- Provider holds slot for specific client
- Temporary booking
- Duration:
- Configurable hold time (15-30 mins)
- Automatic release on expiry
- Notification:
- Client notified of reservation
- Expiry reminder

14. ReferralActivity.java
- Purpose: Create referrals to other specialists
- Form:
- Client selection
- Specialist selection/search
- Reason for referral
- Relevant documents
- Priority level
- Notes
- Specialist Search:
- By specialty
- By name
- By location
- Network providers
- Actions:
- Send referral
- Track status
- View response
- Communicate with specialist

15. ClientListActivity.java
- Purpose: View all clients
- List:
- Active clients
- Past clients
- Pending clients (awaiting first session)
- Client Card:
- Photo
- Name
- Next appointment
- Last session date
- Quick actions
- Search:
- By name
- By condition
- By status
- Filters:
- Active/inactive
- By appointment date
- By diagnosis
- Bulk Actions:
- Send group message
- Export client list

16. CalendarActivity.java
- Purpose: Provider’s calendar view
- Views:
- Day view
- Week view
- Month view
- Display:
- Appointments
- Blocked slots
- Available slots
- Holidays
- Actions:
- Add appointment
- Block slot
- Edit availability
- View appointment details
- Color Coding:
- Video sessions
- Audio sessions
- In-person sessions
- Blocked time
- Available time

17. AppointmentBookingSuccessActivity.java
- Purpose: Confirmation screen after booking
- Display:
- Success message
- Appointment details
- Next steps
- Payment confirmation
- Actions:
- Add to calendar
- Share appointment
- Set reminder
- Return to dashboard

18. CarePListingFiltersActivity.java
- Purpose: Advanced search filters (when browsing other providers)
- Filters:
- Specialty
- Sub-specialty
- Gender
- Languages
- Experience
- Rating
- Price range
- Availability
- Location
- Accepts insurance
- UI:
- Expandable sections
- Multi-select chips
- Range sliders
- Toggle switches
- Actions:
- Apply filters
- Clear filters
- Save filter preset

19. NotificationsActivity.java
- Purpose: Notification center
- Categories:
- Appointments
- Messages
- Reviews
- Payments
- System
- Notification Types:
- New appointment
- Appointment reminder
- Cancellation
- Payment received
- New message
- Client review
- Homework submission
- Actions:
- Mark as read
- Clear all
- Navigate to related content
- Badge:
- Unread count
- Real-time updates


Fragments (/CareProvider/Fragments)

1. DashboardFragment.java
- Purpose: Provider dashboard home screen
- Widgets:
- Today’s appointments card
- Weekly statistics
- Recent reviews
- Quick actions
- Earnings summary
- Pending tasks
- Quick Actions:
- Start video call
- View schedule
- Check messages
- View clients
- Statistics:
- Sessions this week
- New clients
- Revenue this week
- Average rating

2. AppointmentsFragment.java
- Purpose: Appointment management
- Tabs:
- Upcoming
- Today
- Past
- Cancelled
- List Item:
- Client photo and name
- Date and time
- Session type icon
- Payment status
- Quick actions
- Actions:
- View details
- Start session
- Reschedule
- Cancel
- Add notes
- Filters:
- By date range
- By session type
- By payment status

3. ClientsFragment.java
- Purpose: Client list management
- Views:
- All clients
- Active (recent sessions)
- New (pending first session)
- Archived
- Search:
- Real-time search
- Search by name, condition, or tags
- Sort:
- Alphabetical
- Last session
- Next appointment
- By diagnosis
- Actions:
- View profile
- Schedule appointment
- Send message
- View history

4. ScheduleFragment.java
- Purpose: Availability and schedule management
- Views:
- Weekly calendar
- Daily schedule
- Availability settings
- Features:
- Set recurring availability
- Block specific dates
- Set break times
- Emergency availability toggle
- Visual:
- Color-coded time blocks
- Drag-to-create slots
- Conflict warnings

5. ProfileFragment.java
- Purpose: Provider profile management
- Sections:
- Personal info
- Professional info
- Credentials
- Services offered
- Pricing
- Languages
- About/bio
- Photo gallery
- Reviews
- Edit:
- Update information
- Upload documents
- Change photo
- Manage services
- Preview:
- View as client sees it

6. EarningsFragment.java
- Purpose: Financial overview
- Tabs:
- Overview
- Transactions
- Reports
- Charts:
- Monthly earnings trend
- Payment methods breakdown
- Session types revenue
- Actions:
- Generate report
- Export data
- View payout history

7. ReviewsFragment.java
- Purpose: Manage client reviews
- Display:
- Overall rating
- Rating breakdown (5-star distribution)
- Review list
- Response status
- Actions:
- Respond to review
- Report inappropriate review
- Filter by rating
- Sorting:
- Most recent
- Highest rating
- Lowest rating
- Needs response

8. SettingsFragment.java
- Purpose: App settings
- Sections:
- Account settings
- Notification preferences
- Availability defaults
- Payment settings
- Privacy settings
- Language
- Theme (light/dark)
- Notifications:
- Push notifications toggle
- Email notifications
- SMS notifications
- Sound and vibration
- Privacy:
- Profile visibility
- Search visibility
- Data sharing preferences


Adapters (/CareProvider/Adapters)

1. AppointmentsAdapter.java
- Purpose: Display appointment list
- View Types:
- Upcoming appointment
- Today’s appointment
- Past appointment
- View Holder:
- Client info
- DateTime
- Session type badge
- Status indicator
- Action buttons
- Actions:
- Click → Details
- Long click → Quick menu
- Swipe → Cancel/Reschedule

2. ClientsListAdapter.java
- Purpose: Display client list
- View Holder:
- Profile photo
- Name and age
- Last session
- Next appointment
- Status badge
- Features:
- Alphabetical headers
- Search highlighting
- Quick action button
- Click Actions:
- Single click → Profile
- Long click → Menu
- Button click → Schedule

3. PrescriptionListAdapter.java
- Purpose: Display prescriptions
- View Holder:
- Date
- Diagnosis
- Medications count
- Status
- Actions:
- View details
- Edit
- Resend
- Print

4. SessionNotesAdapter.java
- Purpose: Display session notes list
- View Holder:
- Date
- Session type
- Summary preview
- Tags
- Actions:
- View full note
- Edit
- Export
- Share (if allowed)

5. HomeworkAdapter.java
- Purpose: Display homework assignments
- View Holder:
- Title
- Client name
- Due date
- Submission status
- Grade/feedback status
- Status Badges:
- Pending
- Submitted
- Graded
- Overdue

6. RevenueAdapter.java
- Purpose: Display transaction list
- View Holder:
- Date
- Client name
- Amount
- Payment method
- Status
- Color Coding:
- Green: Received
- Yellow: Pending
- Red: Failed/Refunded

7. ReviewsAdapter.java
- Purpose: Display client reviews
- View Holder:
- Client name (or anonymous)
- Rating stars
- Review text
- Date
- Response (if any)
- Actions:
- Respond
- Report
- Thank


Data Models (/CareProvider/DataModels)

1. AppointmentDataModel.java

class AppointmentDataModel {
    String appointmentId;
    String clientId;
    String providerId;
    Date dateTime;
    int durationMinutes;
    String sessionType; // Video, Audio, In-person
    String status; // Scheduled, Completed, Cancelled, No-show
    double fee;
    String paymentStatus;
    String paymentMethod;
    String cancellationReason;
    String sessionNotes;
    boolean hasRecording;
    String recordingUrl;
    String meetingId;
}

2. ClientDataModel.java

class ClientDataModel {
    String clientId;
    String fullName;
    String email;
    String phone;
    String photoUrl;
    Date dateOfBirth;
    String gender;
    String address;
    String emergencyContact;
    String insuranceInfo;
    List<String> diagnoses;
    List<String> medications;
    List<String> allergies;
    Date firstSessionDate;
    Date lastSessionDate;
    int totalSessions;
    String status; // Active, Inactive, Archived
    String assignedBy; // Referral source
}

3. SessionNotesDataModel.java

class SessionNotesDataModel {
    String noteId;
    String sessionId;
    String clientId;
    Date sessionDate;
    String chiefComplaint;
    String presentCondition;
    String observations;
    String mentalStatusExam;
    String assessment;
    String plan;
    String homeworkAssigned;
    String privateNotes;
    List<String> tags;
    boolean isLocked;
}

4. PrescriptionDataModel.java

class PrescriptionDataModel {
    String prescriptionId;
    String clientId;
    String providerId;
    Date prescriptionDate;
    List<MedicationItem> medications;
    String diagnosis;
    String additionalInstructions;
    boolean isSent;
    String pharmacyName;
}

class MedicationItem {
    String medicineName;
    String form;
    String strength;
    String dosage;
    String frequency;
    int duration;
    String route;
    String instructions;
}

5. HomeworkDataModel.java

class HomeworkDataModel {
    String homeworkId;
    String clientId;
    String providerId;
    String title;
    String description;
    String instructions;
    Date assignedDate;
    Date dueDate;
    String homeworkType;
    List<String> attachments;
    String submissionText;
    List<String> submissionFiles;
    Date submittedDate;
    String feedback;
    double score;
    String status; // Assigned, Submitted, Graded, Overdue
}

6. RevenueDataModel.java

class RevenueDataModel {
    String transactionId;
    String clientId;
    String appointmentId;
    Date transactionDate;
    double amount;
    String currency;
    String paymentMethod;
    String status;
    String payoutStatus;
    Date payoutDate;
    double platformFee;
    double netAmount;
}

7. ReviewDataModel.java

class ReviewDataModel {
    String reviewId;
    String clientId;
    String providerId;
    int rating; // 1-5
    String reviewText;
    Date reviewDate;
    String providerResponse;
    Date responseDate;
    boolean isAnonymous;
    boolean isReported;
}


Schedule Package (/CareProvider/Schedule)

Purpose: Schedule and availability management

MarkAvailabiltyActivity.java
- Purpose: Set availability for specific dates
- UI:
- Calendar picker
- Time slot grid
- Recurring options
- Features:
- Select multiple dates
- Set time ranges
- Different rates for different times
- Break times
- Recurring patterns (weekly, bi-weekly, monthly)
- Validation:
- No overlapping slots
- Minimum slot duration
- Buffer time between sessions
- Actions:
- Save availability
- Block specific dates
- Copy from previous week
- Clear schedule

WeeklyScheduleActivity.java
- Purpose: View and edit weekly schedule
- Display:
- 7-day grid
- Hourly time slots
- Color-coded blocks
- Editing:
- Drag to create availability
- Drag to resize
- Click to edit details
- Delete availability
- Templates:
- Save as template
- Load template
- Share with assistant


📱 Client Package (/Client)

Purpose: Limited client functionality (for testing or dual-role users)

Note: This package contains client-side features identical to Android Client app. Care providers can also book appointments with other providers or manage their own therapy if needed.

Key Activities:
- BlogsActivity
- BlogDetailsActivity
- NotificationsActivity
- AddUpdateDiaryActivity
- PDFviewerActivity


🌐 Common User Package (/CommonUser)

Purpose: Shared functionality between clients and providers

Activities

1. RateCareProviderActivity.java
- Purpose: Rate another provider (if provider is also a client)
- Same as Android Client implementation

2. MedicalSourcesActivity.java
- Purpose: Educational resources
- Content:
- Research articles
- Treatment guidelines
- Training videos
- Professional development resources
- Categories:
- Clinical guidelines
- Research papers
- Case studies
- Continuing education

3. CarePListActivity.java
- Purpose: Browse other care providers
- Use Case: Referral search, professional network
- Features:
- Search providers
- Filter by specialty
- View profiles
- Connect/follow

Data Models

1. CarePDataModel.java
- Same as Android Client, with additional fields:

class CarePDataModel {
    // ... existing fields ...
    String providerType; // Psychiatrist, Psychologist, etc.
    List<String> certifications;
    List<String> publications;
    String clinicAddress;
    String clinicPhone;
    boolean acceptsInsurance;
    List<String> insuranceProviders;
    String availabilityStatus; // Available, Busy, Offline
}

2. RegisterModel.java

class RegisterModel {
    String userId;
    String registrationType; // Client, Provider
    String email;
    String phone;
    String fullName;
    String password;
    String verificationCode;
    boolean isVerified;
    Date registrationDate;
}

3. PushNotificationModel.java

class PushNotificationModel {
    String notificationId;
    String userId;
    String title;
    String message;
    String type; // Appointment, Message, Review, System
    String actionUrl;
    Map<String, String> data;
    Date timestamp;
    boolean isRead;
    String priority; // High, Normal, Low
}

4. ScheduleDataModel.java

class ScheduleDataModel {
    String scheduleId;
    String providerId;
    String dayOfWeek; // Monday, Tuesday, etc.
    String startTime;
    String endTime;
    boolean isRecurring;
    Date validFrom;
    Date validUntil;
    List<Date> exceptions; // Dates when not available
    double price;
    int sessionDuration;
    String sessionType;
}

5. LanguageDataModel.java

class LanguageDataModel {
    String languageCode; // en, ar, fr, etc.
    String languageName;
    boolean isRTL;
    String localizedName;
}

6. TZoneDataModel.java

class TZoneDataModel {
    String timeZoneId;
    String timeZoneName;
    String gmtOffset;
    boolean isDST;
}


🎥 Collaboration Package (/Collaboration)

Purpose: Real-time video/audio communication

Enhanced for Care Provider:

Presence (/Collaboration/Presence)

1. CollaborationMain.java
- Purpose: Main video call interface (legacy WebRTC)
- Features:
- Peer-to-peer connection
- Screen sharing
- Chat during call
- Recording
- Note: Being replaced by OneToOneCallActivity with VideoSDK

2. IncomingCall.java
- Purpose: Incoming call screen
- UI:
- Caller information
- Accept/Reject buttons
- Call type indicator
- Actions:
- Accept → Launch call activity
- Reject → Send rejection
- Ignore → Dismiss
- Features:
- Ringtone
- Vibration
- Full-screen overlay
- Wake device

3. FloatingViewService.java
- Purpose: Floating window for calls
- Use Cases:
- Minimize call to floating bubble
- Multitask during call
- Quick return to call
- Features:
- Draggable floating window
- Minimize to bubble
- Expand to full screen
- Close from anywhere
- Permissions: SYSTEM_ALERT_WINDOW

4. NaiveSSLContext.java
- Purpose: SSL configuration for WebSocket
- Note: Development only, accepts self-signed certificates

5. WebAPICall.java
- Purpose: API calls during collaboration
- Endpoints:
- /api/call/start
- /api/call/end
- /api/call/quality
- /api/recording/upload

6. StatusAdapter.java
- Purpose: Display user presence status
- Statuses:
- Online (green)
- Busy (red)
- Away (yellow)
- Offline (gray)

7. PresenceUserModel.java

class PresenceUserModel {
    String userId;
    String userName;
    String status;
    long lastSeen;
    String deviceType;
    boolean isInCall;
    String currentActivity;
}

Common (/Collaboration/Common)

MessagesListAdapter.java
- Purpose: Chat during video call
- Features:
- Text messages
- Timestamps
- Read receipts
- Typing indicator


📝 Registration Package (/Registration)

Purpose: Provider-specific onboarding

Activities

1. SplashActivity.java
- Purpose: App entry point
- Routing:
- First time → OnboardingActivity
- Not logged in → LoginActivity
- Logged in → MainActivityCareProvider

2. LoginActivity.java
- Purpose: Provider login
- Methods:
- Phone/Email + Password
- Google Sign-In
- Facebook Login (optional)
- Biometric (if set up)
- Features:
- Remember me
- Forgot password
- Auto-fill support
- Validation:
- Field validation
- Rate limiting
- Error messages

3. RegisterCareProviderActivity.java
- Purpose: Provider registration flow
- Steps:
1. Account type selection (Provider)
2. Phone/Email verification
3. Basic information
4. Professional information
5. Credentials upload
6. Specialization selection
7. Services and pricing
8. Availability setup
9. Approval pending
- Verification:
- License verification
- Credential review
- Background check (if required)
- Admin approval
- Status:
- Pending review
- Approved
- Rejected (with reason)
- Additional info needed

4. VerifyAccountActivity.java
- Purpose: OTP verification
- Methods:
- SMS OTP
- Email OTP
- Voice call (fallback)
- Features:
- Auto-read SMS
- Resend code
- Timer countdown
- Change number option

5. UserSelectionActivity.java
- Purpose: Select user type during registration
- Options:
- Client
- Care Provider
- Both (dual role)
- UI:
- Large option cards
- Descriptions
- Benefits list

6. QuestionaireActivity.java
- Purpose: Onboarding questionnaire for providers
- Questions:
- Years of experience
- Areas of expertise
- Client age groups
- Session types offered
- Languages spoken
- Availability preferences
- Insurance acceptance
- Practice setting


📅 Scheduling Package (/Scheduling)

Purpose: Advanced scheduling and availability management

Activities

Already covered in CareProvider/Schedule

Data Models (/Scheduling/DataModels)

1. SlotsDataModel.java

class SlotsDataModel {
    String slotId;
    String providerId;
    Date date;
    String startTime;
    String endTime;
    int durationMinutes;
    String status; // Available, Booked, Blocked, Reserved
    double price;
    String sessionType;
    String clientId; // If booked
    String bookingId; // If booked
}

2. SlotsTimeDataModel.java

class SlotsTimeDataModel {
    String timeSlot; // "09:00 AM"
    boolean isAvailable;
    boolean isSelected;
    String slotId;
}

3. ServicesDataModel.java

class ServicesDataModel {
    String serviceId;
    String serviceName;
    String description;
    int durationMinutes;
    double price;
    String sessionType;
    boolean isActive;
    String category;
}

4. MarkSlotsDataModel.java

class MarkSlotsDataModel {
    String markId;
    Date date;
    String startTime;
    String endTime;
    String reason; // Holiday, Personal, Conference, etc.
    String notes;
}

5. BookingsDataModel.java

class BookingsDataModel {
    String bookingId;
    String clientId;
    String providerId;
    String slotId;
    Date bookingDate;
    Date appointmentDate;
    String status;
    double amount;
    String paymentStatus;
    String sessionNotes;
    int rating;
    String review;
}

Adapters (/Scheduling/Adapters)

1. WeekSlotsGridAdapter.java
- Purpose: Display week view grid
- Cells: Each cell = time slot
- Color Coding:
- White: Available
- Gray: Not available
- Green: Booked
- Blue: Selected
- Red: Blocked

2. TimeSlotsListAdapter.java
- Purpose: List of time slots for a day
- View Holder: Time, status, quick action

3. NextAvailableSlotsListAdapter.java
- Purpose: Show next available slots
- Use Case: Quick booking suggestions

4. ServicesDropDownAdapter.java
- Purpose: Service selection dropdown
- Items: Service name, duration, price

5. MarkSlotEndTimeAdapter.java
- Purpose: End time selection for marking slots
- Items: Time options based on start time

Services (/Scheduling/Services)

GetSlotsService.java
- Purpose: Background service to fetch and update slots
- Type: IntentService
- Tasks:
- Sync slots from server
- Update local cache
- Notify of conflicts
- Handle booking updates


🛠️ Stats/Utilities Package (/Stats)

Purpose: Utility classes (same as Android Client with additions)

Additional Custom Views

CalendarPrescriptionView.java
- Purpose: Calendar view for prescription dates
- Features:
- Highlight prescription dates
- Show refill dates
- Mark expiration dates

CalendarAdapter.java
- Purpose: Generic calendar adapter
- Reusable: Multiple calendar views


👁️ Views Package (/views)

Additional Custom Dialogs

1. PrescriptionMedNameDialog.java
- Purpose: Medicine name selection dialog
- Features:
- Searchable medicine database
- Recent medicines
- Favorites
- Generic/Brand toggle
- Search:
- Auto-complete
- Fuzzy matching
- Category filter

2. PrescriptionMedFormDialog.java
- Purpose: Medicine form selection
- Options:
- Tablet
- Capsule
- Syrup
- Injection
- Cream/Ointment
- Inhaler
- Drops
- Patch

3. CustomDialogForTitle.java
- Purpose: Generic title input dialog
- Use Cases:
- Session note title
- Homework title
- Custom label

4. AddDiagnoseDialogFragment.java
- Purpose: Add diagnosis dialog
- Features:
- ICD-10 code search
- Diagnosis description
- Severity level
- Onset date
- Status (Active/Resolved)
- Database: ICD-10/DSM-5 codes

5. SampleCustomActivity.java
- Purpose: Sample/template custom activity
- Use: Developer reference for custom screens


🎨 Bottom Navigation Package (/bottomnavbar)

Purpose: Custom bottom navigation bar implementation

Components:
- Custom navigation bar view
- Badge support for notifications
- Animation effects
- Icon states (active/inactive)

Integration:
- MainActivityCareProvider
- Fragment switching
- Deep link handling


Purpose: Navigation graph and deep linking

Files:
- Navigation graphs (XML)
- Deep link definitions
- Fragment destinations


📋 Branch Events Package (/BranchEvents)

Purpose: Branch.io integration for deep linking and analytics

Features:
- Deep link handling
- Referral tracking
- Campaign tracking
- Attribution


⚙️ Workers Package (/workers)

Purpose: Background tasks (WorkManager)

Same as Android Client:
- AlarmWorkManager
- clsShow_Alarm
- Tags


📂 Resources (/app/src/main/res)

Additional Resources for Care Provider

Layouts:
- Provider-specific activity layouts
- Dashboard fragments
- Prescription forms
- Schedule views
- Call interface
- Revenue screens

Drawables:
- Provider-specific icons
- Status indicators
- Chart backgrounds
- Badge icons

Values:
- Additional strings for provider features
- Provider color scheme
- Additional dimensions


🎯 Product Flavors Structure

Client Flavor (/app/src/client)

Purpose: Testing/development build

Resources:
- App icon (client version)
- App name: “Psyter Client”
- Package: com.psyter.www

CareProvider Flavor (/app/src/careprovider)

Purpose: Production build for providers

Resources:
- App icon (provider version)
- App name: “Psyter for Providers”
- Package: com.psyter.www.careprovider
- Splash screen
- Branding colors


🔗 Key Workflows

1. Provider Onboarding Flow

SplashActivity
    ↓
OnboardingActivity
    ↓
UserSelectionActivity (select Provider)
    ↓
RegisterCareProviderActivity
    ↓ (steps)
Phone/Email → Verification → Basic Info → Professional Info → 
Credentials → Specialization → Services → Availability
    ↓
Backend API: /api/provider/register
    ↓
Approval Pending Screen
    ↓
Admin Review (backend)
    ↓
Approval Notification
    ↓
LoginActivity
    ↓
MainActivityCareProvider

2. Video Session Flow

MyFirebaseMessagingService (incoming call notification)
    ↓
IncomingCall activity
    ↓
Accept Call
    ↓
OneToOneCallActivity
    ↓
VideoSDK initialization
    ↓
Join meeting room
    ↓
Active session (video/audio/screenshare)
    ↓
Session controls (mute, camera, end)
    ↓
End Call
    ↓
Backend API: /api/session/complete
    ↓
Session feedback/notes prompt
    ↓
SessionNotesActivity

3. Appointment Management Flow

DashboardFragment (upcoming appointments)
    ↓
AppointmentsFragment
    ↓
Select appointment
    ↓
AppointmentDetailsActivity
    ↓
Start Session button
    ↓
OneToOneCallActivity OR In-person check-in
    ↓
During session:
- Video/Audio communication
- Screen sharing
- Chat
- Recording (if enabled)
    ↓
End Session
    ↓
SessionNotesActivity
    ↓
Add notes, diagnosis, prescription
    ↓
Optional: PrescriptionActivity
    ↓
Optional: HomeworkActivity
    ↓
Save and complete
    ↓
Backend API: Session completion
    ↓
Return to dashboard

4. Prescription Creation Flow

ClientProfileActivity OR AppointmentDetailsActivity
    ↓
Click "Write Prescription"
    ↓
AddPrescriptionActivity
    ↓
Add Medication button
    ↓
PrescriptionMedNameDialog (search medicine)
    ↓
PrescriptionMedFormDialog (select form)
    ↓
Enter dosage details
    ↓
Repeat for multiple medications
    ↓
Add diagnosis (optional)
    ↓
Add instructions
    ↓
Preview prescription
    ↓
Submit
    ↓
Backend API: /api/prescription/create
    ↓
PDF generation
    ↓
Send to client (notification)
    ↓
Optional: Email/Print

🆕 New Features vs Android Client

VideoSDK Integration

  • Modern video calling vs legacy WebRTC
  • Better quality and reliability
  • Picture-in-Picture support
  • Screen sharing built-in
  • Recording capabilities
  • Network quality monitoring

Provider Dashboard

  • Revenue tracking with charts
  • Client management system
  • Appointment analytics
  • Review management
  • Earnings reports

Clinical Tools

  • Prescription writing system
  • Session notes templates
  • Homework assignment tools
  • Diagnosis management (ICD-10)
  • Treatment plans

Schedule Management

  • Visual calendar editing
  • Availability templates
  • Recurring schedules
  • Block time slots
  • Buffer time configuration

Enhanced UI/UX

  • Lottie animations for smooth experience
  • Modern calendar component
  • YouTube integration for training videos
  • GIF support for richer content
  • Image cropper for profile photos

Professional Features

  • Referral system to other specialists
  • Client progress tracking
  • Homework feedback system
  • In-app reviews management
  • Professional networking

📊 Dependencies Comparison

Additional Dependencies (vs Android Client)

Video & Media:
- VideoSDK: live.videosdk:rtc-android-sdk:0.1.31
- YouTube Player: androidyoutubeplayer:core:12.1.0
- Lottie: lottie:5.2.0
- GIF Support: android-gif-drawable:1.2.22
- Audio Recording: AudioRecordView:1.0.5

UI Components:
- Calendar: awesome-calendar:2.0.0
- Image Cropper: android-image-cropper:4.3.3

Social & Services:
- Facebook SDK: facebook-android-sdk:latest.release

Google Play Services:
- In-App Review: review:2.0.1
- App Update: app-update:2.1.0
- Asset Delivery: asset-delivery:2.2.2

Utilities:
- Permissions: android-permissions:3.8
- Fragment: androidx.fragment:1.6.2

Updated Versions:
- Glide: 4.16.0 (vs 4.10.0)
- Firebase Messaging: 23.4.0 (vs 15.0.0)
- Firebase Auth: 22.3.1 (vs 22.1.1)


🔐 Security Enhancements

Additional Security for Providers

Professional Data Protection:
- Encrypted session notes
- HIPAA-compliant storage (if configured)
- Secure prescription transmission
- Access logging

Multi-factor Authentication:
- Optional MFA for providers
- Biometric authentication
- Security questions

Data Access Control:
- Role-based access
- Audit trails
- Session timeout
- Remote logout capability


📈 Performance Optimizations

Provider-Specific:
- Calendar view caching
- Client list pagination
- Revenue calculation caching
- Image optimization for prescriptions
- Background sync for schedules


🚀 Build Variants

Client Flavor Build

./gradlew assembleClientDebug
./gradlew assembleClientRelease

CareProvider Flavor Build

./gradlew assembleCareProviderDebug
./gradlew assembleCareProviderRelease

Install Specific Flavor

./gradlew installCareProviderDebug
./gradlew installCareProviderRelease

📱 App Distribution

Google Play Store

  • Client Flavor: Testing only
  • CareProvider Flavor: Production distribution
  • Package Names: Different to allow separate listings

Beta Testing

  • Internal testing track
  • Closed beta
  • Open beta

End of AndroidCareProvider Documentation


Completion Status:
- ✅ Android Client (COMPLETED)
- ✅ AndroidCareProvider (COMPLETED)
- ⏭️ APIs (NEXT)
- Pending: Media, NodeServer, Tahoon_API, Web, WindowsService, IOSCareProvider