nic project final report

63
Monitoring and Surveillance using Near Field Technologies for the Gov. of India A PROJECT REPORT Submitted by Kayewan Mehernosh Karanjia Reg. No. 14MCA1012 in partial fulfillment for the award of the degree of Master of Computer Applications School of Computing Science and Engineering VIT University Vandalur - Kelambakkam Road, Chennai - 600 127 April - 2016

Upload: kay-karanjia

Post on 14-Apr-2017

36 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: NIC Project Final Report

Monitoring and Surveillance using NearField Technologies for the Gov. of India

A PROJECT REPORT

Submitted by

Kayewan Mehernosh KaranjiaReg. No. 14MCA1012

in partial fulfillment for the award of the degree of

Master of Computer Applications

School of Computing Science and EngineeringVIT University

Vandalur - Kelambakkam Road, Chennai - 600 127

April - 2016

Page 2: NIC Project Final Report

School of Computing Science and Engineering

DECLARATION

I hereby declare that the project entitled Monitoring and Surveillance usingNear Field Technologies for the Gov. of India submitted by me to the School ofComputing Science and Engineering, VIT Chennai, 600 127 in partial fulfillmentof the requirements of the award of the degree of Master of Computer Applica-tions is a bona-fide record of the work carried out by me under the supervision ofDr. Hepsiba Mabel V.. I further declare that the work reported in this project,has not been submitted and will not be submitted, either in part or in full, for theaward of any other degree or diploma of this institute or of any other institute orUniversity.

Place: Chennai Signature of CandidateDate: (Kayewan Mehernosh Karanjia)

Page 3: NIC Project Final Report

School of Computing Science and Engineering

CERTIFICATE

This is to certify that the report entitled Monitoring and Surveillance us-ing Near Field Technologies for the Gov. of India is prepared and submittedby Kayewan Mehernosh Karanjia (Reg. No. 14MCA1012) to VIT Chennai,in partial fulfullment of the requirement for the award of the degree of Masterof Computer Applications is a bona-fide record carried out under my guidance.The project fulfills the requirements as per the regulations of this University andin my opinion meets the necessary standards for submission. The contents of thisreport have not been submitted and will not be submitted either in part or in full,for the award of any other degree or diploma and the same is certified.

Guide/Supervisor Program Chair

Name: Dr. Hepsiba Mabel V. Name: Dr. Pattabiraman VDate: Date:

Examiner Examiner

Name: Name:Date: Date:

Page 4: NIC Project Final Report

Monitoring and Surveillance using Near Field Technologies for the Gov. of India iii

Abstract

The purpose of this project is to develop new services to enhance and make theMobility Platform Services Platform better.New technologies and features likeNFC, Maps, Crowd Sourcing , Real Time Charts, Dynamic Front End Design-ing, etc are developed and made available.The system will mostly be focused onempowering the NFC technology and manage the RF tags, which will be NFCenabled through mediums like cards, mobile devices or a NFC reader. We indentto use Geographic tags and Maps API to track and monitor various entities andpersonal.The NFC Technologies will also work even when there is no power orbattery backup to a device. For E.g. Even if the phone with the NFC emulatoris switched off due to low battery but I can still receive and transmit data withoutpower supply.NFC cards which will be encrypted and can be distributed to thespecified personal or entities. These cards can then be read using a mobile deviceor a NFC reader, the time and date of the recording and the geographical tags willbe sent to the server or cloud using a data enabled mechanism.These services canbe integrated to any of the existing applications and can retrieve as well as providevarious sets of information and data which can be of the at most importance to theIndian Government for the purpose of E-Governance and many other processes.

School of Computing Science and Engineering, VIT University, Chennai

Page 5: NIC Project Final Report

Monitoring and Surveillance using Near Field Technologies for the Gov. of India iv

Acknowledgement

I express my gratitude to Almighty God, my parents, other family members andfriends without whose uncontained support I could not have made this project.I wish to place on my record my deep sense of gratitude for my project guideand mentor, Dr. Hepsiba Mabel, for her constant motivation and valuable helpthrough the project work.I am forever indebted to Mr. V.S. Raghunathan, Sr. Technical Director (NationalInformatics Center, Tamil Nadu) for giving me a chance to work under him andenlightening me with his valuable counsel and advice through my term at NIC,for allotting me the project of my choice and for appointing me at the right placeand under the best superiors.I thank my Program Chair Dr. Pattabiraman V., School of Computing Scienceand Engineering and Dean Dr. Jeganathan L., School of Computing Science andEngineering for always guiding me on the right path and helping overcome all thebarriers in my path to success. My sincere gratitude to our project coordinatorDr. Nithyanandam P.,Professor,School of Computing Science and Engineeringfor managing out project process in the best possible way.I also thank all other faculties at VIT University who have helped to make me abetter professional and for guiding me in every way, especially Dr. Geetha S. forher counsel and motherly love and affection whenever it was needed by me.I would also like to thank Mr. Dinesh Vasan,Senior Developer NIC for alwayshelping me with my errors and counseling me whenever I was stuck and for pro-viding guidance whenever required.Finally, I would like to thank everyone who has helped me directly or indirectlyto complete this project

Kayewan Mehernosh KaranjiaReg. No. 14MCA1012

School of Computing Science and Engineering, VIT University, Chennai

Page 6: NIC Project Final Report

Monitoring and Surveillance using Near Field Technologies for the Gov. of India v

Contents

Declaration i

Certificate ii

Abstract iii

Acknowledgement iv

1 Introduction 11.1 Background . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21.2 Statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21.3 Motivation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31.4 Challenges and Difficulty in the problem solving . . . . . . . . . 31.5 Aim(s) and Objective(s) . . . . . . . . . . . . . . . . . . . . . . . 31.6 Proposed System . . . . . . . . . . . . . . . . . . . . . . . . . . 3

2 Overview / Literature Review 52.1 MPS (Mobility Platform services) . . . . . . . . . . . . . . . . . 52.2 Dashboard Platform Services . . . . . . . . . . . . . . . . . . . 62.3 Libelium . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62.4 Restful Web-Services . . . . . . . . . . . . . . . . . . . . . . . . 72.5 NFC with Cordova . . . . . . . . . . . . . . . . . . . . . . . . . 72.6 Time Line Chart . . . . . . . . . . . . . . . . . . . . . . . . . . . 8

3 System Design 93.1 Hardware Requirements . . . . . . . . . . . . . . . . . . . . . . 93.2 Software Requirements . . . . . . . . . . . . . . . . . . . . . . . 93.3 Feasibility Study . . . . . . . . . . . . . . . . . . . . . . . . . . 10

School of Computing Science and Engineering, VIT University, Chennai

Page 7: NIC Project Final Report

Monitoring and Surveillance using Near Field Technologies for the Gov. of India vi

3.4 System Architecture . . . . . . . . . . . . . . . . . . . . . . . . 103.5 Services to be developed and offered . . . . . . . . . . . . . . . 113.6 Functional Requirements . . . . . . . . . . . . . . . . . . . . . . 113.7 Non-Functional Requirements . . . . . . . . . . . . . . . . . . . 113.8 Data Flow Daigram . . . . . . . . . . . . . . . . . . . . . . . . . 123.9 Technologies Used . . . . . . . . . . . . . . . . . . . . . . . . . 21

