Destination alarm notification for public transportation passenger using Geo-Fence in mobile App

Geo-fence is a non visible parameter that allows interaction between user of mobile device and point of location in sending and retrieving information. A destination alarm mobile app can help to alert and notify passenger of public transportation on their current location and the destination. An alarm will be triggered once the mobile device enters the geo-fence of the point of destination. Eclipse Kepler is the platform to develop the bus destination mobile app. Using Java language; the mobile app is built compatible for Android User. The process started from drafting storyline and interface, developing coding geo-fence 300m from point of destinations and finally testing the mobile app in real travel journey. The actual locations of alarm triggered were collected by getting the latlong from Google Maps to determine the difference between the distances automatically measured from the actual locations of alarm triggered to the point of destinations. The difference on battery consumption while using and not using the app also taken into consideration. The actual alarm triggered slightly differs from the expected 300m from point of destinations but still acceptable near to the geo-fence. The alarm continuously notify passenger even after exiting the geo-fence until it be denied by the user. The alarm drain energy


Introduction
In a modern way of living with the high density of population, public transportation is a wise choice for most of the people to commute from one place to another. People in a very congested and high populated city tend to choose public transportation as their daily initiatives of commuting from one place to another. People in the city prefer to commute using public transportation in avoiding traffic congestion they might experience if they drive their own transport while having their daily life routine for example going and return home from work [1].
Travelling in a long journey as to commute from one place to another in far miles using public transportation can be a very tiring experience causing hectic and passenger tend to fall asleep throughout the journey. Statistically seating in the bus or train causing a really boring experience throughout a very far journey. Most of the passengers likely to take a nap but hard to notify and wake them up when they are nearly reach their destination and this may causing them to miss their stops and need to find another way of getting back to their destination which may cost them double than usual [4]. The problem is to notify passenger on the destination also affecting those disabled person. Mostly, disabled person which suffer deaf or hearing impaired are having difficulties and some are embarrassed to ask other passenger whether the bus nearly reach the destination or not [5]. It is very good if they can take a rest along the journey like other passenger and got something to notify them if they are nearly reaching their destination. Maybe a simple mobile application with vibration for alerting and notify them on their location once they are nearly reach their destination might be useful. Rapid growth of mobile applications take advantage of location-based services (LBS) to alert and notify mobile users about their current location either they has entering the location zone or leaving out from the zone [9].
Real-time traffic information is essential for supporting the development of many Intelligent Transportation Systems (ITS) applications [2]. In the world of technology and Geographical Information System (GIS), integration of public transportation together with information technology may be very useful for passenger that travels through a long journey or having a very tiring day. Though GPS give benefits to wide amount of application invented nowadays from personal for navigating and allocating purposes to tracking spacecraft orbits, still there are some defects hardly to avoid which will effect the accuracy of location data received [3]. This is a prototype of an app using Android operational system that may trigger alarm which able to wake up and give information to the passenger or owner of the mobile gadgets that they are about to reach their destination.
There are three destinations as subjects for this mobile app test according to which bus will be selected by passenger. For this study, the location are pinned on the Persiaran Masjid Section 2 RapidKL Bus Stop, Shah Alam Post Office RapidKL Bus Stop and lastly Tesco Extra Section 13 RapidKL Bus Stop. All of the destinations are located in Shah Alam region. RapidKL U80 bus is the prototype subject according to its travel route having stops at all of these there destinations. This mobile app may be functioning if there are GPS signal available [8]. By having the connection to the internet, the app can use a high frequency GPS signal to get more accurate location of themselves to the destination.
Geo-fence can be described as a virtual fence or a geographic area bounded by membrane of polygons from the centre of a location point mostly a geographic point location set by latitude and longitude (latlong). This virtual fence will automatically detect any mobile devices entering the virtual fence and trigger information to the object detected [7]. This is the backbone for this bus destination mobile app. It will enable the app to have a virtual fence or else an outer membrane of a buffer zone from the centre point of coordinate set up in the app. The buffer zones are prepared from the point of destinations of bus stop to be reached. Once the bus pass through the buffer zone, the alarm of their mobile gadgets will be triggered to notify or waking the passenger up from their sleep or short nap and they will notice the destination is not too far and ready to disembark. The main purpose of this app is to notify the sleepy passenger and sometimes the disable person which having deaf or impaired hearing that they are nearly reach their travelling destination. This may avoid them from missing their stop and give them enough time to check their belongings before disembark. Other than that, this technology may also help a strange tourist to notify them for stopping at their destination without having problem to ask other passenger which will become a problem if they are having some problems in language communication [8].

