UNIVERSITY INFORMATION NAVIGATION SYSTEM-FYP 2015

44
University Navigation Information System PROJECT REPORT BCS Final Year Group Project-Group 05(2012 – Batch 3) Supervisor: Mr. S. Aruna. S. Lorensuhewa Group Members: R.G.G. Buddhika (SC/2012/8565) B.M.N.M.P. Kumara (SC/2012/8554) D.M.S. Jayantha (SC/2012/8552) K.M.S.P. Karunarathna (SC/2012/8549) Submission Date: 13 th July 2015

Transcript of UNIVERSITY INFORMATION NAVIGATION SYSTEM-FYP 2015

University Navigation Information SystemPROJECT REPORTBCS Final Year Group Project-Group 05(2012 – Batch 3)

Supervisor: Mr. S. Aruna. S. Lorensuhewa

Group Members:R.G.G. Buddhika (SC/2012/8565)B.M.N.M.P. Kumara (SC/2012/8554)D.M.S. Jayantha (SC/2012/8552)K.M.S.P. Karunarathna (SC/2012/8549)

Submission Date: 13th July 2015

University Navigational Information System-Final Report

Table of Contents1 Introduction......................................................21.1 Background.....................................................2

1.2 Problem Definition.............................................31.3 Scope..........................................................4

2 Requirement Analysis and Design...................................62.1 Requirement Analysis...........................................6

2.2 Design.........................................................73 Implementation...................................................11

3.1 Web application...............................................113.1.1 Basic User Interfaces.....................................12

3.1.2 Web Services..............................................153.2 Mobile application............................................17

4 Testing and Evaluation...........................................215 Conclusion and Future Works......................................22

5.1 Drawbacks and limitations of the System.......................225.2 Future improvements...........................................23

6 References.......................................................247 Appendix.........................................................25

1

University Navigational Information System-Final Report

2

University Navigational Information System-Final Report

1 Introduction

This report is prepared for the fulfillment of the compulsory course module CSC3113/Group project which leads for the fulfillment of Bachelor of Computer Science (General) Degree.

1.1 Background

Smart campus concept is recently staged among researcher’s buzz withthe advancement of ICT. Several start-ups are initiated alreadybased on those concepts to implement infrastructures and systemsby investing large capitals in developed countries. Facilitatingeach individual with information can be observed as a primarycharacteristic of those systems.

GPS-based navigation becomes more generic with the popularization ofsmart mobile devices among the public. Mobile phones are nolonger simply for building voice communications, but also takinginto account for supplying multi-purpose smart services. Todayalmost all handheld devices integrated with a GPS receiver unit.This GPS technology were used for military purposes at itsbeginning of its origin and not belongs to civilians. Thisfacility leads lot of beneficial applications. After it wasexposed to the public users with the technical improvementnavigation became much easy. Nowadays this technology applies inagriculture, aviation, environment, marine, public safety and etc. The actualaccuracy depends on factors including atmospheric effects skyblockage, receiver quality of GPS devices. Real world data showsthat their high quality GPS receivers provide better than 3.5meter horizontal accuracy.

3

University Navigational Information System-Final Report

Web applications can easily accessed via internet using desktop,laptop or smart phone at home, office or any other locations. Thedemand of web application development is increasing day by day.Everyone looks for high-end quality as well as cost-effectivecustom web development solutions to adapt their requirements. Soevery business tries to adopt these web applications during theirservice provisions.

With the development of the geographical information technology,navigation brings more convenient to people. Tech giants likeGoogle, Microsoft are already giving free public accesses ofgeographical map information. Public will be benefited if one canblend these technologies and bring information to their hand heldsmart device in their busy routine.

4

University Navigational Information System-Final Report

1.2 Problem Definition

Basically, our project (University Navigation Information System)addresses following problem domains.

1. A visitor who is unfamiliar to the Ruhuna University premiseswill not find the locations exactly without the support ofother person.