3.9.1 D3js Chart library . . . . . . . . . . . . . . . . . . . . . 213.9.2 Apache Cordova (PhoneGap) . . . . . . . . . . . . . . . 213.9.3 Google Maps . . . . . . . . . . . . . . . . . . . . . . . . 223.9.4 Leaflet . . . . . . . . . . . . . . . . . . . . . . . . . . . 223.9.5 PostgreSQL . . . . . . . . . . . . . . . . . . . . . . . . . 22

3.10 Modular Description . . . . . . . . . . . . . . . . . . . . . . . . 233.10.1 Authorization and Access Control . . . . . . . . . . . . . 233.10.2 Chart Rendering Module . . . . . . . . . . . . . . . . . . 243.10.3 Map Rendering Module . . . . . . . . . . . . . . . . . . 253.10.4 NFC MODULE . . . . . . . . . . . . . . . . . . . . . . . 27

4 Implementation of System/ Methodology 324.1 Flow chart . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 324.2 Data Dictionary . . . . . . . . . . . . . . . . . . . . . . . . . . . 334.3 The Software Process Model . . . . . . . . . . . . . . . . . . . . 354.4 Testing Techniques Used . . . . . . . . . . . . . . . . . . . . . . 36

4.4.1 White Box Testing: . . . . . . . . . . . . . . . . . . . . . 364.4.2 Black Box Testing . . . . . . . . . . . . . . . . . . . . . 364.4.3 Compatibility Testing . . . . . . . . . . . . . . . . . . . . 374.4.4 Functional Testing . . . . . . . . . . . . . . . . . . . . . 374.4.5 System Testing . . . . . . . . . . . . . . . . . . . . . . . 374.4.6 Junit Test Case . . . . . . . . . . . . . . . . . . . . . . . 38

5 Results and Discussions 39

6 Conclusion and Future Work 41

Appendices 42(A) Screenshots . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42(B) Sample Coding . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51

Bibliography 53

School of Computing Science and Engineering, VIT University, Chennai

Page 8: NIC Project Final Report

Monitoring and Surveillance using Near Field Technologies for the Gov. of India vii

List of Figures

2.1 Time line chart . . . . . . . . . . . . . . . . . . . . . . . . . . . 8

3.1 System Architecture . . . . . . . . . . . . . . . . . . . . . . . . . 103.2 DFD Level 0 . . . . . . . . . . . . . . . . . . . . . . . . . . . . 123.3 DFD Level 1.1 . . . . . . . . . . . . . . . . . . . . . . . . . . . 133.4 DFD Level 1.2 . . . . . . . . . . . . . . . . . . . . . . . . . . . 133.5 DFD Level 2.1 . . . . . . . . . . . . . . . . . . . . . . . . . . . 143.6 DFD Level 2.2 . . . . . . . . . . . . . . . . . . . . . . . . . . . 143.7 DFD Level 3.1 . . . . . . . . . . . . . . . . . . . . . . . . . . . 153.8 DFD Level 3.2 . . . . . . . . . . . . . . . . . . . . . . . . . . . 153.9 DFD Level 4.1 . . . . . . . . . . . . . . . . . . . . . . . . . . . 163.10 DFD Level 4.2 . . . . . . . . . . . . . . . . . . . . . . . . . . . 163.11 DFD Level 5.1 . . . . . . . . . . . . . . . . . . . . . . . . . . . 173.12 DFD Level 8.1 . . . . . . . . . . . . . . . . . . . . . . . . . . . 173.13 DFD Level 9.1 . . . . . . . . . . . . . . . . . . . . . . . . . . . 183.14 DFD Level 9.2 . . . . . . . . . . . . . . . . . . . . . . . . . . . 183.15 DFD Level 10.1 . . . . . . . . . . . . . . . . . . . . . . . . . . . 193.16 DFD Level 10.2 . . . . . . . . . . . . . . . . . . . . . . . . . . . 193.17 DFD Level 11.1 . . . . . . . . . . . . . . . . . . . . . . . . . . . 203.18 DFD Level 11.2 . . . . . . . . . . . . . . . . . . . . . . . . . . . 203.19 DFD Level 12.1 . . . . . . . . . . . . . . . . . . . . . . . . . . . 213.20 5 factor authorization . . . . . . . . . . . . . . . . . . . . . . . . 233.21 Map Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 263.22 NFC Action . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 283.23 The Structure of an NDEF message . . . . . . . . . . . . . . . . 293.24 NDEF message structure with header bytes . . . . . . . . . . . . 30

4.1 Flow Chart . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32

School of Computing Science and Engineering, VIT University, Chennai

Page 9: NIC Project Final Report

Monitoring and Surveillance using Near Field Technologies for the Gov. of India viii

4.2 Map Master . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 334.3 Task Master . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 334.4 Task Completed . . . . . . . . . . . . . . . . . . . . . . . . . . . 344.5 User Master . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 344.6 Incremental Process Model . . . . . . . . . . . . . . . . . . . . . 354.7 Test Case . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38

6.1 Splash Screen . . . . . . . . . . . . . . . . . . . . . . . . . . . . 426.2 NFC Authentication . . . . . . . . . . . . . . . . . . . . . . . . . 436.3 Menu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 446.4 Pending Task . . . . . . . . . . . . . . . . . . . . . . . . . . . . 456.5 Pending Task 2 . . . . . . . . . . . . . . . . . . . . . . . . . . . 466.6 Missed Task . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 476.7 History . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 486.8 D3 Bar Chart . . . . . . . . . . . . . . . . . . . . . . . . . . . . 496.9 D3 Pie Chart . . . . . . . . . . . . . . . . . . . . . . . . . . . . 496.10 Map with markers . . . . . . . . . . . . . . . . . . . . . . . . . . 506.11 Map with info-window . . . . . . . . . . . . . . . . . . . . . . . 50

School of Computing Science and Engineering, VIT University, Chennai

Page 10: NIC Project Final Report

Monitoring and Surveillance using Near Field Technologies for the Gov. of India 1

Chapter 1

Introduction

This project is focused on providing enhanced services to an existing platformcalled Mobility Platform Services (M.P.S.) developed by the National InformaticsCenter, Tamil Nadu.

Mobility Platform Services (MPS) is an open, comprehensive and advancedmobile application platform for smart phones and tablets, helping Government or-ganizations of all sizes to efficiently customize the requirements, emulate and de-ploy on multiple platforms. MPS is a service that the Application Service Provider(ASP) can use to perform various activities of mobile application developmentfrom registering of the mobile app, requirement customization, registering webservices to fetch data from multiple domains and deliver the mobile app on mul-tiple platforms. The mobile apps that are offered from MPS are of two categoriesnamely, Public Information Client providing information to citizen and Work fromAnywhere Client for Govt. officials to carry out their field work, data collection,on site approvals and monitoring.

’A little progress everyday adds up to big results’

