Skip to content

Request Ride

Dikshali edited this page Sep 25, 2019 · 2 revisions

Request Ride

  • In a chat room, a user can request a ride and expect ride offers from all the users in the room.
  • The users receiving the ride request is alerted and shown on a map indicating that a user has requested a ride. The requests include the current user name, location from which to pickup, and location to drop off.
  • A user requesting a ride(Rider) can receive several pickup offers and will be able to choose which request to accept.
  • After accepting a ride, the Rider waits for the ride(Driver), and will be able to view the progress (location) of the Driver coming to pick them up on a map showing the pick up location and the driver's realtime location.
  • Upon being picked up the monitoring will stop and this will marks the completion of the ride.
  • If a user leaves the chat room it finishes the trip for both the driver and rider.
  • Users can view trip history as a Rider and Driver.

Implementation

Message

  • User can Request for ride with the option in the menu in a chatroom.
  • User has to enter Pickup point and Destination, where Google places API is used.
  • After submitting a request, a message for ride and an notification goes to all the other user who are active in the chatroom with the use of notification manager.
  • Other user can view the Riders source and destination as well as his current location in Map (Google Map) from the message.
  • User can offer ride by accepting the request and wait while the Rider selects a Driver.
  • Once Rider selects the Driver, a Notification is send stating Driver is selected.

Map when ride starts

  • Rider and Driver can open Map where the location of Drivers keeps updating in the Map real time for both rider and driver
  • Once the driver reaches the Riders start point, the Trip ends by updating the status and adding the trip details for trip history.
  • Notification is send to user informing the ride has ended.

Data Design

Message

  • User Create a Ride after selecting the location, trips child is created in Database to store all the trips information.
  • The Request message is stored in the messages database similar to other text message with a message Type as an added parameter that helps in differentiating text message and trip messages.
  • Once the message is created, message id is used to created a trip with location details for source and destination (place address, place id, latitude and longitude), trip status in trips
  • if any user accepts the ride request to provide pickup offer, Drivers details like userId, current location(latitude, longitude) is added in the same trip id in the drivers list.
  • Once Rider finalizes the Driver, DriverAccepted child is created in Trip with the drivers details.
  • Current Location is fetched using FusedLocationProviderClient

Map when ride starts

  • Using FusedLocationProviderClient drivers current location is fetched and updated in Database for the trip, this way for both Rider and Driver Location is updated at the real time.
  • Once the Driver is withing 30 meters of the Rider's start point, the trip ends. Trip status in database is updated and and trip details are added to addTrip database as a driver and rider
Clone this wiki locally