Normally considerable amount of outsiders are visiting theuniversity within a day for different purposes. Among them,the students who follow external degree or certificateprograms who are frequent on weekends. They becomeinconvenient and lagging while ensuring particular place forthe first time inside university. You can use the Campus GuideMap to find auditoriums, meeting rooms, cafeterias - or thenearest toilet. The service shows you the way to the rightbuilding, floor and room inside the building. You also havethe opportunity to add your own locations or content that youthink should be included.

2. Engineers in the building and maintenance unit of RuhunaUniversity are using traditional paper-drawn ground plans(incomplete).

They are facing difficulties in deciding places to build newbuildings as they don't have proper complete plan. They arenot using any tool to compare the available locations. We haveintroduce a method to handle the complication they face here.

5

University Navigational Information System-Final Report

1.3 Scope

Basically our system has two major components, web applicationand android app. On some instances they work together toachieve several goals while some instances they workindependently. Here it describes how each component will givethe functionalities for above identified objectives.

Web application

1. Enhance the student navigation experience with interactiveuniversity maps

Our university navigation web application gives students accessto the following benefits.

1. Our enhanced search facility helps to find buildings, lecturer halls, lecturers, andmore.

User facilitates to find most of the places in theuniversity. Suggested list will appear to select when theuser press couple of letters of the location.

2. Display Pre-saved landmarks of the locations in the university.

6

University Navigational Information System-Final Report

This feature will show almost all the special landmarkswhich a visitor will find in one’s journey.

3. Ability to locate buildings, professors, and more as user wishes.

User may need to locate the places where he/she went. Ourweb application will facilitate that.in the case of engineerhe may want to highlight a selected area for his future workor demonstration purposes. That facility also implemented inour application.

4. Ability to search person by one’s picture.

When a particular person know peoples by picture one canselect the picture and focus into the place where thatperson reside in the university. This feature brings theuser an awesome experience.

5. Directory of information portal of the university.

This helps to find lot of information in a single entry.This feature will brings user a bulk of location basedinformation.

6. Calculate possible routes from selected source to destination.

There is a feature to display the path of a selected route.

2. Help engineers to find the cables lying under the universityground.

Our application is capable to facilitate engineers to showunderlying cables. Authorized engineers can update a selectedpoints (predicted point of having a cable) using the androidapp. then the web application will update interactively and itwill show most recent updated cables.

7

University Navigational Information System-Final Report

Android app

1. Enhance the student navigation experience with interactiveuniversity maps

Our university navigation android application gives studentsaccess to the following benefits.

1. Our enhanced search facility helps to find buildings, lecturer halls, lecturers, andmore.

User facilitates to find most of the places in theuniversity. Drop down lists will appear to select a placeconveniently.

2. Display Pre-saved landmarks of the locations inside the university.

This feature will show almost all the special landmarkswhich a visitor will find in one’s journey. This will helpto get an idea where he is at that time. The place willcapture using the GPS coordinates of current location.

3. Ability to locate buildings, lecturers, and more as user wishes.

User may need to locate the places where he/she went.

2. Help engineers to find the cables lying under the universityground.

Our app is capable to facilitate engineers to show underlyingcables. Authorized engineers can update a selected points(predicted point of having a cable) using the android app.Then the web application will update interactively and it willshow most recent updated cables. Android app will notifynearest cables when the engineer move about the universityarea.

8

University Navigational Information System-Final Report

2 Requirement Analysis and Design

2.1 Requirement Analysis

For the Requirement Analysis in this project we used followingtechniques

1. Observing the environment.2. Interviews

Basically we identified above mentioned problem domain byobserving the environment. As we are indoor university students,we have met considerable amount of people who have not properknowledge of travelling in the university and are not frequentvisitors too. We have got a chance to interview several people.They clearly appreciate the convenience of having such support.

But our next challenge was how we can make available thisrequirement. Do we solely present it using web interface or do weachieve it using android application? That was our primaryproblem. With this problematic situation we arrange a littlesurvey to check whether the presence of hand held smart phones ofthese target group. Fortunately we confirmed that over 50%portion of selected sample had smart phones running androidoperating system. Then we came to a conclusion that this can bevery useful for any person we visit the university for differentpurposes.

And also we collected necessary GPS coordinates which requiredfor this system by using ‘Magellan Explorist-510’ GPS receiverdevice.