Keeping the above moto in my heart I started my journey as an intern at the Na-tional Informatics Center. After lots of research and thinking I took up the projectof enhancing one of the best projects developed by NIC, MPS. The initial weekswere spent on understanding the complex processes and the system of NIC andfiguring out what services could be developed as to make the system better andmake it capable to help various departments and personals of the Government ofIndia to develop mobile and desktop applications through this wonderful platform.To make the platform better and to make it state of the art the key was to adopt the

School of Computing Science and Engineering, VIT University, Chennai

Page 11: NIC Project Final Report

Monitoring and Surveillance using Near Field Technologies for the Gov. of India 2

latest concepts from the real world and make the platform capable of producingapplications in the most minimal time and ones which can solve real life problems.

New features like Maps, Automatic authentication, Authorization, Surveil-lance and monitoring, using Near Field Communication Technologies, Real TimeCharts, Crowd Sourcing, etc. were proposed and developed during the course ofthe project.

Each feature in this project will be uses multiple technologies. PostgreSQldatabase which is the best open source database is being used to maintain theback-end of the system. The payload of data is always in XML format to providere usability and maintain open standards. The maps are rendered using the GoogleMaps Api and Leaflet Node which are the most widely used maps. The chartswhich are being rendered are Real Time Charts which are the latest innovationin visualization and use d3.js API to provide the best open source features forcharts. The major part of this project is based on exploiting the Near Field (N.F.C)Technologies. The applications are developed in Cordova to implement the phonegap feature and provide platform independence.

1.1 BackgroundThe existing system is a platform named the Mobility Platform Services (M.P.S)which is developed and is being used by the Indian Government for develop-ing applications to solve real time problems for the different departments of theIndian Government. The application had basic feature to support application de-velopment along with modules to interactively design the applications. The ap-plications which were produced as outputs by the platform can be used on anyplatforms like Android, IOS, Windows, etc. as they were developed using thephone gap features.

1.2 StatementThe task I was assigned was to Annalise and study the MPS platform and suggestsome ways to make it better. I was briefed by expert developers and programmersfor a couple of days on how the platform worked and how it was built. Extraresearch was done to understand and get hands on what technologies were used todevelop the system.

School of Computing Science and Engineering, VIT University, Chennai

Page 12: NIC Project Final Report

Monitoring and Surveillance using Near Field Technologies for the Gov. of India 3

1.3 MotivationThe expectation with me being the young blood in the team was to bring in in-novativeness and make the platform rich with the latest technologies and featuresused in the market. A good amount of time was spent to study the latest technolo-gies and to find ways to integrate them to a already well built and well plannedsystem

1.4 Challenges and Difficulty in the problem solvingi) Since these features were of the latest and upcoming trends and were born outof innovativeness, there was no way to find a similar existing system available forreferenceii) Some of the technologies used were implemented just a few months back toproper documentation and tutorials were not availableiii) As so many different technologies were used in one feature itself it was diffi-cult to convert our data and contents to different formats acceptable by each of thetechnologies.iv) Use of specialized hardware like NFC cards and devices, geo tags , Bluetoothtags, etc was crucial had to be performed with proper caution.v) Integration of all the different features and services.

1.5 Aim(s) and Objective(s)The aim is to develop services for the MPS platform in a way that those servicesadd to making the product better to use and develop applications.Any service orfeature which may add to the betterment of the Indian Government and makes lifeeasy for the citizens of the country and the government servants is relevant to bedeveloped and included in the project.The services are an application to performby itself and they may or may not be related to each other.

1.6 Proposed SystemThe main purpose of the project is to integrate multiple features and services inaddition to the existing ones to enhance the platform with rich features.A list of

School of Computing Science and Engineering, VIT University, Chennai

Page 13: NIC Project Final Report

Monitoring and Surveillance using Near Field Technologies for the Gov. of India 4

latest real time features was summarized. A proposal to add new features like NearField Communications, Interactive and informative maps Tracking and Monitor-ing activities, Real Time Charts (RTC), 5 Factor Authentication, etc were pro-posed.These features could provide multiple services that could be added to theMPS platform and then the users of the MPS platform could use it to make ap-plications with these features included in them.Now to exhibit the functionalityand working of these features it was appropriate to present a Proof of Concept(P.O.C.). The POC which I intended to develop was a beat monitoring systemwhich will be produced as an output from the MPS Platform and will be capableof providing all the new services and features which were added. The Beat Mon-itoring System help the Police Authorities to mange and monitor the beat or theparole process which is done every night and keep a check that the job assignedto the employees is completed properly and with authenticity

School of Computing Science and Engineering, VIT University, Chennai

Page 14: NIC Project Final Report

Monitoring and Surveillance using Near Field Technologies for the Gov. of India 5

Chapter 2

Overview / Literature Review

2.1 MPS (Mobility Platform services)Mobility Platform Services (MPS) is an open, comprehensive and advanced mo-bile application platform for smart phones and tablets, helping Government orga-nizations of all sizes to efficiently customize the requirements, emulate and deployon multiple platforms. MPS is a service that the Application Service Provider(ASP) can use to perform various activities of mobile application developmentfrom registering of the mobile app, requirement customization, registering webservices to fetch data from multiple domains and deliver the mobile app on mul-tiple platforms. The mobile apps that are offered from MPS are of two categoriesnamely, Public Information Client providing information to citizen and Work fromAnywhere Client for Govt. officials to carry out their field work, data collection,on site approvals and monitoring.

Innovations in MPS

a) SDLC is eliminated.b) Requirement Analysis Prototype phase is live after every design change asSMS, email.c) Iterative Design, feedback/review and the Requirement Freezing.d) Alerts can be sent to all stakeholders for concurrence.e) The mobile app is launched as soon as the required domain web service is pro-vided by ASP.f) The architecture is loosely coupled.

School of Computing Science and Engineering, VIT University, Chennai

Page 15: NIC Project Final Report

Monitoring and Surveillance using Near Field Technologies for the Gov. of India 6

g) Pay load between layers is encrypted XML data.h) Restful web services are Secured Socket Layer for External application inte-gration.

2.2 Dashboard Platform ServicesThe Dashboard Platform Services is an easy to use Platform service, where theuser can easily configure their requirements with readily available themes, vari-ety of charts and layouts to deliver the desired dashboard. The Dashboard is areal-time user interface showing a graphical presentation of the user informationas charts and data. User will be able to configure one or more charts using one ofthe preferred layouts.

Features of the Dashboard are:

a) Design and development of dashboard is eliminated from SDLCb) Loosely Coupled Architecture with 3 layers such as Application Layer, WebServices Layer and Data Layerc) Personalization is fully supported. Multiple themes, logo, background designsare available for various requirements under DPSd) Statistical Analysis on the usage, pattern, location and device are available un-der DPSe) Immediate emulator review after Customization with preview over email andSMS

2.3 LibeliumLibelium designs and manufactures hardware and a complete software develop-ment kit (SDK) for wireless sensor networks so that system integrators, engi-neering, and consultancy companies can deliver reliable Internet of Things (IoT),M2M, and Smart Cities solutions with minimum time to market. Our versatileplatform allows implementation of any Wireless Sensor Network, from SmartParking to Smart Irrigation solutions.

