An Android mobile application for bus ticket booking with Firebase backend, featuring OTP-based authentication, ticket purchasing, booking history, and cancellation management.
Overview โข Features โข Tech Stack โข Architecture โข Installation โข App Flow โข Structure
A full-featured Android mobile application for bus ticket reservation, built with Java and powered by Firebase backend services. The app provides a complete booking workflow - from user registration with phone OTP verification, to ticket purchasing, viewing booking history, and canceling reservations.
This project demonstrates practical mobile development skills including Firebase integration, multi-step authentication flows, real-time database operations, Material Design UI, and navigation architecture.
- Multi-step user registration (3-page signup flow)
- Phone number verification with OTP (PIN view input)
- International country code picker (CCP library)
- Secure login with Firebase Authentication
- Forgot password flow with multiple recovery options
- Set new password functionality
- Browse available bus routes and schedules
- Purchase tickets with seat selection
- View detailed ticket information
- Booking history tracking
- Ticket cancellation with confirmation
- Splash screen with app branding
- Onboarding / Getting started screens with image slider
- Material Design UI with CardView layouts
- Smooth navigation between screens
- Intuitive main home dashboard
| Category | Technology | Purpose |
|---|---|---|
| Language | Java | Core application logic |
| Platform | Android (API 21+) | Mobile platform |
| Build System | Gradle | Dependency management and build |
| Backend | Firebase | Cloud backend services |
| Auth | Firebase Authentication | Phone/OTP-based user authentication |
| Database | Firebase Realtime Database | User data and booking storage |
| Storage | Firebase Storage | File/image storage |
| Analytics | Firebase Analytics | Usage tracking and insights |
| UI - Material | Material Design Components | Modern Android UI components |
| UI - CardView | AndroidX CardView | Card-based layouts |
| UI - Navigation | AndroidX Navigation | Fragment-based navigation |
| UI - CCP | Country Code Picker (hbb20) | International phone number input |
| UI - PIN | PinView (chaos) | OTP input field |
| UI - Slider | Custom SliderAdapter | Onboarding image carousel |
| Lifecycle | AndroidX Lifecycle | Activity/fragment lifecycle management |
| Testing | JUnit + Espresso | Unit and UI testing |
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ ANDROID APP โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ โ
โ โโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโโโโ โ
โ โ Splash โโโ Getting โโโ Login / SignUp โ โ
โ โ Screen โ โ Started โ โ Module โ โ
โ โโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโ โโโโโโโโโโโโฌโโโโโโโโโโโ โ
โ โ โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโ โ
โ โ Main Home Dashboard โ โ
โ โโโโโโโโโโโโฌโโโโโโโโโโโโฌโโโโโโโโโโโโฌโโโโโโโโโโโโค โ
โ โ Purchase โ Ticket โ History โ Cancel โ โ
โ โ Activity โ Activity โ Activity โ Activity โ โ
โ โโโโโโโโโโโโดโโโโโโโโโโโโดโโโโโโโโโโโโดโโโโโโโโโโโโ โ
โ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ FIREBASE BACKEND โ
โ โโโโโโโโโโโโ โโโโโโโโโโโโโโโโโ โโโโโโโโโโโ โโโโโโโโโโโ โ
โ โ Auth โ โ Realtime โ โ Storage โ โAnalyticsโ โ
โ โ (OTP) โ โ Database โ โ โ โ โ โ
โ โโโโโโโโโโโโ โโโโโโโโโโโโโโโโโ โโโโโโโโโโโ โโโโโโโโโโโ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
- Android Studio (Arctic Fox or later recommended)
- JDK 8 or higher
- Android SDK (API 21+)
- Firebase project (for backend services)
# Clone the repository
git clone https://github.com/zishnusarker/Bus-Ticket-Reservation.git
cd Bus-Ticket-Reservation/Bus\ ticket\ reservation\ master- Open in Android Studio - File โ Open โ select the
Bus ticket reservation masterfolder - Sync Gradle - Android Studio will automatically sync dependencies
- Configure Firebase - The
google-services.jsonis included, but for your own deployment you should:- Create a new Firebase project at console.firebase.google.com
- Enable Authentication (Phone provider)
- Enable Realtime Database
- Download and replace
app/google-services.json
- Run the app - Connect an Android device or emulator (API 21+) and click Run
A pre-built debug APK is available for quick testing:
Bus ticket reservation master/app-debug.apk
Splash Screen โ Getting Started (Image Slider) โ Login/SignUp Selection
SignUp Page 1 (Basic Info) โ SignUp Page 2 (Details) โ SignUp Page 3 (Phone)
โ OTP Verification โ Registration Complete
Login โ Enter Credentials โ Firebase Auth โ Main Home
Forgot Password โ Select Recovery Method โ Verify Identity โ Set New Password
Main Home โ Purchase Activity โ Select Route/Details
โ Purchase Confirmation โ Ticket Generated
Main Home โ History (View past bookings)
Main Home โ Cancel Activity (Cancel a booking)
Main Home โ Information (View ticket details)
Bus-Ticket-Reservation/
โโโ README.md
โโโ LICENSE
โโโ .gitattributes
โ
โโโ Bus ticket reservation master/ # Android project root
โโโ build.gradle # Project-level Gradle config
โโโ settings.gradle # Gradle settings
โโโ gradle.properties # Gradle properties
โโโ gradlew / gradlew.bat # Gradle wrapper scripts
โโโ app-debug.apk # Pre-built debug APK
โ
โโโ gradle/wrapper/ # Gradle wrapper
โ
โโโ app/ # Application module
โโโ build.gradle # App-level dependencies
โโโ google-services.json # Firebase configuration
โ
โโโ src/main/
โโโ AndroidManifest.xml # App manifest
โโโ app_logo.png # App logo asset
โ
โโโ java/.../project1/ # Java source code
โ โโโ Common/LoginSignUp/ # Authentication module
โ โ โโโ LoginSignUp.java # Auth landing page
โ โ โโโ Login.java # Login screen
โ โ โโโ Registration.java # Registration handler
โ โ โโโ SignUp2ndPage.java # Signup step 2
โ โ โโโ SignUp3rdPage.java # Signup step 3
โ โ โโโ Verify_OTP.java # OTP verification
โ โ โโโ ForgetPassword.java # Forgot password
โ โ โโโ MakeSelectionForgetPass.java # Recovery options
โ โ โโโ SetNewPassword.java # New password
โ โ
โ โโโ Database/ # Data layer
โ โ โโโ userDatabaseHelperClass.java # Firebase DB helper
โ โ
โ โโโ HelperClasses/ # UI helpers
โ โ โโโ SliderAdapter.java # Onboarding slider
โ โ
โ โโโ commonForApp/ # Core app screens
โ โโโ Splash.java # Splash screen
โ โโโ Getting_started.java # Onboarding
โ โโโ Main_home.java # Home dashboard
โ โโโ PurchaseActivity.java # Buy tickets
โ โโโ PurchaseActivity_2nd.java # Confirm purchase
โ โโโ TicketActivity.java # View ticket
โ โโโ HistoryActivity.java # Booking history
โ โโโ CancelActivity.java # Cancel booking
โ โโโ InformationActivity.java # Ticket info
โ
โโโ res/ # Resources (layouts, drawables, etc.)
| Detail | Value |
|---|---|
| Min SDK | 21 (Android 5.0 Lollipop) |
| Target SDK | 28 (Android 9.0 Pie) |
| Compile SDK | 30 (Android 11) |
| Application ID | aidooo.spydo.com.project1 |
| Build Tools | 29.0.3 |
- Migrate to Kotlin from Java
- Update to latest AndroidX and Firebase SDK versions
- Implement MVVM architecture pattern
- Add real-time bus tracking with Google Maps API
- Implement online payment gateway (Razorpay/Stripe)
- Add push notifications for booking confirmations
- Implement seat selection UI with visual bus layout
- Add user profile management with photo upload
- Write comprehensive unit and UI tests
- Add dark mode support
The
google-services.jsonfile included in this repository is for development purposes. For production deployment, you should create your own Firebase project and replace the configuration file.
This project is licensed under the MIT License - see the LICENSE file for details.