9

University Navigational Information System-Final Report

Addition to this, we got the some ideas in order to elicitrequirements from our supervisor and other lecturers of theDepartment of Computer Science of University of Ruhuna. Alsothere are some our own group members’ ideas too.

According to our requirement analysis it was identified 3 typesof potential stakeholders of our system.

1. Visitor2. Engineer3. Administrator

2.2 DesignBased on our requirement analysis our system flow can beabstracted as following Data Flow Diagrams.

10

EngineerVisitor

Searching Requests

Current Location Information

Confirmations

Cable

Current location Information

UniversityNavigationInformation

SystemRegistration Details

Searching requestsConfirmations

Results

University Navigational Information System-Final Report

Context Diagram

11

VisitorEngineer1.0

Draw cableCable type

Cable Data D1

User Data D2

Cable Information

Cable information

Route Data D3

2.0

Draw route

GPS locations of cable

Source, destination information

Route information

University Navigational Information System-Final Report

DFD Level 0 Part 1

12

3.0

Registeruser

Registration Information

Location Data D4

4.0

Savelandmark

GPS location Information

Visitor

Location Data D1

5.0

Searchlecturer,building

Search information

Location information

GPS Locations

Tracking Requests

Tracking Information

Location information

Location information

Administrator

Location information

Location information

Registration information

University Navigational Information System-Final Report

DFD Level 0 Part 2

We divided our project into 3 basic modules identifying thecomponents of the system. They are,

1. Android app2. Web application3. Database and web services

13

Tracking Requests

6.0

Trackinguser

Tracking Requests

Tracking Information

Search information

Search information

University Navigational Information System-Final Report

Database E-R diagram MySQL notations

Database model(ER diagram) is shown above.

custom_location(cus_location_name,cus_description,cus_latitude,cus_longitude) table consists every GPS coordinates which are supposedto use in path and line drawing and many more.

And also it refers to the latitudes and longitudes ofbuilding (bui_lattitude,bui_longitude) and lecturer(lec_lattitude,lec_longitude).

User has two type of users as engineer and visitor.

14

University Navigational Information System-Final Report

3 ImplementationAs defined under scope this system consists with a webapplication and a mobile application. These are the technicaldetails.

Programming Languages 1. JAVASCRIPT,PHP,HTML,CSS,AJAX,JQUERY

2. Java Database Technology 1. MySQL External APIs,Libraries,Services

1. Google map android API2. ArcGIS online webmaps 3. Google map JavaScript API4. Scribble maps online tool5. ArcGIS Storymaps template6. Apache Web Server

IDEs and Editors 1. Android Studio IDE2. Adobe Dreamviewer3. Sublime Text 2 Editor

3.1 Web application

Web application is implemented basically using PHP and MySQLDatabase Server. This combination is most popular amongdevelopers as it is free and open source, frequent documentationand etc. JavaScript was used when handling the things with mapAPIs. AJAX and JQUERY languages were used as appropriately inachieving certain goals with less code. ArcGIS storymap templatewhich is available for developers free on github were used todevelop ‘all pic collector’ feature. But natively it loads ArcGIS onlinewebmaps which required to pay for usage after exceeding twomonth trial period.

Visitors are allowed to use the system without signing up.But they have read only privileges. Engineer and Admin user

15

University Navigational Information System-Final Report

types require login in order to access the system. Admin cangrant access privileges to authorized engineers by makingaccounts.

When displaying multiple pages, login detail given at thefirst page should be preserved. To implement thisfunctionality PHP sessions were used. So at the beginning ofthe required pages following code snippet were included.(See Appendix 6.1)

In implementing the “add custom marker” feature in our webapplication, we used jQuery’s shorthand Ajax methods. Thiswas helps to save the data into the database and delete fromthe database asynchronously when button click eventtriggered. Relevant JavaScript code snippet is shown below.(See Appendix 6.2)

In implementing “path drawer” feature in our webapplication, we embedded php codes inside the JavaScriptfunctions in order to retrieve relevant data from thedatabase. This is the optimized way to have although thereare another methods to have. This will reduce code blast.Sample code is shown below. (See Appendix 6.3)