School of Computing Science and Engineering, VIT University, Chennai

Page 16: NIC Project Final Report

Monitoring and Surveillance using Near Field Technologies for the Gov. of India 7

2.4 Restful Web-Services1. This book was very helpful to me to figure out a new way to access and transportdata payload across various different platforms.2. Restful web-services play a very important role in this system and are used inalmost every module of the system.3. The use of these Restful web services is used to get data from the database andthen transport it to the cream layer like Android, HTML, Cordova, etc.

2.5 NFC with CordovaThis plugin is used to add the NFC feature in cordova and use it to develop theapplication. This pluging is supported with any Cordova version above the 3.0versionThis plugin is used to add the following features :-a) Read data from NFC tagsb) Write data to NFC tagsc) Send data to other NFC enabled devicesd) Receive data from NFC devices

School of Computing Science and Engineering, VIT University, Chennai

Page 17: NIC Project Final Report

Monitoring and Surveillance using Near Field Technologies for the Gov. of India 8

2.6 Time Line Chart

Figure 2.1: Time line chart

School of Computing Science and Engineering, VIT University, Chennai

Page 18: NIC Project Final Report

Monitoring and Surveillance using Near Field Technologies for the Gov. of India 9

Chapter 3

System Design

3.1 Hardware Requirementsa) A Decent Computer system with standard configuration.b) Arduino Micro Controllerc) NFC Tagsd) Geo Tagse) Bluetooth Tagsf) R F Tagsg) Mobile Devices

3.2 Software Requirementsa) Web servicesb) Android SDK.c) Google Maps Apid) Eclipsee) Ajaxf) XML Supportg) JAVAh) Arduino SDKi) Leaflet Maps

School of Computing Science and Engineering, VIT University, Chennai

Page 19: NIC Project Final Report

Monitoring and Surveillance using Near Field Technologies for the Gov. of India 10

3.3 Feasibility StudyThis service will improve monitoring and authentication of multiple entities whichgovernment need to monitor. Those entities should be NFC enabled, these entitiesshould also transmit the lat long from the GPS system and it can be further used ingovernment services. For proper authentication we will use a NFC authenticationwhich will be NFC cards. Once the authentication is done using NFC, Geographictags should be enable in the device used by the entity, device will transmit the datawhich is basically the lat long, time stamp and NFC tag ID which would be takenfrom the system and will be stored at the server and then continuous tracking canbe done.

3.4 System Architecture

Figure 3.1: System Architecture

School of Computing Science and Engineering, VIT University, Chennai

Page 20: NIC Project Final Report

Monitoring and Surveillance using Near Field Technologies for the Gov. of India 11

3.5 Services to be developed and offeredThe Following services will be developed and offered by me to make the mobilityplatform service better and more feature rich :-

a) NFC features like read NFC data, Write NFC data on cards and other NFCsensors, Read/Write encrypted datab) The map feature where we can display maps with multiple locations and mul-tiple group classified markers with info window with each of them.c) Real Time Charts which are the latest innovation in visualization concepts willbe used to display analytical and statistical data.d) Front and Styles editing system which will help developers and users edit thelook and feel of their systems in a easy and interactive way.e) Auto WI-Fi authentication using NFC Cards.f) Authorization and access controlg) Meeting ambianceh) Tracking and Monitoring

3.6 Functional Requirementsa. The user identification credentials like username password pair, nfc card, mo-bile IMEI no, etc. whatever would fit into the standards of our 5 Factor Authenti-cation feature.b. The task details for which are user specific and are available on a daily basis.c. The locations of the entities involved in every tasks and meta data about themd. The details of all the entities with their NFC card numbers, credentials, etc.e. Weekly statistics of analysis made on events and processes.f. Internet Connection.g. NFC enabled mobile or device.

3.7 Non-Functional Requirementsa. Additional Details of in a task like description, image, etc.b. Annotations for multiple chartsc. Additional Info Window details like temperature, town name, population, etc.d. Drilled Down Charts

School of Computing Science and Engineering, VIT University, Chennai

Page 21: NIC Project Final Report

Monitoring and Surveillance using Near Field Technologies for the Gov. of India 12

3.8 Data Flow Daigram—

Figure 3.2: DFD Level 0

School of Computing Science and Engineering, VIT University, Chennai

Page 22: NIC Project Final Report

Monitoring and Surveillance using Near Field Technologies for the Gov. of India 13

Figure 3.3: DFD Level 1.1

Figure 3.4: DFD Level 1.2

School of Computing Science and Engineering, VIT University, Chennai

Page 23: NIC Project Final Report

Monitoring and Surveillance using Near Field Technologies for the Gov. of India 14

Figure 3.5: DFD Level 2.1

Figure 3.6: DFD Level 2.2

School of Computing Science and Engineering, VIT University, Chennai

Page 24: NIC Project Final Report

Monitoring and Surveillance using Near Field Technologies for the Gov. of India 15

Figure 3.7: DFD Level 3.1

Figure 3.8: DFD Level 3.2

School of Computing Science and Engineering, VIT University, Chennai

Page 25: NIC Project Final Report

Monitoring and Surveillance using Near Field Technologies for the Gov. of India 16

Figure 3.9: DFD Level 4.1

Figure 3.10: DFD Level 4.2

School of Computing Science and Engineering, VIT University, Chennai

Page 26: NIC Project Final Report

Monitoring and Surveillance using Near Field Technologies for the Gov. of India 17

Figure 3.11: DFD Level 5.1

Figure 3.12: DFD Level 8.1

School of Computing Science and Engineering, VIT University, Chennai

Page 27: NIC Project Final Report

Monitoring and Surveillance using Near Field Technologies for the Gov. of India 18

Figure 3.13: DFD Level 9.1

Figure 3.14: DFD Level 9.2

School of Computing Science and Engineering, VIT University, Chennai

Page 28: NIC Project Final Report

Monitoring and Surveillance using Near Field Technologies for the Gov. of India 19

Figure 3.15: DFD Level 10.1

Figure 3.16: DFD Level 10.2

School of Computing Science and Engineering, VIT University, Chennai

Page 29: NIC Project Final Report

Monitoring and Surveillance using Near Field Technologies for the Gov. of India 20

Figure 3.17: DFD Level 11.1

Figure 3.18: DFD Level 11.2

School of Computing Science and Engineering, VIT University, Chennai

Page 30: NIC Project Final Report

Monitoring and Surveillance using Near Field Technologies for the Gov. of India 21

Figure 3.19: DFD Level 12.1

3.9 Technologies Used

3.9.1 D3js Chart libraryD3js is a JS library for charts based on data. D3 helps you bring data to lifeusing HTML, SVG, and CSS. D3 have web standards gives the full capabilities ofmodern browsers, combining powerful and then apply data-driven transformationsto the document. For example, you can use D3 to generate an HTML table froman array of numbers. Or, use the same data to create an interactive SVG bar chartwith smooth transitions and interaction.

