How hichamaf/ticketmaster-rest-api works
Project type and purpose
• This is a native Android mobile application (Kotlin) that interacts with the Ticketmaster Web API.
• Purpose: Search and display event, attraction, and venue data by making HTTP requests, parsing JSON responses with Gson, and rendering them in RecyclerViews across multiple Fragments.
File structure
• Top-level “app” module contains everything Android-related (Gradle config, Manifest, resources, source code).
• app/src/main/java/fi/centria/ticketmaster holds:
• MainActivity.kt – the host Activity
• Fragments (FirstFragment, EventFragment, MusicFragment, etc.) – each displays filtered event lists or details
• Adapters (AllEventAdapter, EventAdapter, AttractionAdapter) – bind data to RecyclerView rows
• EventDataModel.kt – Kotlin data classes matching JSON schema
• EventDetailsFragment.kt – shows detail view of a single event
• No local database or caching layer present; all data comes directly from the remote API.
• Configuration: build.gradle for dependencies (e.g., Gson), AndroidManifest.xml registers activities/fragments.
Extract insights from the README
• REST client calls “https://app.ticketmaster.com/discovery/v2/…” with an API key.
• JSON → Kotlin object mapping via Gson.
• UI consists of multiple list and detail screens (screenshots in the README).
Main components
a. Mobile App (Android APK)
• Presentation Layer: MainActivity + Navigation Host + Fragments + RecyclerViews
• Adapter Layer: Adapters format EventDataModel into view items
• Data Layer:
– Network Client (e.g., Retrofit or HttpUrlConnection with Gson)
– EventDataModel (Kotlin data classes)
b. External Service
• Ticketmaster REST API (Discovery v2)
c. (Optional) Future Extension
• Local Cache (Room or SharedPreferences)
• Authentication Manager (API key handling)
Relationships & interactions
• User taps UI → Fragment triggers ViewModel/Controller to make network call
• Network Client issues HTTP GET to Ticketmaster endpoint (including API key)
• Ticketmaster sends back JSON → parsed by Gson into EventDataModel
• Adapter receives model list → binds data to RecyclerView rows
• On item click → EventDetailsFragment fetches/passes selected model → displays detail screen
Architectural patterns & design principles
• MVVM or MVP flavor (UI layer separated from networking & data modeling)
• Single-activity with multiple fragments navigation
• Separation of concerns: Adapters handle view binding, Fragments handle presentation logic, Data Model handles schema
Detail without overcomplication
• Every Fragment, Adapter, and data-model relationship if clarity is needed.
• Always show how the API key is injected into the request (e.g., annotate the HTTP client block).