Implementation phase for the NavUP system, COS301, University of Pretoria.
This is the repository for the Navigation module of team Longsword. Team Longsword is building the NavUP system for the Android platform. The project for Longsword will be completed in Java. Navigation will manage the databases for: User Preferences for routes, Custom pins dropped by users, a cache of all recent routes. Navigation also provides an interface for calculating a route. If the route isn't in cache, the GIS module is called to return a calculated route.
To run the code:
- Make sure that you have xampp installed
- Install the IntelliJ IDE (we set up a maven project and SQL DB connection through it)
- The Link: https://www.jetbrains.com/student/
- Use your student gmail to create an account and download it, students get the full edition for free
- Run the apache and MySQL server through xampp
- Open the project using InteliiJ
- In the following directory you will find a .jar file that has to be added as a library
- src/main/resources/mysql-connector-java-5.1.41-bin.jar
- Right click on the .jar file and add it as a library
- Now to set up the MySQL DB:
- Open up phpMyAdmin (type local host in the browser and go to phpMyAdmin)
- Create a database called Navigation (do not create any of the tables)
- To set up a MySQL connection in IntelliJ simply:
- On the menu bar click on view -> Tool Window -> Database
- An empty window pane should open up to the right. Click on the green cross then go to Data Source -> MySQL
- Click on MySQL, this will open a new window which will have multiple fields to fill in
- Host: Localhost
- Databse: Navigation
- User: root
- Password: leave this field empty
- Once the fields have been filled in click on Apply and then click on the Test Connection button
- It should say Successful in green next to the button if everything is okay
- To create the tables you will find a .sql file in the resources directory (mentioned above)
- Right click on the SQLCommands.sql and then click on run 'SQLCommands.sql...' in the drop down list
- At this point the SQL tables should have been created in the Navigation DB
- Refresh the phpMyAdmin page, all of the tables should be visible
- To run the program you need to click on the Run menu option and then click on Run... from the drop down list
- This will build the project and will make it runnable
- If you would like to run the code from this point onwards:
- click shift + F10 or
- click on the run menu option and click on Run 'Main'
- An output terminal should appear at the bottom containing the results of running the program
- The Main used to test this code is simple as the functionality necessary for the Integration teams use was only tested