A simple Android Train schedule app

Agboola Mubarak
3 min readDec 13, 2021

So, I decided to incorporate my recent knowledge of android development to create a train schedule app.

the processes involved were Design, Development, Testing, and Implementation.

About project

Chinese T169(https://www.chinatrainguide.com/train/t169) is one of the fastest trains today. People travel on it to save their valuable time.

I wanted to develop an Android App for the train schedule of T169. The user needs to be able to select the station of departure and destination and get the train schedule along with the fare.

Design

I created the design using Figma, it was a 3-page interface that includes the home page, book a seat page, and schedule page. the home page included the logo which was edited by my bestie(bimpe), I used the word “edited” because it wasn’t a custom-made logo, just edited to suit my preference for the app. The home page also had two buttons which users have an option to either “book a seat” or “check the train timetable.” The book a seat page included the logo, text fields for the name of the user, name of the pickup station, and name of the destination, There were also two buttons for submitting and resetting the text fields. The “check schedule” page contained a table for the train’s timetable which had the following columns

STATION NAME, ARRIVAL TIME, DEPARTURE TIME, DURATION, FARE

Interface Development

The home page had a ConstraintLayout which is a ViewGroup that allows you to position and size widgets in a flexible way. The ConstraintLayout housed 1 ImageView (logo), 1 TextView(Brand name), and Two Buttons(book a seat and check schedule). The “book a seat page” also contained a constraint layout that housed 1 ImageView(logo), 3 TextView(Labels for the text fields), 3 TextFields( for name, pickup, and destination station), and 2 Buttons (submit and reset). Lastly, the “Check Schedule” page included a Constraint Layout which housed 1 ImageView(logo) and ScrollView layout which is a view group that allows the view hierarchy placed within it to be scrolled. the ScrollView layout contained the table for the train’s timetable, it provides responsiveness to the table.

Home page view on the emulator
Check Schedule page view on the emulator
Book a seat page view on the emulator

EventListeners

An event listener is an interface in the View class that contains a single callback method. These methods will be called by the Android framework when the View to which the listener has been registered is triggered by user interaction with the item in the UI. The Button on the Home page had event listeners each, The First one redirects the user to the “Book a seat” page while the second one redirects the user to the “Check schedule” page. The “Book a seat” also had 2 event listeners, the first one was for the submit button which had a toast that is used in android development to display information for a short period of time. A toast contains a message to be displayed quickly and disappears after some time. the submit button toast prints “ Hi Name of User, your seat has been booked successfully”. the other event listener was for the reset button which resets the text fields to default.

Conclusion

Keep in mind that it’s just a simple android application, Hence why I didn’t add a database to it, it’s also my first android project so I’m accepting suggestions and questions. the link to the project is below;

credits to Adeyinminu bimpe and Adebowale Adeyemo for their help with the development.

--

--