3.9.2 Apache Cordova (PhoneGap)Apache Cordova is an open-source mobile development framework. It uses stan-dard web technologies such as HTML5, CSS3, and JavaScript for cross-platformdevelopment, for neglecting each mobile platforms’ native mobile application de-velopment. Apache Cordova is a platform for building cross-platform mobileapplications using HTML, CSS and JavaScript. It is an HTML5 app platform thatallows you to author native applications with web technologies and get access toAPIs and app stores. Over time, the Apache Cordova distribution may contain

School of Computing Science and Engineering, VIT University, Chennai

Page 31: NIC Project Final Report

Monitoring and Surveillance using Near Field Technologies for the Gov. of India 22

additional tools that tie into other Adobe services, which would not be appropri-ate for an Apache project. As a developer building Apache Cordova applications,nothing has changed. It is still free, openly licensed, and the main focus of theApache Cordova team. If your goal is to build cross platform apps with HTML,JS and CSS then keep on using Apache Cordova for everything you need

3.9.3 Google MapsGoogle Maps Are Web-based service that provides information about geographi-cal regions. In addition to conventional road maps, Google Maps offers satelliteviews of many places. In some cities, Google Maps offers street views.

Google Maps also offers the following services:1.We can plan our routes with Google map, whether it for car, bus or for yourwalk. Route planning is the coolest feature of Google maps2.The Google Maps API allows web site to embed Google maps into their website.3.Google Maps also offers location service for Mobile which can be enabled usingGPS into your mobile device. It can work online as well as offline.4.Google map also provide street maps for the travelers around the globe.5.Google launched the Google Maps API in June 2005 to allow developers tointegrate Google Maps into their websites.

3.9.4 LeafletLeaflet Js is one of the best open-source library for interactive, responsive andportable device friendly maps using JavaScript. It is light weight, almost about33 KB and it has all the mapping features most developers ever need. Leaflet isdesigned with simplicity, performance and usability in mind. It works efficientlyacross all major desktop and mobile platforms, can be extended with lots of plu-gin, has a beautiful, easy to use and well-documented API and a simple, readablesource code that is a joy to contribute to.

3.9.5 PostgreSQLPostgreSQL is a general purpose and object-relational database management sys-tem, the most advanced open source database system. PostgreSQL requires veryminimum maintained efforts because of its stability. Therefore, if you develop ap-plications based on PostgreSQL, the total cost of ownership is low in comparisonwith other database management systems. PostgreSQL can store any type of data

School of Computing Science and Engineering, VIT University, Chennai

Page 32: NIC Project Final Report

Monitoring and Surveillance using Near Field Technologies for the Gov. of India 23

that you want you have in your database. We can store and retrieve informationby the use of SQL statements. In technical terms, it has the following features:

3.10 Modular Description

3.10.1 Authorization and Access ControlThis module is used to authenticate different users who will be accessing the ap-plication internally and also who will use the application as an authentication andauthorization mechanism. There will be a 5 Factor Authentication provided bythis feature. In this feature we can authenticate using a normal username pass-word pair, then along with NFC cards, then with NFC Card and specific IMEInumber and also with specialized digital signature. No other platform providesthis level of sophistication when it comes to authorization. This feature can alsobe used for access control where the user can grand access to a service or locationremotely.

Figure 3.20: 5 factor authorization

School of Computing Science and Engineering, VIT University, Chennai

Page 33: NIC Project Final Report

Monitoring and Surveillance using Near Field Technologies for the Gov. of India 24

3.10.2 Chart Rendering ModuleThis module deals with rendering Real Time Charts. The d3 js library which is thebest open source option for visualizing data and statistics. All the analysis of thesystem can be visualized using these charts and also these charts can be used andintegrated by any user in their applications. The data to be displayed is fetchedfrom the database. We are using the PostgreSQL in our implementation. The datais fetched using a Java Restful Web service. The web service fetches the data fromthe database and returns a HTTP RESPONSE in the form of an XML String. ThisXML String is then abstracted in the form of JSON variables using a AJAX call.The JSON variables are then passed to the D3js and they are used to render thechart on a HTML page

Sub Modules:i. Databaseii. Web-serviceiii. Ajax Calliv. Chart Render with D3js library

The Steps to Success:

1. Identifying what our analysis will do2. Fetching the data and storing it in PostgreSQL3. Creating a Web service to get data from PostgreSQL and host it as an chart, itcan be any chart present in the D3 library.4. Building our fronted using D3.js and some good old javascript.5. Analysis of data from Government database, which data we can use for ourapplication.6. Fetch the dataset and try to create an informative analysis on the basis of thedata attributes.7. After storing the dataset into the PostgreSQL a web Service has to be createdwhich can fetch that data from the database.8. These web service will render an XML which will contain the data from thedatabase

School of Computing Science and Engineering, VIT University, Chennai

Page 34: NIC Project Final Report

Monitoring and Surveillance using Near Field Technologies for the Gov. of India 25

3.10.3 Map Rendering Module1. The map feature will be available in two flavors viz. in Google Maps andLeaflet Maps2. Both the Maps will give full functionalities of maps but only difference in themis the Google api is not open source while the Leaflet API is open source.3. The leaflet module map is a feature developed for the Mobility Platform Ser-vice at the National Informatics Center, Tamil Nadu.4. This modules main functionality is to display responsive maps with multiplelocation and basic information about them.5. The data to be displayed is fetched from the database. We are using the Post-greSQL in our implementation.6. The data is fetched using a Java Restful Web service7. The web service fetches the data from the database and returns a HTTP RE-SPONSE in the form of an XML String.8. This XML String is then abstracted in the form of JSON variables using aAJAX call.9. The JSON variables are then passed to the Leaflet API and they are used torender the map on a HTML page10. as an authentication and authorization mechanism.11. There will be a 5 Factor Authentication provided by this feature.

Sub Modules:

i. Databaseii. Web-serviceiii. Ajax Calliv. Map Render with leaflet API

1. Database Module1. The database is developed in the PostgreSQL2. The data consist of the geographic locations, group details, marker details,group details, descriptions, images, etc3. The data is stored in a standard SQL format.

School of Computing Science and Engineering, VIT University, Chennai

Page 35: NIC Project Final Report

Monitoring and Surveillance using Near Field Technologies for the Gov. of India 26

Figure 3.21: Map Data

2. Web ServiceI. The web-service is developed is RESTFUL Java Web-Service.II. The web-service fetches the data from the database and returns a HTTP RE-SPONSE in the form of an XML String.III. This XML String is then abstracted in the form of JSON variables using aAJAX call.

3. AjAX CAllThe Ajax call runs on the client side.Its task is to call the web-service, catch theHTTP Response and then convert the XML data into JSON Objects.These JSONObjects can then be abstracted by the Leaflet API.

4. Map Render with leaflet ApiThe Leaflet API focuses on rendering one or more marker on different locationson the map. Along with this it has to manage the markers (i.e. pins) on themap and customize their appearance based on their groups.Markers with differentgroups are shown in different colors depending on their groups. These colors canbe edited and customized using the editor in the MPS user interface. The userscan also use customized icons instead of solid colors using the MPS user interface.Along with that there has to be an info window which pops up when a marker isclicked.The info window consists of the basic description, images and name value