In implementing “special locations” feature in our webapplication we were used downloadUrl javascript method whichis much popular among JavaScript coders to reading GPScoordinates from an XML file. The following code snippetdemonstrate that. (See Appendix 6.4)

downloadUrl is a user defined function with two parameters. Firstparameter pass the relevant XML file and second parameter iscallback function which will execute after first one retrieved.Reading XML files in JavaScript requires is done byXMLhttpRequest object.

16

University Navigational Information System-Final Report

Additionally, during the implementation of the web application weused Firebug Firefox extension and native web developer tool fordebugging purpose.

3.1.1 Basic User Interfaces

Our System consists with many user interfaces and here we focuson the interfaces related to basic tasks of the system.

1. Login page(respo-login-form/ index.php)- Fig 3.1.1This is the first page .One can sign up or sign in using hispage in order to get privileges to enter to the webapplication.

Fig 3.1.1: login page

2. Landing Page (respo-login-form/LandingPage/index.php)- Fig 3.1.2 This page consists with the primary features that providedfor users in the system. Basically this web page look like alanding page of a mobile application. One can download ourandroid application using this page.

17

University Navigational Information System-Final Report

Fig 3.1.2: landing page

3. Special Locations(respo-login-form/LandingPage/special-loc/index.php) -Fig 3.1.3

This shows a collections of venues inside university withdifferentiable markers.

18

University Navigational Information System-Final Report

Fig 3.1.3: special locations page

4. Custom Locations(respo-login-form/LandingPage/custom-marker[new]/index.php)-Fig 3.1.4

This service help you to keep remember the places in the university map.

Fig3.1.4: custom locations page

19

University Navigational Information System-Final Report

5. Path Drawer(respo-login-form/LandingPage/custom-marker[new]/index.php) –Fig 3.1.5

User will see different available paths from one source to other destination.

Fig 3.1.5: path drawer page

20

University Navigational Information System-Final Report

6.

Lab Finder(respo-login-form/LandingPage/labFinder/index.php) – Fig 3.1.5Fig 3.1.6: Lab Finder page

3.1.2 Web ServicesBasically, in our system contains 2 categories of web services to2 different purposes.

1. To retrieve location data

This web service is created for retrieving data about lecturers,buildings and etc...For this we have created 5 separate phpfiles.

1. get_canteen.php2. get_data.php3. get_washroom.php4. get_welfairdata.php5. getbuilding.php6. getlecturers.php

21

University Navigational Information System-Final Report

2. To update location data

This web service is created for updating location data aboutlecturers, buildings and etc...for this we have created 5separate php files.

1. update_building_location.php2. update_custom_location.php3. update_engineer_location.php4. update_lecturer_location.php

22

University Navigational Information System-Final Report

3.2 Mobile applicationWe used Android SDK with java to build the mobile application .Mobile application in our system is designed for facilitating 4 requirements.

1. Update the location data of lecturers, buildings and etc. by avisitor.There is an interface to update underlying cable information,lecture,building locations to application database.this task can b done only for the authorized type of uses.

Fig 3.2.1: add location screen

23

University Navigational Information System-Final Report

2. Display the underlying cables with current location This interface will show cables to the engineer with his/her current location.One can see the selected type of line by using option drop down menu.

Fig 3.2.2: network lines screen

24

University Navigational Information System-Final Report

3. Search any location

This interface will help to find the locations. It make easy to find a location.it has several drop down menus to focus on your search.

25

University Navigational Information System-Final Report

Fig 3.2.3: search location screen

4. Display current location

26

University Navigational Information System-Final Report

This interface will be your companion interface in your journey.This will show your current location and landmarks youwill meet.

Fig 3.2.4: current location screen

27

University Navigational Information System-Final Report

4 Testing and Evaluation

In our development process we followed Agile Methods to completethe identified system functionalities. As we subdivided oursystem functionality into modules, each module were testedseparately. For their better functionality. Then the entiremodules were integrated and tested for the full functionality ofthe system. Web application was tested entirely on Firefox 38.0.5(thelatest version) web browser. Android application was tested onSamsung Galaxy GTS7582 android smart phone.

