Implementation of Firebase Realtime Database to track BRT Trans Semarang

Many application developed to help people get information about BRT (Bus Rapid Transit) Trans Semarang. However, the existing application felt less effective and unable to provide what user need. So we proposed a prototype of android based application which able to provide information about BRT Trans Semarang in an effective ways. The developed system contains two application, that is driver side application and user side application. The reason for using Firebase Realtime Database is because of every data changes in database it will synchronize to the user automatically without waiting user to refresh or reload the application. The method is well designed and implemented and succeed to provides what user need which proved by a user acceptance test..


INTRODUCTION
Public transportation plays an important role in people's mobility.They use public transportation to go to work, go to school, etc.However, the traffic jam can make the trip to be delayed because there is no special lanes for BRT so the traffic jam can impacted on BRT Trans Semarang as well.That makes the bus arrival time become unpredictable and make the passenger must wait for an unpredictable time too.Moreover, the existing tracking system feel unable to provide an effective information to the passenger that is because the existing applications have some advantages and disadvantages each other.
Many tracking system were proposed to track vehicle, especially for public transportation.Apriyani et al proposed a tracking system to track ship location.Using a mobile based application as a client on the ship and a web based application as a server on the port, the proposed system is well implemented and help the port officer to track ship current location [1].Kumhar et al. proposed a tracking system to track public bus on India.The bus is tracked using GPS and then the data sent to server via GPRS network and shown to the passenger on a web based application in a real time [2].Jemilda et al proposed a mobile based application to track the collage bus location.The proposed model use mobile based application both on driver side and on user side.This application provides user current bus location and the information about bus arrival time [3].Wu et al proposed a bus tracking system for CTfastrak bus.The bus side application tracks bus current location via GPS and periodically send update the bus current location via internet.Using mobile based application, the passenger can track a bus and make a trip planner using CTfastrak [4].H. A. R. Mohamed design train tracking system using Radio Frequency System.Using an AVL device that utilize GPS and GPRS modem on the train side and a web based application on the station, the proposed model introduce a communication and tracking train system with low cost both in infrastructure and in maintenance [5].
Method used is developing a prototype of android based application which able to provide information in an affective way to track BRT Trans Semarang using Firebase Realtime Database.Firebase is a realtime database which developed by Google.The main feature of firebase is able to synchronize the data automatically without make an update request or refresh application.This will help the passanger to track Trans Semarang in a realtime.To reach a user service, our proposed application also provide some feature such as get bus arrival time to a particular shelter, get bus list that have heading to particular shelter, show all bus and shelter markers in just one maps layout and split the markers into different color for each corridor.

METHODS
System used contain two application, driver side application and user side application.All application is android based application.Java is used as a programming language along with Android Studio as IDE to help build the application.Firebase Realtime Database is used as database to store the bus and shelter data.Android Firebase API needed to get the access to database.This is the most important part to connect our application to the Firebase Real time Database because Android Firebase API is the only way to get the access to database.To store and retrieve data we need a java object.Java object is used because Firebase Real time Database use NO-SQL database which means the data is not saved in a SQL table format but a path tree format.
The driver side application track bus location via GPS.The location information is a geographic coordinates in a latitude and longitude form which is obtained from GPS receiver that built' in on every smartphone.The driver side application sends bus location update to the database periodically via internet.To find out current bus location, user side application will request bus data to the database.With realtime feature from Firebase Real time Database, user side application did not need to request update data anymore because it will synchronize automatically.Bus location that shown obtained from the driver side application.So if no one driver is online, there are no bus displayed.
The architecture system is shown in Figure 1.

Driver Side Application
The driver side application is responsible to update current bus location.Figure 2 show the flowchart process to update bus location.Periodically this application get geographic coordiates from the GPS receiver.Our proposed system set the location update by five seconds.The driver send bus current location and bus information to the database in java object format via Android Firebase API.Before the data stores in database, the application will check the bus information to the database.If the data exist, the application will update bus location, if not the application will create a new bus data.The Driver side application flowchart is shown in Figure 2.

User Side Application
The user side application provide some features, as follow: 1. Shows all bus and shelter markers in just one maps layout and devide bus and 2. shelter markers into different color for each corridor.The application will fetch all bus and shelter data from database then devide it based on bus and shelter corridors then display it to the user via Google Maps API. Figure 3 show flowchart process to show all bus data and shelter location.3. Displays maps legend to help user find out the meaning of the shown markers.
4. Provides user bus arrival time to a particular shelter.User can input desired bus and shelter to find bus duration to get to the shelter.The application will show routes between bus and shelter and get the duration via Google Direction API. Figure 4 shows flowchart process to get bus arrival time to particular shelter. 5. Provides list of bus that have heading to destination shelter.User can input the destination shelter and then the application will provide user a list of bus which have heading to destination shelter based on shelters corridor.Figure 5 shows flowchart process to get list of bus that have heading to destination shelter.

RESULTS AND DISCUSSION
The bus tracking system is implemented using tools introduced in the previous section.
The application have been installed on Android smartphone.Before the application tested using Mean Opinion Score (MOS) method, a trial of application were made to make sure all of the features work properly.The trial is done by trying the application to do its tasks in real condition.Some people become drivers and the other become users.
1.The driver side application -With GPS receiver which biult'in on smartphoe, the application succeed to collect current location data every five seconds then sends it along with bus information to Firebase Realtime Database.Figur 6 show of the driver side application     After make sure all feature work properly, testing done to find out the application readiness before its deployed.The user who have tested the application are given a questionnaire to give their opinions on the application.This testing is divided in 3 evaluation aspect that is application performance, application easiness, and application interface.Figure 11, Figure 12, and Figure 13 show the testing result using MOS.

CONCLUSION
This paper present a prototype of bus tracking system using Firebase Realtime Database.The system is well designed and implemented.It is proven that Firebase Real time Database can be implemented on bus tracking system.Both driver side application and user side application succeed to provide all function and tried with an expected result.On a MOS testing, this application succeed to provide what user need with 92% user claims that the application able to provide a usefull information and 84% user claim that our proposed system is worthy to implement at BRT Trans Semarang.

Figure 3 .
Figure 3. Show all bus and shelter location flowchart

Figure 6 .
Figure 6.Driver side application 2. The user side application -this application succeed to give user information about BRT Trans Semarang.This application interfaced with navigation drawer, so user just need to swipe the screen from left to right to get application menu as shown in Figure 7.

Figure 7 .
Figure 7. Application navigation drawer 3. Show all bus and sehelter marker -This feature succeed to show all bus and shelter marker in just one maps layout then devided into different color for each corridor as shown in Figure 8.

Figure 8 .
Figure 8. Show all bus and shelter location 4. Get bus arrival time -By select desired bus and shelter location below maps layout, this feature succeed to inform user the duration taken by bus to get to the selected shelter as shown in Figure 9.

Figure 9 .
Figure 9. Get bus arrival time 5. Get list of bus -By selecting the destination shelter, the application will show user a list of bus that have heading to the destination.The list of bus shown based on shelter corridor as shown in Figure 10.

Figure 10 .
Figure 10.Get list of bus