School of Computing Science and Engineering, VIT University, Chennai

Page 36: NIC Project Final Report

Monitoring and Surveillance using Near Field Technologies for the Gov. of India 27

pairs about that specific location entity.The info window has the title of the itemon the top left hand side title bar.Then comes the description of the item which isleft justified and the image if provided is showed right justified.Then comes vari-ous name value pairs like temperature, town name, nearest village name, etc.

3.10.4 NFC MODULE1. The NFC module is the main feature of the system .2. It gives the system a cutting edge feature.3. Near field technologies will be used for authentication, tracking, monitoringand various other features like auto WI-fi, meeting ambiance, etc.4.NFC is the key feature to all the other features in this system.

Features to be enabled using NFC

a) Read tag idb) Read contentc) Write contentd) Read encrypted contente) Write encrypted contentf) Make read only (lock)

Actions and events to be triggered using NFCa) Show alert on the device and/or Record alert on the server

b) Authorization (Registration on the device and/or on the server)c) Auto WI-fi (Device, Identity, Password)d) Meeting ambiance(Vibration mode, volume mute, register attendance, Get Agenda,Get docs)e) Access Control (Authorize and Trigger)f) Tracking (Geo tag, Frequency, server update )g) Show alert on the device and/or Record alert on the serverh) Authorization (Registration on the device and/or on the server)i) Auto WI-fi (Device, Identity, Password)j) Meeting ambiance(Vibration mode, volume mute, register attendance, Get Agenda,Get docs)k) Access Control (Authorize and Trigger)

School of Computing Science and Engineering, VIT University, Chennai

Page 37: NIC Project Final Report

Monitoring and Surveillance using Near Field Technologies for the Gov. of India 28

l) Tracking (Geo tag, Frequency, server update )m) Open external application on the device:Music app,camera app,alarm, reminder, navigation, website, car mode, phonedial(call),run a secret coden) Open external application on the server:Calling a web service,a website,backup,trigger dashboard to monitor servers andservices,remote authorization or permission

NFC Actions(Alerts)

Figure 3.22: NFC Action

School of Computing Science and Engineering, VIT University, Chennai

Page 38: NIC Project Final Report

Monitoring and Surveillance using Near Field Technologies for the Gov. of India 29

NDEF Structure

NDEF is a binary format structured in messages, each of which can contain sev-eral records. Each record is made up of a header, which contains metadata aboutthe record, such as the record type, length, and so forth, and the payload, whichcontains the content of the message. Think of an NDEF message like a paragraph,and records like the sentences within it. A well-formed paragraph is made up ofsentences pertaining to one topic. Similarly, its good practice to use one NDEFmessage made up of several records to describe one subject, say, an address bookentry.

NFC transactions are generally short. Each exchange generally consists ofonly one message, and each tag carries just one message. Keep in mind the phys-ical circumstances of an NFC exchange: you tap your device to another device ortag, and the whole exchange happens while youre in contact with the other deviceor tag. You dont want to send a whole novel in a single exchange, so think of yourNDEF messages as paragraph-length, not book-length. Youll see a workaround tothis for sending large files in one of the final chapters of this book, but for now,consider one NFC exchange as one NDEF message, and think of one NDEF mes-sage as one or more short records.

Figure 3.23: The Structure of an NDEF message

An NDEF record contains a payload of data and metadata describing how tointerpret the payload. Each records payload can be one of several different datatypes. The header for each record contains metadata describing the record andits place in the message, followed by its type and ID. After the header comes thepayload.

School of Computing Science and Engineering, VIT University, Chennai

Page 39: NIC Project Final Report

Monitoring and Surveillance using Near Field Technologies for the Gov. of India 30

Figure 3.24: NDEF message structure with header bytes

A NDEF record consists of a type name format (TNF), payload type, payloadidentifier, and the payload. The payload is the most important part of an NDEFrecord; its the content that youre transmitting. The TNF tells you how to interpretthe payload type. The payload type is an NFC-specific type, MIME media-type,or URI that tells you how to interpret the payload. Another way to think aboutthis is that the TNF is the metadata about the payload type, and the payload typeis the metadata about the payload. The payload identifier is optional and allowsmultiple payloads to be associated or cross referenced.

5.Pending Tasks

All the tasks which are updated by the admin are to be populated in a select boxfrom where the user can select a particular task. The tasks are displayed and up-dated on a daily basis where the admin will update multiple tasks for multipleusers and depending on the users login and authentication credentials he will bedisplayed the task assigned for him on a daily basis. Once the user selects thetask he will be shown a map where he will be shown a map with the details of thelocation where he as to visit and get the NFC tapped from the entity of concern.If the user is within 500 meters of the location of the location given by the Adminthe input feature in his device or phone whichever he is using will be activated andhe can then use the device to input data regarding the beat process. Once the inputfeature is activated he can then go the personal or entity and get his NFC card orNFC signature from a device and then if he wants he can add additional detailsand descriptions to the report and submit the report. Once he submits a reports anupdate on the server is done with an accurate timestamp There is no specific orderin which the user has to follow to finish or complete the tasks which are assignedto him by the Admin. All the task assigned by the Admin will be shown only forthe specific user and will be shown only for 24 hours. The user can not try tocomplete the tasks nor will he be displayed any tasks after the completion of 24

School of Computing Science and Engineering, VIT University, Chennai

Page 40: NIC Project Final Report

Monitoring and Surveillance using Near Field Technologies for the Gov. of India 31

hours.

6. Missed Tasks

In this module all the task which were assigned to user if they are not completedduring the course of twenty four hours form the time of assignment then thosetasks are shown here. The missed tasks shown are shown date wise and the usercan see all his missed tasks for the past month. The user can select a date from thedata time picker and all his missed tasks for the day will be shown there. He canalso select individual tasks to see the tasks in detail

7. History

It is the combination of the above two menus. In this module all the task whichwere assigned to user if they are not completed during the course of twenty fourhours form the time of assignment then those tasks are shown here and also thetasks completed will be shown. The missed tasks shown are shown date wise andthe user can see all his missed tasks for the past month. The user can select a datefrom the data time picker and all his missed tasks for the day will be shown there.He can also select individual tasks to see the tasks in detail8. Weekly Annalysis

Here analysis is performed on all the different events. This analysis once per-formed is visualized using Real Time Charts. Real time charts are using the d3jslibrary to visualize charts in the latest features of the real time market. Thesecharts show analysis which are done on a weekly basis

School of Computing Science and Engineering, VIT University, Chennai

Page 41: NIC Project Final Report

Monitoring and Surveillance using Near Field Technologies for the Gov. of India 32

Chapter 4

Implementation of System/Methodology

4.1 Flow chart

Figure 4.1: Flow Chart

School of Computing Science and Engineering, VIT University, Chennai

Page 42: NIC Project Final Report

Monitoring and Surveillance using Near Field Technologies for the Gov. of India 33

4.2 Data Dictionary

Figure 4.2: Map Master

Figure 4.3: Task Master

School of Computing Science and Engineering, VIT University, Chennai

Page 43: NIC Project Final Report

Monitoring and Surveillance using Near Field Technologies for the Gov. of India 34