The mobile app storyline
Bus Destination Alarm app prototype has a very simple graphic and interface. At the very front page or the main page referring to the Figure 1   By selecting one of the destination for example the SHAH ALAM button, it will connect to another page which is the 3 rd page for selecting the destination according to the route selected. The page is shown at Figure 3. To make things clear here, when user chooses to travel by using Rapid Bus, they can simply choose the bus company from several buttons in page 2. Once user hit the button for Rapid bus, the app bring user to another page with several choices of city covered by Rapid Company. User can choose which destination of the city that to commute by using the Rapid bus.
In the page 4 of the app referring to Figure 4, user may choose the destination of bus stop as their drop destination from several buttons available. Every button have their own coordinate (latlong) embedded in the app. By traveling in single route, the bus may drop passengers at several bus stops or stations, so there are several options for user to choose their desired destination. By selecting the  Figure 5, the geo-fence will be added and the activity of geo-fence will be called up from the Constants.java once the switch was turned on

Preparing Storyboard and Layout (Design Phase)
In earliest step under the implementation phase, the interface and layout of every pages of the application need to be prepared. Story board will be used as reference to prepare the whole layout of the application, framework and the flow step between one pages to another while running the application. There are several layouts for different activities according to their function. All of the strings button act as a function to call another java file need to declare first to ensure the process of developing the app run smoothly.

Declaration Strings Button
Every single string buttons in the app have the function to call another activity in the app. Through design phase, all buttons have been determined together with their function. All of the buttons were declared in the Strings.xml to make them have their own character and can be functioned in the application.

Layout Pages
From the main pages at front until the end page of the app consists of several string buttons. Every pages have their strings button and since this is just a prototype application, some of the string button are just dummies while the rest are carrying function to call another activity from other java file or from another activity layer

Constants Activity Java File
All coding using Java Language in Constant activity were imported from the web GitHub.com and modified to fit for the suitability of the app [6]. All of the coding for geo-fence functions was modified according to the suitability of the app and for the operational system. In Constants, all of the activities were declared including the radius of Geo-fence 300 m from point of bus stop, the expired period for geo-fence 12 hours long from the activation of geo-fence and the Latitude and Longitude (coordinate) for every bus-stop according to their route selected.

Geo-fence Intent Service Java File
In Geo-fence Intent Service, all of the coding for activity once the device entering and leaving the geofence was built together with the notification function in the app. Geo-fence Intent Service also has the activity for calling up alarm from Media Player Manager in Alarm Activity Layer. All of coding and activities for any error appear related to the goe-fence while operating the app was also built in the geo-fence intent service. The coding will call up other activity in GeofenceErrorMessages.java to pop out the notification to alert passenger about any error that happen while running the app.

Alarm Activity Java File
The most important thing for an alarm app is the alarm itself. In Alarm activity java file, the integration of media player with the app will allow the alarm to start playing when device entering geo-fence. Once the device hit the membrane of geo-fence, the activity will call upon the media player and the alarm continuously ringing until the activity is aborted when dismiss button being hit by the user. This is good to make sure the alarm won't stop ringing even leaving the geo-fence.

