How hodnduy/se104 works
This repository contains a two-part flight ticket booking system:
1. An Android client application written in Java.
2. A PHP + MySQL backend API that serves the app’s data.
The architecture is a classic mobile client/server setup where the Android app handles UI, session state, and user interaction, while the PHP scripts expose HTTP endpoints backed by a database.
Main system boundaries
• Android app boundary
- Located under app/
- Responsible for screens, navigation, input validation, list rendering, local session/storage, and calling the backend API
• Backend API boundary
- Located under flight_ticket_boooking_api/
- PHP endpoints handle login, signup, search, booking, passenger management, and content retrieval
• Database boundary
- Backed by the SQL schema in flight_ticket_boooking_api.sql
- The API reads/writes booking, user, passenger, city, banner, and related records
• Static media boundary on backend
- flight_ticket_boooking_api/images/user and images/banners suggest uploaded or hosted image assets used by the app
Android app structure
The Android app is organized by responsibility rather than by feature module:
• Entry/navigation screens
- Splash likely shows startup animation/loading and decides where to route next
- Welcome is an onboarding/landing screen
- MainActivity is the main container after login or app launch, likely hosting the home screen and navigation drawer
• Authentication and account management
- Login
- Register
- Profile
- MyBookingDetail
• Booking workflow
- SearchVehical is the search/results entry point for available travel options
- VehicleDetail shows details for a selected vehicle/flight option
- BookTicket completes booking and passenger entry
- BookingHistory displays prior bookings
• Informational/support screens
- AboutUs
- ContactUs
The UI is built from XML layouts in res/layout, with a separate screen layout for each major activity. The presence of activity_main.xml, app_bar_home.xml, content_home.xml, and nav_header_home.xml suggests the main screen uses a navigation drawer or drawer-style home shell.
Presentation and list rendering layer
The adapters/ package contains the UI binding layer between model objects and list-based views:
• CityAdapter renders city choices
• VehicleAdapter renders available vehicles/flights
• PassengerAdapter renders passenger rows
• BookingAdapter renders booking history entries
These adapters imply the app uses RecyclerView/ListView-style list screens for search results, booking history, and passenger lists.
Data model layer
The models/ package defines the app’s domain objects:
• User for account/session profile data
• Vehical for travel inventory items
• City for origin/destination data
• Banner for promotional/homepage content
• MyBooking for booking records
• PassengerModel for traveler/passenger entries
• Developer for app/about metadata
These models are the main data contract between the API responses and the UI adapters.
Utility and infrastructure layer
The utilities/ package provides cross-cutting support:
• MyNetwork is the likely HTTP/network helper used to call PHP endpoints
• ECONSTANT centralizes API URLs, keys, request codes, or other constants
• EFastSaveInit indicates local key-value persistence setup, probably for login/session state
• EHelpingFunctions likely contains shared helpers such as formatting, validation, or UI utilities
This suggests the app uses a lightweight client-side infrastructure rather than a heavy service/repository architecture. Activities likely coordinate most of the logic directly, using utilities for network and persistence.
Resource-driven UI and feedback
The res/ tree shows the app depends heavily on Android resources:
• Layouts define every screen and row item
• Drawables define custom shapes, icons, backgrounds, and UI decorations
• Animations such as bounce.xml, go_up.xml, go_down.xml
• Raw JSON files such as loading.json, welcome.json, empty.json, order_empty.json
- These strongly suggest Lottie-style animated empty/loading states or onboarding visuals
• Menus and themed values support a branded, custom-styled application
Backend API structure
The PHP backend is a set of endpoint scripts rather than a framework-based application:
• Authentication/account endpoints
- login.php
- signup.php
- changepass.php
• Booking/search endpoints
- searchvehicle.php
- bookticket.php
- getbookingid.php
- getmybooking.php
• Content/data endpoints
- getcity.php
- getbanner.php
- getpassengers.php
• Submission endpoints
- addpas.php
- addcontactus.php
- adddonation.php
db.php and db1.php are the database connection/configuration files. The presence of separate scripts for each operation suggests the backend is a simple request/response API, likely returning JSON to the Android client.
Data flow through the system
A typical user flow is:
1. App launch
- Splash/Welcome screens display branding and loading assets
2. Authentication
- Login or Register sends credentials to login.php or signup.php
- Session state is probably stored locally using the FastSave-based utility layer
3. Home screen
- MainActivity loads the main UI and possibly banners/city data from getbanner.php and getcity.php
4. Search and selection
- SearchVehical calls searchvehicle.php with route/date criteria
- Results are parsed into Vehical models and rendered through VehicleAdapter
5. Detail and booking
- VehicleDetail presents a selected option
- BookTicket collects passenger/booking details and posts them to bookticket.php and/or addpas.php
6. Booking tracking
- BookingHistory calls getmybooking.php
- MyBookingDetail shows the selected booking record
7. Support/profile
- Profile, AboutUs, and ContactUs expose user/account and informational flows
- addcontactus.php stores user inquiries
Important architectural characteristics
• Client-server separation is explicit
- Android does UI and orchestration
- PHP scripts handle all persistent operations
• Data exchange is likely JSON over HTTP
- The model classes and endpoint naming strongly indicate this pattern
• The app is screen-centric
- Each major function is a separate Activity
• Presentation and data are loosely separated
- Adapters bind model objects to views
• State is partly local
- FastSave initialization indicates local persistence for login/session/preferences
• Backend is script-based, not layered
- The server side appears to be a collection of endpoint files with shared DB configuration rather than a multi-tier framework
Relevant technologies
• Android Studio / Android SDK
• Java for the mobile client
• XML for layouts, drawables, animations, and themes
• PHP for the backend API
• MySQL for persistent data storage
• Gradle for Android build configuration
• Likely JSON responses between API and client
For an architecture diagram, the clearest grouping is:
• Android Presentation Layer
- Activities, adapters, layouts, resources
• Android Support Layer
- utilities, local persistence, networking
• API Layer
- PHP endpoint scripts
• Data Layer
- MySQL database plus hosted images/banners/users media
This repository is therefore best understood as a mobile booking front end integrated with a simple PHP-based data service and relational database backend.
Main entry points: MainActivity.java Main Activity · models App Models · utilities App Utilities · layout Layouts
Components 26
Android app
Java mobile client with screens, adapters, models, and support utilities.
- Splash · Startup loading and routing screen
app/src/main/java/com/maadi/flightticketbooking/activities/Splash.java - Welcome · Landing and onboarding screen
app/src/main/java/com/maadi/flightticketbooking/Welcome.java - Main Activity · Home shell and navigation container
app/src/main/java/com/maadi/flightticketbooking/MainActivity.java - Login · User authentication screen
app/src/main/java/com/maadi/flightticketbooking/activities/Login.java - Register · Account creation screen
app/src/main/java/com/maadi/flightticketbooking/activities/Register.java - Search Vehicle · Search and results entry point
app/src/main/java/com/maadi/flightticketbooking/activities/SearchVehical.java - Vehicle Detail · Selected route or flight details
app/src/main/java/com/maadi/flightticketbooking/activities/VehicleDetail.java - Book Ticket · Booking and passenger entry flow
app/src/main/java/com/maadi/flightticketbooking/activities/BookTicket.java - Booking History · Past bookings list screen
app/src/main/java/com/maadi/flightticketbooking/activities/BookingHistory.java - Booking Detail · Single booking detail view
app/src/main/java/com/maadi/flightticketbooking/activities/MyBookingDetail.java - Profile · User account and profile screen
app/src/main/java/com/maadi/flightticketbooking/activities/Profile.java - About Us · App information screen
app/src/main/java/com/maadi/flightticketbooking/activities/AboutUs.java - Contact Us · Support and inquiry screen
app/src/main/java/com/maadi/flightticketbooking/activities/ContactUs.java - Vehicle Adapter · Binds vehicle search results to list rows
app/src/main/java/com/maadi/flightticketbooking/adapters/VehicleAdapter.java - Booking Adapter · Binds booking history records to list rows
app/src/main/java/com/maadi/flightticketbooking/adapters/BookingAdapter.java - Passenger Adapter · Binds passenger rows in booking flow
app/src/main/java/com/maadi/flightticketbooking/adapters/PassengerAdapter.java - App Models · User, city, vehicle, banner, booking, passenger, and developer objects
app/src/main/java/com/maadi/flightticketbooking/models - App Utilities · Networking, constants, persistence, and helper functions
app/src/main/java/com/maadi/flightticketbooking/utilities - Layouts · Screen and row XML layouts for the UI
app/src/main/res/layout - UI Assets · Drawables, animations, raw Lottie assets, menus, and themes
app/src/main/res
Backend API
PHP endpoint layer serving booking and account operations.
- Auth APIs · Login, signup, and password change scripts
flight_ticket_boooking_api - Booking APIs · Search, booking, booking ID, and passenger retrieval scripts
flight_ticket_boooking_api - Content APIs · City, banner, and contact submission scripts
flight_ticket_boooking_api - DB Config · Shared database connection scripts
flight_ticket_boooking_api/db.php
Data layer
Persistent storage and hosted media used by the API.
- MySQL DB · Persistent booking, user, passenger, city, and banner data
flight_ticket_boooking_api.sql - Media Store · User and banner image assets served by the backend
flight_ticket_boooking_api/images
Connections 32
- Splash → Welcome: routes to · Startup flow continues to landing screen
- Welcome → Login: entry to auth · User can proceed into authentication
- Login → Main Activity: opens app · Successful login reaches the main shell
- Register → Login: returns · After signup the user can sign in
- Main Activity → Search Vehicle: launches · Home shell starts booking search
- Main Activity → Booking History: shows · Home shell accesses past bookings
- Main Activity → Profile: opens · Home shell exposes account screen
- Main Activity → About Us: opens · Home shell exposes about screen
- Main Activity → Contact Us: opens · Home shell exposes support screen
- Search Vehicle → Vehicle Detail: selects · Chosen result opens detail view
- Vehicle Detail → Book Ticket: continues to · Detail view leads into booking
- Book Ticket → Booking Detail: creates · Completed booking leads to confirmation/detail
- Booking History → Booking Detail: drills into · History entries open booking detail
- Search Vehicle → Vehicle Adapter: renders via · Search results are bound into rows
- Booking History → Booking Adapter: renders via · Booking history uses a list adapter
- Book Ticket → Passenger Adapter: renders via · Passenger entry list is adapter-driven
- App Utilities → Auth APIs: calls · HTTP client invokes authentication APIs
- App Utilities → Booking APIs: calls · HTTP client invokes booking APIs
- App Utilities → Content APIs: calls · HTTP client invokes content and support APIs
- Auth APIs → DB Config: uses · Endpoints share database connection setup
- Booking APIs → DB Config: uses · Endpoints share database connection setup
- Content APIs → DB Config: uses · Endpoints share database connection setup
- DB Config → MySQL DB: connects to · Backend reads and writes relational data
- Content APIs → Media Store: serves · Banners and user images are exposed to the app
- App Models → Vehicle Adapter: feeds · Vehicle model data binds to result rows
- App Models → Booking Adapter: feeds · Booking model data binds to history rows
- App Models → Passenger Adapter: feeds · Passenger model data binds to passenger rows
- App Models → App Utilities: populates · Network responses are parsed into app models
- Layouts → Main Activity: backs · XML layouts define the app shell and screens
- Layouts → Search Vehicle: backs · XML layouts define the search screen
- Layouts → Book Ticket: backs · XML layouts define the booking screen
- UI Assets → Layouts: styles · Resources provide visuals, animations, and themes for layouts