When testing the communication between Android application andweb services, it was done in a wireless (Wi Fi) networkenvironment. After testing in the local server, we hosted the webapplication to the 000webhost.com-Free Hosting web server(integrate with MySQL database server) and did the final test.

To test server side functionality of web services, first it wastested using the web browser. We tested to check what it returnswhen we invoke the web service, for an example following JSONresult was returned when we invoked get_data.php file. (SeeAppendix 6.5)

We prepared an evaluation form to obtain user feedbacks. Upto date, we have collected user feedbacks from students (SeeAppendix 6.6) as a system user. We hope to collect userfeedbacks from engineers too. From the collected userfeedbacks, it is clear that this system is useful for thevisitors in many ways. There were some suggestions from ourlecturers, how to improve this system using advancedfunctions. We hope to consider about them in the future.

28

University Navigational Information System-Final Report

29

University Navigational Information System-Final Report

5 Conclusion and Future WorksAs a Conclusion this is how our system functionalities have solved what we identified based on user requirements.

1. Enhance the student navigation experience with interactivemaps

This was the primary system functionality we identified. In orderto implement this we have added several features in our webapplication. One could search particular lecturer or building byname or search.

2. Help engineers to find the cables lying under the ground.

Next major functionality was to assist engineers when they lookor a place for new building. They will get rid of damaging lineslying under the ground.

5.1 Drawbacks and limitations of the System

1. Fluctuations in Android GPS coordinates

Smart phone GPS signal strength sometimes changes unexpectedlyand it is not uniform everywhere. This will give wrongresults. As there’s no methodology for solving this, theproblem is with the system.

2. Accuracy in the underlying lines

All the details were collected by using the knowledge andinformation provided by the maintenance unit of the University ofRuhuna. They also don’t have complete accurate information ofthe initial constructions of the university.

3. Systems works only for the science faculty premises.

30

University Navigational Information System-Final Report

In each of our development aspect, in this stage we onlyfocused on science faculty complex. It will use only relevantto the science faculty.

5.2 Future improvements

1. Expand the system for whole the faculties in universitypremises.

Currently our system functionality is limited to the science facultycomplex. We hope to expand this as every faculty can have theadvantages.

2. Implement an algorithm to find the shortest possible pathbetween two places.

Currently our system display the preserved paths among twodestinations. We expect to develop it to select the most suitablepath intelligently among possible set of paths.

3. Test the ability to use the system in Ruhuna University (as areal world application).

4. Integrate LMSs,MISs other information services effectively inevery faculty to a single system as a location based service.

31

University Navigational Information System-Final Report

6 References

1. http://www.wpfreeware.com/tutorial/ 2. https://developers.google.com/maps/documentation/javascript/ 3. https://developers.arcgis.com/en/applications/ 4. http://developer.android.com/sdk/index.html 5. http://stackoverflow.com/ 6. http://youtube.com/

32

University Navigational Information System-Final Report

7 Appendix6.1 Session Implementation

<?php session_start();

if(isset($_SESSION['user_name'])==false){?> <!DOCTYPE html PUBLIC "-//W3C/DTD XHTML 1.0 Transitional//EN"

33

University Navigational Information System-Final Report

"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title> Please Log In for Access </title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> </head> <body> <h1> Login Required </h1> <p>You must log in to access this area of the site. If youare not a registered user, <a href="http://localhost/respo-login-form/index.html">click here</a> to sign up for instant access!</p> </body> </html>

<?php exit;

}else{ ?><!doctype html>

<!—html code goes here-->

<?php}?>

6.2 Add Custom Marker Feature Implementation

//############### Remove Marker Function ##############

34

University Navigational Information System-Final Report

function remove_marker(Marker){

/* determine whether marker is draggable new markers are draggable and saved markers are

fixed */if(Marker.getDraggable()) {

Marker.setMap(null); //just remove new marker

}else{

//Remove saved marker from DB and map usingjQuery Ajax

var mLatLang = Marker.getPosition().toUrlValue(); //get marker position

var myData = {del : 'true', latlang : mLatLang}; //post variables

$.ajax({ type: "POST", url: "map_process.php", data: myData, success:function(data){

Marker.setMap(null); alert(data);

},error:function (xhr, ajaxOptions,

thrownError){alert(thrownError); //throw any

errors}

});}

}

