Skip to content

bentake/PocketCaddy

Repository files navigation

PocketCaddy

PocketCaddy is an Android application that helps golfers track personal details, swing context, and club distances, then provides personalized club recommendations. It also features a chat assistant ("Caddy.AI") for an interactive experience. The project follows a clean MVVM structure with Fragments and AndroidX Navigation.


📱 Screens & UX

  • FirstFragment
    Landing screen with the PocketCaddy title/logo and two options:
    Get Club Recommendation → navigates to SecondFragment
    Ask Caddy.AI → navigates to FifthFragment

  • SecondFragment
    Collects user profile information (gender, experience, first/last name, and age).

  • ThirdFragment
    Captures situational context such as shot distance, dominant hand, and weather. Leads into recommendation generation.

  • FourthFragment
    Displays the recommended club with an image (e.g. iron9) and provides a NEW SWING option.

  • FifthFragment
    A chat interface powered by RecyclerView and a custom MessageAdapter. Users can enter messages, send them, and receive assistant responses.


🔀 Navigation Flow

Defined in nav_graph.xml:

  • First → Second → Third → Fourth (linear flow with back navigation).
  • First → Fifth (chat mode).
  • Fourth → Third (retry a swing).
  • Fifth → First (return to home).

🏗️ Architecture

  • MainActivity – Hosts the NavHostFragment and a MaterialToolbar.
  • Fragments – Modular UI for each step of the flow.
  • ViewModelGolferViewModel maintains golfer state across fragments.
  • AdaptersMessageAdapter binds chat messages in the fifth screen.
  • Models
    Person: encapsulates name and age
    TypeOfGolfer: experience/skill level enum
    Gender, DominantHand: enums for identity & handedness
    Distances: holds yardages per club, adjusted by gender/skill
    Golfer: aggregates all the above into a golfer profile

🖼️ UI & Theming

  • Layouts: activity_main.xml, fragment_first.xml, fragment_second.xml, fragment_third.xml, fragment_fourth.xml, fragment_fifth.xml
  • Navigation: nav_graph.xml defines fragment actions
  • Themes: Currently named Theme.PhoneCaddy in themes.xml. Should be renamed to Theme.PocketCaddy for consistency.
  • Drawables: Club images (e.g. driver, wood, hybrids, irons) must be provided.

⚙️ Build Requirements

  • Android Studio (latest stable recommended)
  • JDK 8+
  • Gradle (auto-managed by Android Studio)
  • Android SDK: Target API 31+
  • gradle.properties: Configured for AndroidX and non-transitive R class

📦 Dependencies

Add (or verify) in app/build.gradle:

dependencies {
    // AndroidX
    implementation "androidx.appcompat:appcompat:1.7.0"
    implementation "com.google.android.material:material:1.12.0"
    implementation "androidx.constraintlayout:constraintlayout:2.1.4"

    // Navigation
    def nav_version = "2.7.7"
    implementation "androidx.navigation:navigation-fragment:$nav_version"
    implementation "androidx.navigation:navigation-ui:$nav_version"

    // Lifecycle / ViewModel
    implementation "androidx.lifecycle:lifecycle-viewmodel:2.8.4"

    // RecyclerView
    implementation "androidx.recyclerview:recyclerview:1.3.2"

    // Volley (networking for chat)
    implementation "com.android.volley:volley:1.2.1"
}

▶️ Running the App

  1. Clone or download the repository.
  2. Open in Android Studio.
  3. Sync Gradle and install dependencies.
  4. Run on an emulator or device with Android 8.0 (API 26) or higher.

Demo (Video) of the app: https://drive.google.com/file/d/1LYrTDTuobqfuFFQLgFOIlGzXsjj0XwgB/view?resourcekey

OpenAI API Key has been disabled due to security concerns, interested parties should use their own secret key to authenticate the API calls.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages