Report
Report
Submitted By :-
MICRO-PROJECT INDEX
1
Sr. No. Content Page
No.
1. Rationale 3
4. Literature Review 4
6. Code 7 to 16
7. Output 17 to 19
6. Skills Developed. 20
9. Conclusion 21
10. References 21
2
RATIONALE
Moreover, the system can support railway authorities by reducing operational costs
related to ticket counters and improving customer service. With the integration of features like
secure online payments, real-time seat availability, and train tracking, the app contributes to
enhancing the overall travel experience for passengers.
3
AIM OF THE MICRO-PROJECT
LITERATURE REVIEW:
Mobile applications have become a dominant platform for various services, including
travel and ticketing systems. Railway reservation systems are an integral part of public transport,
and mobile apps provide a convenient way for passengers to access these services.
Ticket Booking and Cancellation: The core functionality of any reservation system is to allow
users to book or cancel tickets.
Train Schedule Management: Users should be able to view train schedules, availability, and
routes.
User Authentication: To ensure secure access, users need to register and log in.
Payment Gateway Integration: Secure and easy payment options should be provided for booking
tickets.
4
ACTUAL METHODOLOGY
Reservation System using Android Studio, with a focus on the front-end design
and core functionality through XML and Java. The application is kept simple, with no backend
database or real-time data integration. Instead, mock data is used for simulating functionalities like
train schedules, seat availability, and ticket booking.
The first step involved gathering requirements for a basic railway reservation system. Key
functionalities such as train schedule display, seat availability, and ticket booking were
identified as the main components.
Since the project does not use a back-end database, static mock data was designed to simulate
these functionalities for demonstration purposes.
2. System Design:
Interface Design: The app's user interface (UI) was designed using XML for layout. Focus
was placed on creating a clean and simple design that allows users to navigate the app easily.
The design included forms for booking tickets, viewing train schedules, and checking seat
availability.
Mock Data Implementation: Static data for trains, schedules, and seat availability was hard
coded into the app using Java. This allowed for a seamless simulation of the reservation
process without relying on a database.
3. Front-End Development:
XML for UI Design: The front-end was developed entirely using XML for the user interface.
Different screens were created for functionalities such as train search, ticket booking, and
confirmation pages. The layout was made responsive to ensure compatibility across various
screen sizes.
Java for Logic Implementation: Java was used to handle the app’s logic and functionality.
Simple conditional statements and data structures (e.g., arrays or lists) were used to simulate
the processing of user input, such as selecting a train and confirming a booking.
5
4. Implementation of Key Features:
Train Schedule Display: A static list of trains and schedules was created using Java and
displayed to the user through the app’s interface. Users could browse through the available
trains and select one for booking.
Ticket Booking: A basic form was implemented where users could input their details (e.g.,
name, age, and seat preference) to "book" a ticket. Once the form was submitted, a
confirmation page displayed a mock ticket with the details provided by the user.
Seat Availability: Seat availability was simulated using pre-defined static data, and users
could select available seats for their chosen train.
After the initial implementation, the app was tested on various Android devices to ensure that
it worked smoothly and displayed the correct information. Testing focused on ensuring that
the user interface elements (buttons, input fields, etc.) were responsive and functional.
Debugging involved fixing any minor errors in the Java code and ensuring that all screens
were linked properly, allowing users to navigate through the app without issues.
The app was designed with user experience in mind, ensuring that navigation between
different sections (e.g., train search, booking, confirmation) was smooth and intuitive.
Feedback mechanisms were implemented, such as confirmation dialogs after booking and
clear error messages for invalid inputs, enhancing the overall user experience.
Since no backend was involved, the functionality of the app was validated using static data
for booking and schedule information. The application was simulated as if it were
interacting with real-time data, but all information was hard coded for demonstration
purposes.
8. Final Deployment:
The final version of the app was tested for smooth performance and basic functionality. The
app was packaged and prepared for deployment as a demonstration or educational tool,
showing how a railway reservation system could function in a real-world scenario using just
front-end technologies.
6
CODE
activity_main.xml
7
android:inputType="number"
android:padding="12dp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@+id/tvTrainNumber"
android:layout_marginStart="32dp"
android:layout_marginEnd="32dp" />
<EditText
android:id="@+id/etPassengerName"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:hint="Enter Passenger Name"
android:padding="12dp"
android:textColor="#004D40"
android:textColorHint="#00796B"
android:backgroundTint="#004D40"
android:inputType="textPersonName"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@+id/tvPassengerName"
android:layout_marginStart="32dp"
android:layout_marginEnd="32dp" />
8
android:id="@+id/etTickets"
android:layout_width="0dp"
android:layout_height="wrap_content"
<Button
android:id="@+id/btnJourneyDate"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text="Select Date"
android:textStyle="bold"
android:backgroundTint="#004D40"
android:textColor="#FFFFFF"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@+id/tvJourneyDate"
android:layout_marginStart="32dp"
android:layout_marginEnd="32dp" />
9
app:layout_constraintTop_toBottomOf="@+id/btnJourneyDate"
app:layout_constraintStart_toStartOf="parent"
android:layout_marginTop="16dp"
android:layout_marginStart="32dp" />
<Button
android:id="@+id/btnJourneyTime"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text="Select Time"
android:backgroundTint="#004D40"
android:textColor="#FFFFFF"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@+id/tvJourneyTime"
android:layout_marginStart="32dp"
android:layout_marginEnd="32dp" />
<EditText
android:id="@+id/etTickets2"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="32dp"
android:layout_marginTop="100dp"
android:layout_marginEnd="32dp"
10
android:backgroundTint="#004D40"
android:hint="Enter station to destination place"
android:inputType="text"
android:padding="12dp"
android:textColor="#004D40"
android:textColorHint="#00796B"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/tvTickets" />
</androidx.constraintlayout.widget.ConstraintLayout>
activity_second.xml
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#E0F7FA"
tools:context=".SecondActivity">
<!-- Title -->
<TextView
android:id="@+id/tvTitleSecond"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Passenger Details"
android:textSize="24sp"
android:textStyle="bold"
android:textColor="#004D40"
android:layout_marginTop="32dp"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent" />
<!-- Age Input -->
<TextView
android:id="@+id/tvAge"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Passenger Age"
android:textColor="#004D40"
android:textSize="16sp"
app:layout_constraintTop_toBottomOf="@+id/tvTitleSecond"
app:layout_constraintStart_toStartOf="parent"
android:layout_marginTop="16dp"
android:layout_marginStart="32dp" />
<EditText
11
android:id="@+id/etAge"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:hint="Enter Passenger Age"
android:textColor="#004D40"
android:textColorHint="#00796B"
android:backgroundTint="#004D40"
android:inputType="number"
android:padding="12dp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@+id/tvAge"
android:layout_marginStart="32dp"
android:layout_marginEnd="32dp" />
<RadioGroup
android:id="@+id/rgGender"
android:layout_width="334dp"
android:layout_height="146dp"
android:layout_marginStart="32dp"
android:layout_marginEnd="32dp"
android:orientation="vertical"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/tvGender">
<RadioButton
android:id="@+id/rbMale"
android:layout_width="87dp"
android:layout_height="wrap_content"
android:text="Male"
android:textColor="#004D40" />
<RadioButton
android:id="@+id/rbFemale"
android:layout_width="89dp"
android:layout_height="wrap_content"
android:text="Female"
android:textColor="#004D40" />
12
<RadioButton
android:id="@+id/rbOther"
android:layout_width="87dp"
android:layout_height="wrap_content"
android:text="Other"
android:textColor="#004D40" />
</RadioGroup>
<TextView
android:id="@+id/tvSeatType"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="32dp"
android:layout_marginTop="20dp"
android:text="Seat Type"
android:textColor="#004D40"
android:textSize="16sp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/rgGender" />
<Spinner
android:id="@+id/spSeatType"
android:layout_width="342dp"
android:layout_height="52dp"
android:layout_marginStart="32dp"
android:layout_marginTop="12dp"
android:layout_marginEnd="32dp"
android:backgroundTint="#004D40"
android:entries="@array/seat_types"
android:background="@color/black"
android:textColor="#004D40"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/tvSeatType" />
<Button
android:id="@+id/btnNextSecond"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="32dp"
android:layout_marginTop="36dp"
android:layout_marginEnd="32dp"
android:backgroundTint="#004D40"
android:text="Submit"
android:textColor="#FFFFFF"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.0"
13
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/spSeatType" />
</androidx.constraintlayout.widget.ConstraintLayout>
MainActivity.java
package com.example.project;
import androidx.appcompat.app.AppCompatActivity;
import android.os.Bundle;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Toast;
import android.content.Intent;
import android.app.DatePickerDialog;
import android.app.TimePickerDialog;
import java.util.Calendar;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
etTrainNumber = findViewById(R.id.etTrainNumber);
etPassengerName = findViewById(R.id.etPassengerName);
etTickets = findViewById(R.id.etTickets);
btnJourneyDate = findViewById(R.id.btnJourneyDate);
btnJourneyTime = findViewById(R.id.btnJourneyTime);
btnNext = findViewById(R.id.btnNext);
btnJourneyDate.setOnClickListener(v -> showDatePickerDialog());
btnJourneyTime.setOnClickListener(v -> showTimePickerDialog());
btnNext.setOnClickListener(v -> {
SecondActivity.java
package com.example.project;
import androidx.appcompat.app.AppCompatActivity;
import android.os.Bundle;
import android.widget.Button;
import android.widget.EditText;
import android.widget.RadioGroup;
import android.widget.Spinner;
import android.widget.Toast;
import com.example.project.R;
public class SecondActivity extends AppCompatActivity {
15
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_second);
etAge = findViewById(R.id.etAge);
rgGender = findViewById(R.id.rgGender);
spSeatType = findViewById(R.id.spSeatType);
btnNextSecond = findViewById(R.id.btnNextSecond);
btnNextSecond.setOnClickListener(v -> {
String age = etAge.getText().toString();
int selectedGenderId = rgGender.getCheckedRadioButtonId();
String seatType = spSeatType.getSelectedItem().toString();
Strings.xml
<resources>
<string name="app_name">Railway Reservation</string>
<string-array name="seat_types">
<item>First Class</item>
<item>Second Class</item>
<item>Sleeper Class</item>
<item>AC Chair Car</item>
</string-array>
</resources>
16
Output
17
18
19
SKILL DEVELOPED/LEARNING OUT OF THIS MICRO
PROJECT:
By this project we understand how to use Develop Android application using Android Studio
· Proficiency in Android Studio: Building an Android app from scratch using Java.
· Database Management: Learning how to integrate a cloud-based database to store and retrieve
data.
· Problem-solving Skills: Debugging and troubleshooting issues that arose during development.
· Understanding of User Interfaces: Creating an intuitive and user-friendly interface for easy
interaction.
RESOURCES REQUIRED:
2. Software Windows 11 1
· Railway Ticket Booking System: Passengers can book and cancel tickets easily.
· Real-time Train Tracking: Users can track the train’s current status and delays.
· Seat Availability Check: Users can view available seats and book them accordingly.
· Travel Information System: Providing details on train schedules, fares, and routes.
20
CONCLUSION:
REFERENCES:
https://www.geeksforgeeks.org/online-railway-ticket-reservation-system/
https://www.slideshare.net/slideshow/railway-reservation-system-249646777/249646777
https://www.kashipara.com/project/java/3216/railway-reservation-system
21