The App Activities
The bus destination alarm app is an Android based application built by Java language consists of several layer of pages and activities. Activities starting from main page until the end connected by the string buttons declared together with their own function. Figure 6 shown the cycle of activities run in the bus destination alarm application. By using location based system integrated with the app, the device will send and receive the GPS signal while using the app. User may also view their current location at the main page by hitting the string button that call the integrated url of Google Map application. From the main page through several pages, strings button act as the bridge to connect from one page to another. User start to select their bus, city to commute and destination or station to disembark (bus-stop) and at the end there is a switch button to turn the alarm on according to the selected destination.
Once the alarm button is switched on, it starts to call the activities in Constant Layer. Based on the selected destination, the system starts to call up for the coordinates of destination together with the radius of geo-fence from the point of destination. The radius of geo-fence set in the app is 300m from the pinned coordinate of bus-stop location. So, once the Constant activity called up by enabling the alarm button, the geo-fence for destination is ready. The device is moving as travelled by bus on the travel route carrying the real time coordinate of the moving device in the bus. As the device touching and entering the membrane virtual fence set as geofence 300meters from the pinned coordinate of destination, the Geo-fence Intent Activity is calling up. Geo-fence Intent Activity is the activity react on the event of device touching the membrane of geofence set earlier. Once this activity is calling up, it will call for strings button 'dismissed' for user to shut the alarm when they already waken up. It also calls up the Alarm Activity to notify passenger about the destination in the form of loud alarm sound. Figure 7 show the geo-fence of one of the destination in the mobile app. Once the Alarm Activity being called up, it will trigger and enable the alarm from the Media Player Manager. This alarm continuously notifies the passenger until the 'dismissed' button is hit. User may also reset the geo-fence by removing it at the main front page of the app. There's string button for remove the geo-fence named 'Reset Alarm' button.

Location of Alarm Triggered on scene
There are three destination of bus stop as subject to this study and the geo-fence for every destination were set to 300m in radius from the latlong of the destination.  Table 1 shows the comparison of the location of alarm triggered for three different locations. All coordinates were retrieved from Google Map. Integration of Google Map with the app allow data of coordinate to be retrieved once be connected by the strings 'View Location'. The distance also measured directly from Google Map. For all three locations, alarm not triggered exactly 300m from point of destination according to the geo-fence set in the application. Since this app acquiring data from free source Google Map, the data might be less accurate than actual location. This may also happen because of the ability of device to retrieve data or the strength of internet connection.

Energy Consumption
The comparison of energy consumption between the device when turning on and turning off the application but still with the GPS function on are as below: Table 2. Energy consumption while using the bus destination alarm App The energy consumed while running the app shown in Table 2, above. Clearly according to the table above, the application will drain higher amount of energy from the device which are 5% per 10 minutes compared to the condition when the app is turned off with approximately 2% per 10 minutes

Alarm Loop
The alarm continuously ringing even the device had leaved the geo-fence of the location. The alarm keep ringing until 12 hours and only be stopped once the dismiss button was hit.

Notification Message
During testing the app, for example when device entering the geo-fence, the alarm was triggered and notification of device entering the geo-fence for example "Exiting Tesco" when exiting geo-fence was popped out and appears on the device's screen.

Discussion
The prototype of the bus destination alarm mobile app was successfully be built and tested. This app might help passenger to notify on their destination without miss out their stops due to have a short nap throughout their long tiring travel journey. Simple concept for developing the app has been implementing for this prototype. All of the geo-fence for every single destination's coordinates set to 300m in radius. Through testing and commissioning process of the mobile app application, the alarm triggered not exactly at the membrane of 300m distance from the destination. These happen for all three points of destinations and maybe because of the data used are not too accurate since the coordinate for every station are acquired from free source Google Maps. So the accuracy might not precisely accurate yet it is still acceptable. The application drain energy of the device higher than it is in idle condition. So, it may not suitable to set the alarm on the origin station for a very long travelling journey. Maybe for a longer travel journey, the geo-fence can be set broader to give much time for the user to wake up and ready to disembark. The alarm triggered when the device enter the geo-fence and it won't stop even when the device exiting the geo-fence until the dismiss button being hit. The loop for that alarm to receive information to stop by hitting the dismiss button is about 12 hours. When the device entering the geo-fence, it will trigger alarm and simultaneously sending notification to the device user. As final conclusion throughout the whole study, geo-fence can be an interest and flexible tool to spread information or notify people at surround of pointed location about any events, current condition and alerting an information about the pointed location for specific purposes.

Turning Off Application
Turning On Application Energy Consumption in 10 minutes 2% 5%