//############### Save Marker Function ##############function save_marker(Marker, mName, mAddress, mType,

replaceWin){

//Save new marker using jQuery Ajax

35

University Navigational Information System-Final Report

var mLatLang = Marker.getPosition().toUrlValue();//get marker position

var myData = {name : mName, address : mAddress, latlang : mLatLang, type : mType }; //post variables

console.log(replaceWin);$.ajax({ type: "POST", url: "map_process.php", data: myData, success:function(data){

replaceWin.html(data); //replace info window with new html

Marker.setDraggable(false); //set marker to fixed

Marker.setIcon('http://localhost/respo-login-form/landingPage/myicons/other.png'); //replace icon }, error:function (xhr, ajaxOptions, thrownError){ alert(thrownError); //throw any errors }

});}

36

University Navigational Information System-Final Report

1.3 Path Drawer Feature Implementation

paths['1_to_2'] = new google.maps.Polyline({ path: [ <?php include('phpsqlajax_dbinfo.php'); $mysqli = mysqli_connect($dbhost, $username, $password, $database); if (mysqli_connect_errno()) { header('HTTP/1.1 500 Error: Could not connect todb!'); exit(); } $query1 = mysqli_query($mysqli,"SELECT lat, lng FROMpath WHERE path_from='Gate' AND path_to='DCS' and track_no=1ORDER BY point_no ASC"); while($row = mysqli_fetch_assoc($query1)){ $lat1 = $row['lat']; $lon1 = $row['lng']; echo 'new google.maps.LatLng('.$lat1.', '.$lon1.'),'; } ?> ], strokeColor: '#FF0000' });

37

University Navigational Information System-Final Report

1.4 Special Locations Feature Implementation

function load() { var map = new google.maps.Map(document.getElementById("map"), { center: new google.maps.LatLng(5.937466, 80.575983), zoom: 17, mapTypeId: 'roadmap' }); var infoWindow = new google.maps.InfoWindow;

// Change this depending on the name of your PHP file downloadUrl("phpsqlajax_genxml2.php", function(data) { var xml = data.responseXML; var markers = xml.documentElement.getElementsByTagName("marker"); for (var i = 0; i < markers.length; i++) { var name = markers[i].getAttribute("name"); var address = markers[i].getAttribute("address");

38

University Navigational Information System-Final Report

var type = markers[i].getAttribute("type"); var point = new google.maps.LatLng( parseFloat(markers[i].getAttribute("lat")), parseFloat(markers[i].getAttribute("lng"))); var html = "<b>" + name + "</b> <br/>" + address; var icon = customIcons[type] || {}; var marker = new google.maps.Marker({ map: map, position: point, icon: icon.icon }); bindInfoWindow(marker, map, infoWindow, html); } }); }

function bindInfoWindow(marker, map, infoWindow, html) { google.maps.event.addListener(marker, 'click', function() { infoWindow.setContent(html); infoWindow.open(map, marker); }); }

function downloadUrl(url, callback) { var request = window.ActiveXObject ? new ActiveXObject('Microsoft.XMLHTTP') : new XMLHttpRequest;

request.onreadystatechange = function() { if (request.readyState == 4) { request.onreadystatechange = doNothing; callback(request, request.status); } };

request.open('GET', url, true); request.send(null); }

39

University Navigational Information System-Final Report

6.5 Web Service JSON Output

[{"id_custom_location":"1","location_name":"Y junction","description":"main junction","lat":"5.940074","lng":"80.576633","type":"Special

40

University Navigational Information System-Final Report

Place","image":null,"user_id":""},{"id_custom_location":"4","location_name":"Department of Computer Science","description":"CS department","lat":"5.939682","lng":"80.575943","type":"Special Place","image":null,"user_id":""}]

41

University Navigational Information System-Final Report

6.6 User Evaluation Form

42

University Navigational Information System-Final Report

43