Figure 4.4: Task Completed

Figure 4.5: User Master

School of Computing Science and Engineering, VIT University, Chennai

Page 44: NIC Project Final Report

Monitoring and Surveillance using Near Field Technologies for the Gov. of India 35

4.3 The Software Process ModelThe software process model adopted is the incremental model. The incrementalmodel is the combines the features of both the linear iterative approaches of proto-type model as well as the sequential model both combined together. Small incre-ments of software are developed and then delivered and then on each incrementthe linear sequential model is applied. On each process flow of each incrementprototyping is applied. The first increment that is delivered is considered as thecore product. The final needs of the product are addressed by the core product.The client evaluates and reviews every increment. Based on client feedback forthe core product developers prepare a plan for the next increment. At times, itis even used on a test basis. New features and functionality are also taken intoconsideration. The above process is applied to each increment that is delivered.

Figure 4.6: Incremental Process Model

School of Computing Science and Engineering, VIT University, Chennai

Page 45: NIC Project Final Report

Monitoring and Surveillance using Near Field Technologies for the Gov. of India 36

4.4 Testing Techniques Used

4.4.1 White Box Testing:White box testing is a security testing method that can be used to validate whethercode implementation follows intended design, to validate implemented securityfunctionality, and to uncover exploitable vulnerabilities. White box testing re-quires access to the source code. Though white box testing can be performed anytime in the life cycle after the code is developed, it is a good practice to performwhite box testing during the unit testing phase. White box testing requires know-ing what makes software secure or insecure, how to think like an attacker, andhow to use different testing tools and techniques. The first step in white box test-ing is to comprehend and analyse source code, so knowing what makes softwaresecure is a fundamental requirement. Second, to create tests that exploit software,a tester must think like an attacker. Third, to perform testing effectively, testersneed to know the different tools and techniques available for white box testing.

4.4.2 Black Box TestingBlack box testing takes an external perspective of the test object to derive testcases. These tests can be functional or non-functional, though usually functional.The test designer selects valid and invalid input and determines the correct output.There is no knowledge of the test object’s internal structure. Black box testingshould make use of randomly generated inputs (only a test range should be spec-ified by the tester), to eliminate any guess work by the tester as to the methodsof the function. Test monitoring tools should be used whenever possible to trackwhich tests have already been performed and the outputs of these tests to avoidrepetition and to aid in the software maintenance. Data outside of the specifiedinput range should be tested to check the robustness of the program.

School of Computing Science and Engineering, VIT University, Chennai

Page 46: NIC Project Final Report

Monitoring and Surveillance using Near Field Technologies for the Gov. of India 37

4.4.3 Compatibility TestingIt is a testing technique used to Ensure Compatibility of an application. Varioustests were done to ensure that multiple technologies are compatible with the appli-cation. We could not use the latest version of Cordova and had to work in Cordova3.0.1 version so that all the technologies are compatible. Still the application isnot compatible for usage in windows phones. The application can show data inmultiple platforms but can only take input from a NFC enabled android device.

4.4.4 Functional TestingFunctional testing deals with the process of testing individual functions. A coupleof tests were run on the d3.xml() function, where a multiple data in xml formatwas sent and checked if it was parsed properly to generate data and render chartsfrom that data. Other function like the various web-services were tested to fetchdata from the database and convert it into XML tags. The NFC cards were testedfor read and write operations where the cards were checked if they always gaveaccurate reading.

4.4.5 System TestingTesting conducted on a complete, integrated system to evaluate. The systemscompliance with its specified requirements. System testing falls within the scopeof Black Box Testing. Once the whole system was developed various inputs weregiven to it thinking of real time scenarios and feeding real time data to check therobustness of the system. The demo versions of the application were also dis-tributed to friends and colleagues and asked for their feedbacks and suggestions.

School of Computing Science and Engineering, VIT University, Chennai

Page 47: NIC Project Final Report

Monitoring and Surveillance using Near Field Technologies for the Gov. of India 38

4.4.6 Junit Test Case

Figure 4.7: Test Case

School of Computing Science and Engineering, VIT University, Chennai

Page 48: NIC Project Final Report

Monitoring and Surveillance using Near Field Technologies for the Gov. of India 39

Chapter 5

Results and Discussions

As a result of this project a set of advanced services will be added to the mobil-ity platform services platform. These services perform a specific task and adda definite feature to the platform. Using one or multiple features from this plat-form a user can make an application for his use within comparatively very lesstime. The advanced services developed for this platform consist of features likeMaps, Charts, Near Field Communications, Crowd Sourcing, Tracking and Mon-itoring and 5 Factor Authentication. As a Proof of Concept (P.O.C) an applicationnamed The Beat Management Process is developed using the MPS platform. Ev-ery single night one or many police officers are required to visit multiple placesfor parole. When a policeman checks into a location assigned to him it is calleda BEAT. He might be required to take multiple BEATS in a single session. Tocheck if the policeman has completed all the required BEATS this system is used.But is mainly designed to help the Policemen perform his BEATs properly and inassist him to finish the task in an efficient way. Each policeman has to login to thesystem where he can be authenticated using any of the 5 Factor Authenticationmethods like NFC cards, Username-Password pair, mobile IMEI no, etc. Oncethe user is authenticated he will be displayed a menu with multiple options likePending Tasks, Missed Tasks, History and Weekly Analysis. The user will be ableto view a list of all the tasks still pending for him to complete in the form of adropdown list. He can then select a particular job and that job can be displayedto him with its basic details like location on the map, description and instructions.Once the policeman is at a point of BEAT he can ask the person to be checked toplace his NFC card on the mobile or NFC enabled device and the BEAT successis updated on the server and the phone. The above process is repeated for all thetasks assigned to him in a day. In the next tab the user can see all the tasks he

School of Computing Science and Engineering, VIT University, Chennai

Page 49: NIC Project Final Report

Monitoring and Surveillance using Near Field Technologies for the Gov. of India 40

has missed in the past and in the History tab the user can see all the task he hascompleted and the ones he has missed in a specific time period. Weekly analysisis done of the BEATs done by the user and a visualization of those analysis isdone using the d3js Real Time Charts (RTC).

School of Computing Science and Engineering, VIT University, Chennai

Page 50: NIC Project Final Report

Monitoring and Surveillance using Near Field Technologies for the Gov. of India 41

Chapter 6

Conclusion and Future Work

I did not make one application or website but develop a few services and featureswhich will provide to make multiple applications and systems using the MPS plat-form. The Beat Management System is a proof of concept (POC) for the differentapplications that can be developed using the MPS platform. These services can beused to enhance or build any application in future to solve a problem or provideservices to the Indian Government. The system will provide scalable and reusableservices, that can be integrated to any existing platform or a newly developed one.The system will support NFC authentication and NFC services and also providemonitoring and surveillance facilities using Geo Tags, RF Tags and other multiplesensors. The system provides all features of Google Map API and Leaflet MapsAPI for the users perusal to provide them features to visualize single or multiplegeographic locations. Developing this system was one of the best experiences ofmy life and I still have two more months left of internship. During this span oftime I will be working on couple of more services and features like crowd sourc-ing, Tracking using Bluetooth devices, etc. Whatever features are prepared can beused to develop various applications of different types. Using these service andfeatures one can make any app he wants taking advantage of the latest featuresand technologies. Anything else which will make the product better would be un-dertaken by me. To conclude I would like to state that I have learnt a lot of newtechnologies like Web-service designing, javascripting, visualization techniqueslike d3js and Maps, Cordova App Development, NFC, etc. and have gained ex-perience in the professional environment and I am grateful to all at the NationalInformatics Centre to guide me and support me on every step and allowing me toevolve and become a better professional

