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.
-
FirstFragment
Landing screen with the PocketCaddy title/logo and two options:
• Get Club Recommendation → navigates toSecondFragment
• Ask Caddy.AI → navigates toFifthFragment -
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 byRecyclerViewand a customMessageAdapter. Users can enter messages, send them, and receive assistant responses.
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).
- MainActivity – Hosts the
NavHostFragmentand aMaterialToolbar. - Fragments – Modular UI for each step of the flow.
- ViewModel –
GolferViewModelmaintains golfer state across fragments. - Adapters –
MessageAdapterbinds 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
- Layouts:
activity_main.xml,fragment_first.xml,fragment_second.xml,fragment_third.xml,fragment_fourth.xml,fragment_fifth.xml - Navigation:
nav_graph.xmldefines fragment actions - Themes: Currently named
Theme.PhoneCaddyinthemes.xml. Should be renamed toTheme.PocketCaddyfor consistency. - Drawables: Club images (e.g. driver, wood, hybrids, irons) must be provided.
- 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
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"
}- Clone or download the repository.
- Open in Android Studio.
- Sync Gradle and install dependencies.
- 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.