External Libraries - SOEN390-ConUNav/SOEN390-Mini-Cap-Project GitHub Wiki

Analysis on external libraries, (pros, cons) and why we chose x apis.

Google Oauth and google calendar

For this project we looked into using Google calendar API, which would force us to use Google Oauth in order to fetch the data of an user's Google calendar. We attempted a small proof of concept with oauth being fully handled on the backend but ran into a major roadblock regarding how the android simulator handles localhost calls and the security rules forced by Google for a Oauth setup. The proof of concept relvealed that we could not make localhost calls on while using the android simulator since it would resolve them as phone itself instead of the host machine, to get the sim to make a localhost call to the running backend we would have had to use the sims predefined IP address for the local machine. This made it that for the redirect URI of Google Oauth we were not able to use localhost since it would not reach the backend as intended and google does not allow for the redirect URI to contain a plain IP address. Instead he had to pivot to using oauth from the frontend using react-native google oauth.

Concordia OpenDataAPI

For the requirements of this project we had to chose between using Concordia's OpenDataAPI and Google Calendar in order to fetch the data related to course location in terms of the building and classroom. While looking at the way that Concordia's API handles the course schedules we realized that for a user centric experience it was not ideal. The user would've been required to know which was his next class and where in order to get his directions through the map. Compared to Google calendar which allows us to streamline the experience by given the user a button dedicated to getting his directions for the next calendar event on the map view without having to count on the user remembering his schedule.

Google Maps SDK for Android/iOS

The Google Maps SDK is used to integrate the interactive map interface into the application. It serves as the visual foundation, allowing users to see their current location, view the suggested route, and interact with geographical data in real-time. We selected this SDK to ensure seamless compatibility with the Directions API, providing a high-performance, hardware-accelerated map experience that feels native to the device. This decision was also made with the idea of using various Google apis to complete the project. We thought of maybe using leaflet as our map api, but then foresaw many complications when trying to integrate various apis from different sources and decided it was best to choose Google apis since they are built to work together.

Key functionalities:

Custom Map Rendering: It allows us to overlay the trip’s polyline directly onto the map and use custom markers to represent the user's starting point and destination.

Dynamic UI Controls: It provides built-in functions and UI elements that enhance the user's ability to navigate the map during a trip. It allows us to add markers and overlays for visual clarity on some elements like the Concordia buildings.

Google Directions API

The Directions API is used to calculate directions between locations. It provides the routing logic necessary for the application's navigation features as well as the polyline for the visual route of the trip. We chose this library since Google Maps Platform provides a lot of flexibility and easy integration into our app. There is a lot of different api to be used in this project and to keep it consistent we went with the Google maps. Also the polyline is build for the Google Maps api.

Key Functionalities:

Step-by-step directions: It breaks down the trip into steps to make instructions easy for the user to understand. Example: "Turn left in 500m"

Trip estimation info: It provides an accurate estimation of time and distance for the user to reach their destination and considers the mode of transportation.

Polyline: Provides a full polyline of the trip which integrates seamlessly with the Google maps SDK Android.

Google Places API (New)

The project utilizes the modern Places API (New), high performance version of Google's location service to provide rich data about points of interest. It allows us to set a radius and filter the places of interest. We can chose the type of places that we want like restaurants. It retrieves data of these places automatically and the data is already structured very cleanly. It was the optimal choice since we are continuing to use the various Google apis to complete our features.

Key Functionalities:

Rich Place Details: Fetches comprehensive information including business hours, user ratings, high-quality photos, and accessibility options (example: wheelchair access).

Nearby Search: Used to identify points of interest within a specific radius of the user's current GPS coordinates.

JGraphT for Graph Structure Representation

For this project, JGraphT is used to model the indoor space as a graph and to compute shortest paths. Each floor is represented as a weighted graph where allowed waypoints extracted from the SVG floor plan become vertices, and edges represent valid walkable connections limited to corridors and accessible areas. Edge weights are calculated using the Euclidean distance between waypoints. To find a route, we use Dijkstra’s algorithm from JGraphT to compute the shortest path between the waypoint closest to the origin and the waypoint closest to the destination.