School of Computing Science and Engineering, VIT University, Chennai

Page 51: NIC Project Final Report

Monitoring and Surveillance using Near Field Technologies for the Gov. of India 42

Appendices

(A) Screen Shot

Figure 6.1: Splash Screen

School of Computing Science and Engineering, VIT University, Chennai

Page 52: NIC Project Final Report

Monitoring and Surveillance using Near Field Technologies for the Gov. of India 43

Figure 6.2: NFC Authentication

School of Computing Science and Engineering, VIT University, Chennai

Page 53: NIC Project Final Report

Monitoring and Surveillance using Near Field Technologies for the Gov. of India 44

Figure 6.3: Menu

School of Computing Science and Engineering, VIT University, Chennai

Page 54: NIC Project Final Report

Monitoring and Surveillance using Near Field Technologies for the Gov. of India 45

Figure 6.4: Pending Task

School of Computing Science and Engineering, VIT University, Chennai

Page 55: NIC Project Final Report

Monitoring and Surveillance using Near Field Technologies for the Gov. of India 46

Figure 6.5: Pending Task 2

School of Computing Science and Engineering, VIT University, Chennai

Page 56: NIC Project Final Report

Monitoring and Surveillance using Near Field Technologies for the Gov. of India 47

Figure 6.6: Missed Task

School of Computing Science and Engineering, VIT University, Chennai

Page 57: NIC Project Final Report

Monitoring and Surveillance using Near Field Technologies for the Gov. of India 48

Figure 6.7: History

School of Computing Science and Engineering, VIT University, Chennai

Page 58: NIC Project Final Report

Monitoring and Surveillance using Near Field Technologies for the Gov. of India 49

Figure 6.8: D3 Bar Chart

Figure 6.9: D3 Pie Chart

School of Computing Science and Engineering, VIT University, Chennai

Page 59: NIC Project Final Report

Monitoring and Surveillance using Near Field Technologies for the Gov. of India 50

Figure 6.10: Map with markers

Figure 6.11: Map with info-window

School of Computing Science and Engineering, VIT University, Chennai

Page 60: NIC Project Final Report

Monitoring and Surveillance using Near Field Technologies for the Gov. of India 51

(B) Sample Coding

Sample Web-Service

@POST@Path ("/Location1")@Produces ("text/xml")public String Location1(@Context HttpServletResponse httpServletResponse){String output=new String();Connection c = null;Statement stmt1 = null;try {Class.forName("org.postgresql.Driver");c = DriverManager.getConnection("jdbc:postgresql://localhost:5432/Beatp","postgres", "kay123");c.setAutoCommit(false);System.out.println("Opened database successfully");stmt = c.createStatement();ResultSet rs = stmt.executeQuery( "SELECT station, pscode, x, y FROM public.geo_fencing;");output+= "<sdp><viewmap type=\"google\"><Location>";while ( rs.next() ) {String station = rs.getString("station");String pscode = rs.getString("pscode");String lat = rs.getString("x");String lng = rs.getString("y");System.out.println(station);output+="<response lat=\""+lat+"\" lng=\""+lng+"\" value=\""+station+"\"></response>";}output+="</Location> </viewmap></sdp>";rs.close();stmt.close();c.close();} catch ( Exception e ) {System.err.println( e.getClass().getName()+": "+ e.getMessage() );System.exit(0);

School of Computing Science and Engineering, VIT University, Chennai

Page 61: NIC Project Final Report

Monitoring and Surveillance using Near Field Technologies for the Gov. of India 52

}return output;

}

Sample XML<sdp><viewmap type="google"><group name="0 " value="police" markercolor="blue"><responses lat="13.00437449" long="80.252406590000007" value="J2 Adayar"/><response name="Town" value="Chennai"/><response name="Degree" value="34%celcisus"/><response name="Image" value="image/1.png"/><response name="Description" value="null"/></group><group name="1 " value="water" markercolor="red"><responses lat="12.98699234" long="80.260591610000006" value="J6 Thiruvanmiyur"/><response name="Town" value="Chennai"/><response name="Degree" value="44%celcisus"/><response name="Image" value="image/2.png"/><response name="Description" value="null"/></group><group name="2 " value="temple" markercolor="pink"><responses lat="12.931626039999999" long="80.252467019999997" value="J8 Neelangarai"/><response name="Town" value="Chennai"/><response name="Degree" value="34%celcisus"/><response name="Image" value="image/3.png"/><response name="Description" value="null"/></group>

</viewmap></sdp>

School of Computing Science and Engineering, VIT University, Chennai

Page 62: NIC Project Final Report

Monitoring and Surveillance using Near Field Technologies for the Gov. of India 53

Sample Ajax Call$(document).ready(function(){var group;var markercolor$.ajax({type: "POST",url: "http://localhost:8086/oralcancerdashboard_(1)/Location2",datatype: "xml",error: function(jqXHR, textStatus, errorThrown) {console.log(’Error: ’ + errorThrown); },success: function(xml) {var i =0;$(xml).find(’group’).each(function(){"<h4>"+$(this).attr(’value’).toString()+"</h4>",$(this).attr(’lng’),$(this).attr(’lat’)];group = $(this).attr(’value’).toString();markercolor = $(this).attr(’markercolor’).toString();});});});

Sample NFC Readfunction nfcread(){var errorflag=1;function nfcHandler (nfcEvent) {var tag = nfcEvent.tag;var ndefMessage = tag.ndefMessage;var payload = nfc.bytesToString(ndefMessage[0].payload);var tagId = nfc.bytesToHexString(tag.id);var value = payload.substring(3);if(tagId==tag[i]){alert("Beat Sucessful for"+payload);}else {alert("Invalid Card");}};

School of Computing Science and Engineering, VIT University, Chennai

Page 63: NIC Project Final Report

Monitoring and Surveillance using Near Field Technologies for the Gov. of India 54

Bibliography

[1] Applying Google Maps,Christophe Vandeviver,2010

[2] Apache Cordova Programming,John M. Wargo 2015

[3] Begin NFC with PhoneGap,By DonColeman,Oreilly

[4] Data Visualization with d3.js,Teller, Swizec,2013

[5] Data-Driven Documents Michael Bostock, Vadim Ogievetsky,2013

[6] Data Visualization with D3.js Cookbook,Nick Qi Zhu - 2013

[7] e-Gov Mobility Platform Services: http://informatics.nic.in/pdfs/89bad940.pdf

[8] Interactive Data Visualization for the Web,Scott Murray,2011

School of Computing Science and Engineering, VIT University, Chennai