42
DEVICE TRACKING OF WINDOWS 8 MOBILE DEVICES _______________ A Thesis Presented to the Faculty of San Diego State University _______________ In Partial Fulfillment of the Requirements for the Degree Master of Science in Computer Science _______________ by Ashish Ashok Nirkhe Spring 2013

DEVICE TRACKING OF WINDOWS 8 MOBILE DEVICES

  • Upload
    others

  • View
    2

  • Download
    0

Embed Size (px)

Citation preview

Page 1: DEVICE TRACKING OF WINDOWS 8 MOBILE DEVICES

DEVICE TRACKING OF WINDOWS 8 MOBILE DEVICES

_______________

A Thesis

Presented to the

Faculty of

San Diego State University

_______________

In Partial Fulfillment

of the Requirements for the Degree

Master of Science

in

Computer Science

_______________

by

Ashish Ashok Nirkhe

Spring 2013

Page 2: DEVICE TRACKING OF WINDOWS 8 MOBILE DEVICES
Page 3: DEVICE TRACKING OF WINDOWS 8 MOBILE DEVICES

iii

Copyright © 2013

by

Ashish Ashok Nirkhe

All Rights Reserved

Page 4: DEVICE TRACKING OF WINDOWS 8 MOBILE DEVICES

iv

DEDICATION

This thesis is dedicated foremost to my parents for nurturing good values in me, to

my professors and to all my wonderful supportive friends.

Page 5: DEVICE TRACKING OF WINDOWS 8 MOBILE DEVICES

v

ABSTRACT OF THE THESIS

Device Tracking of Windows 8 Mobile Devices by

Ashish Ashok Nirkhe Master of Science in Computer Science

San Diego State University, 2013

The objective of this project is to develop a Device Tracker app which is aimed at converting a mobile device such as a smartphone or tablet into a GPS tracking device. Using GPS, WiFi or cellular triangulation, the installed app quietly records its locations periodically and uploads it to the server. The owner of the device can login to the website to browse the tracking data of his device/devices. A single owner can own and track multiple devices. Preferred locations can be set for devices, and system generated exceptions can be traced whenever the device goes out of bounds. The application supports mobile devices using Windows 8 operating system.

Page 6: DEVICE TRACKING OF WINDOWS 8 MOBILE DEVICES

vi

TABLE OF CONTENTS

PAGE

ABSTRACT ...............................................................................................................................v

LIST OF TABLES ................................................................................................................. viii

LIST OF FIGURES ................................................................................................................. ix

ACKNOWLEDGEMENTS .......................................................................................................x

CHAPTER

1 INTRODUCTION .........................................................................................................1 

1.1 Existing Device Tracking Applications .............................................................1 

1.2 Thesis Work .......................................................................................................2 

2 DEVICE TRACKING APPLICATION ........................................................................3 

2.1 Objective ............................................................................................................3 

2.2 A Need for Device Tracking ..............................................................................3 

2.3 Key Features of the Proposed System ...............................................................3 

2.4 Tracker Application ...........................................................................................4 

2.5 Device Tracker Website .....................................................................................5 

2.6 Module Diagram ................................................................................................5 

2.7 Exceptions Algorithm ........................................................................................5 

3 ARCHITECTURE AND TECHNOLOGY ...................................................................7 

3.1 Actual Implementation – Device Agent ............................................................7 

3.2 Actual Implementation – Web Site ....................................................................8 

3.3 Server Configuration ........................................................................................11 

3.4 Software Features.............................................................................................12 

3.4.1 WinRT.....................................................................................................12 

3.4.2 Features and Benefits ..............................................................................12 

3.4.3 PHP and Codeigniter...............................................................................12 

3.4.4 Main Features of Codeigniter .................................................................12 

3.4.5 MySQL ...................................................................................................13 

3.4.6 Main Features of MySQL .......................................................................13 

Page 7: DEVICE TRACKING OF WINDOWS 8 MOBILE DEVICES

vii

4 IMPLEMENTATION DETAILS ................................................................................14 

4.1 Project Description ...........................................................................................14 

4.2 Introduction ......................................................................................................14 

4.3 WinRT Based App ...........................................................................................14 

4.4 Device Agent ...................................................................................................14 

4.5 Device Registration and User Profile Creation ................................................17 

4.6 Login as Existing User .....................................................................................17 

4.7 Quick View of Exceptions ...............................................................................17 

4.8 Device Information ..........................................................................................19 

4.9 Preferred Locations Information ......................................................................20 

4.10 Boundary Points .............................................................................................20 

4.11 Tracking Data.................................................................................................22 

4.12 Exceptions ......................................................................................................22 

4.13 Database Design .............................................................................................22 

4.14 Algorithm .......................................................................................................24 

5 CONCLUSION AND OBSTACLES FACED ............................................................27 

5.1 Project Features ................................................................................................27 

5.2 General Features ..............................................................................................27 

5.3 Summary ..........................................................................................................27 

5.4 Conclusion .......................................................................................................28 

5.5 Obstacles ..........................................................................................................28 

6 FUTURE WORK .........................................................................................................29 

6.1 Future Improvements .......................................................................................29 

6.2 Easing of Limitations .......................................................................................29 

REFERENCES ........................................................................................................................30

APPENDIX

GLOSSARY ......................................................................................................................31 

Page 8: DEVICE TRACKING OF WINDOWS 8 MOBILE DEVICES

viii

LIST OF TABLES

PAGE

Table 4.1. Database Design .....................................................................................................25 

Page 9: DEVICE TRACKING OF WINDOWS 8 MOBILE DEVICES

ix

LIST OF FIGURES

PAGE

Figure 2.1. Device tracker. .........................................................................................................5 

Figure 2.2. Device tracker website – Module diagram. .............................................................6 

Figure 2.3. Exception algorithm. ...............................................................................................6 

Figure 3.1. Device agent – Registration process. .......................................................................8 

Figure 3.2. Website login process. .............................................................................................8 

Figure 3.3. Exceptions information retriever. ............................................................................9 

Figure 3.4. Device information retriever. ..................................................................................9 

Figure 3.5. Preferred locations customization. ........................................................................10 

Figure 3.6. Boundary point configuration. ...............................................................................10 

Figure 3.7. Device tracking data. .............................................................................................10 

Figure 3.8. Exception data fetching. ........................................................................................11 

Figure 4.1. User permission. ....................................................................................................15 

Figure 4.2. Device registration on device agent. .....................................................................16 

Figure 4.3. Blocked device agent. ............................................................................................16 

Figure 4.4. User login. .............................................................................................................18 

Figure 4.5. Quick view 1 – Devices out of bounds. .................................................................18 

Figure 4.6. Quick view 2 – Devices not reporting. ..................................................................19 

Figure 4.7. Devices – One stop information. ...........................................................................20 

Figure 4.8. Preferred locations. ................................................................................................21 

Figure 4.9 Boundary points – View. ........................................................................................21 

Figure 4.10. Boundary points – Add. .......................................................................................22 

Figure 4.11. Tracking data – View. .........................................................................................23 

Figure 4.12. Tracking data – Export to excel format. ..............................................................23 

Figure 4.13. Exception data. ....................................................................................................24 

Figure 4.14. Point-in-polygon algorithm. ................................................................................26 

Page 10: DEVICE TRACKING OF WINDOWS 8 MOBILE DEVICES

x

ACKNOWLEDGEMENTS

I wish to express my sincere gratitude to my advisor Dr. Carl Eckberg for his faith in

me and his encouragement. I would like to thank my committee members, Professor Roger

Whitney and Professor Mark Dunster for their support and understanding. I thank the San

Diego State University for giving me the opportunity to learn advanced technologies and

better programming practices.

Page 11: DEVICE TRACKING OF WINDOWS 8 MOBILE DEVICES

1

CHAPTER 1

INTRODUCTION

With advances in technology, more compact, faster and more powerful devices are

introduced in the world. This has given birth to new areas of services and applications, such

as in this case location based services.

The objective of this project is to develop a Windows8 platform based metro style

application which can track mobile devices such as cell phones, tablets etc. This project

further demonstrates the power of web based services by considering preferred area locations

for the mobile device that are being tracked.

The project can be used to keep the track of the "Tracking Information of the device",

raise exceptions when the device does not report or goes out of bounds. Exceptions here refer

to the highlighted tracking data for the devices which reported to be out of bounds of the

preferred area or the device data for the devices which did not report in regular time interval.

This time interval parameter can be specified in the database which is explained in chapter 4.

The project can also be used to establish device management for small firms.

1.1 EXISTING DEVICE TRACKING APPLICATIONS

There are few device tracking applications available, but most of them need Android

OS (Operating System) or Apple iOS as a platform. There are few services provided by

Microsoft, to track the current location of devices such as “Find My Phone”. But these

services do not provide a history of the locations where the devices have been in the past.

Although some of these apps on different platforms allow browsing through the

tracked data, there is no simple way to sort out the locations. The user is not provided with

facilities such as setting the boundary for the device's preferred location, sorting out the

locations where the device is not supposed to be, sorting out the timings when the device did

not report etc.

Page 12: DEVICE TRACKING OF WINDOWS 8 MOBILE DEVICES

2

1.2 THESIS WORK

This thesis project develops a Windows8 platform based metro app using the WinRT

(see Appendix) architecture and a website which keeps track of the data provided by devices.

The user is allowed to track multiple devices with one single login. The user can specify

multiple preferred locations for all or one of the devices. All the information about the

devices, latitudes and longitudes, exceptions raised can be accessed through this website. It

gives a new experience of control to the user over his or her devices.

This thesis document is divided into 6 chapters:

Chapter 1: Gives a brief introduction about the device tracking application (client and server side) and the thesis document.

Chapter 2: It covers functional requirements of the project, identifying user cases for the system, logical design and design patterns.

Chapter 3: Gives an insight about the architecture and the technologies used in the development of the thesis project.

Chapter 4: Details the implementation of the Device Tracker application and screenshots.

Chapter 5: Gives the conclusion and obstacles faced while working on the project

Chapter 6: The future work related to this project.

Page 13: DEVICE TRACKING OF WINDOWS 8 MOBILE DEVICES

3

CHAPTER 2

DEVICE TRACKING APPLICATION

2.1 OBJECTIVE

The objective of this project is to develop Windows 8 platform based metro style

application (Windows store app) for device tracking, that is compatible with Windows 8

platform based mobile devices, and efficiently used by end users.

2.2 A NEED FOR DEVICE TRACKING

In the fast moving world, it has become very essential for small firms to track the

devices given out to employees for office use, or for parents to track their children. User

needs a simple way in which he can get access to log of tracked data. Using smart ways to

specify preferred locations for devices, and to capture the geographical data and having the

check of the identified locations, it is possible to generate exceptions when the device goes

out of bounds.

Current device tracking systems have two main restrictions:

1. Most of the systems are developed for Android or iOS (I phone) systems.

2. It is possible to fool such systems by turning off the device and then roaming around without restriction. I have introduced a concept of non-reporting device exception in the application, which takes care of such flaws. This concept is explained in depth later in this chapter.

The application takes in information such as Device Name, Email Id of the device

owner, Password, Preferred Location for one time when the application gets installed. Device

Name is the name given by the device owner to refer that particular device information

through the website. Email Id and Password can be used by the device owner to login to the

website. The application also asks for the permission of the owner to track the device

location and to register a background process on the mobile device. Once the data is

submitted, the device can be tracked on the website with the provided email id and password.

2.3 KEY FEATURES OF THE PROPOSED SYSTEM

The key features of the proposed system are as follows:

Page 14: DEVICE TRACKING OF WINDOWS 8 MOBILE DEVICES

4

1. The application is developed in WinRT architecture (see chapter 3), considering its compatibility over different Windows 8 based mobile devices such as cell phones and tablets.

2. The application is very carefully developed considering the limited available memory and power (battery life) in mobile devices.

3. The server side code is developed using the M-V-C design pattern with the Codeignitor framework.

4. Stable views of the website are implemented using the Grocery CRUD framework.

2.4 TRACKER APPLICATION

The application works as mentioned in the following manner:

1. When the application is started, the user is given a window to register with following information:

a. Device name,

b. Email id,

c. Password,

d. Preferred location (optional)

2. User is also asked for the permission to track his/ her device and register background process with the OS.

3. On successful registration, a background process gets registered with the OS, and starts reporting the location information to the server.

4. The user can then close the application, and visit the website to change settings, track data, add or update preferred locations for the device, check exceptions generated either because of non-reporting device or because the device goes out of bounds.

5. In order to restrict access to all the information and configuration modification, device agent is blocked for further accesses.

As shown in the Figure 2.1, the mobile device is only aware of the middleware web

service response. It is presumed that the device running this app has an access to the internet.

Whenever the information is posted to the server, depending upon whether the information

includes registration information, or tracking information, the data is extracted, and then

appropriate database operations are performed.

Data extraction and processing is done at the server side, allowing the application to

run on even mobile devices with very little amount of processing power. When observed

through the experiments, hundred percent batteries is drained ten to twenty minutes earlier

than the usual battery drain time period in absence of the app. The experiments are performed

on Dell laptop and on a tablet with Windows 8 OS installed in both the devices.

Page 15: DEVICE TRACKING OF WINDOWS 8 MOBILE DEVICES

5

Figure 2.1. Device tracker.

2.5 DEVICE TRACKER WEBSITE

Whenever a user registers the device with Device Tracker application, a user profile

gets created on the server. The user can use the login information entered during the device

registration process to log in to the Device Tracker website. The user can then get an

overview of the devices that are registered under his email id. The user can configure and use

several options provided by the website.

2.6 MODULE DIAGRAM

Figure 2.2 is the module diagram that shows in detail the process involved in device

registration and user profile creation. Modules are explained with screenshots in chapter 4.

2.7 EXCEPTIONS ALGORITHM

The device reports the locational data to the server. Data processing is done at the

server side and the data gets stored to MySQL database. Now exception algorithm makes use

of this data to make some meaningful information as shown in Figure 2.3. The algorithm

checks two conditions for each device of a user:

1. Device is reporting regularly in fixed interval of time. This time parameter can be set in database parameter table through the website. The default time interval set is 15 minutes. Due to Windows 8 OS restrictions, background processes registered with the OS can only be run after 15 minutes or in periodic time multiple of 15 minutes.

2. Device is reporting location information which is within the limits specified for that particular device.

Algorithms are developed in C++.

Page 16: DEVICE TRACKING OF WINDOWS 8 MOBILE DEVICES

6

Figure 2.2. Device tracker website – Module diagram.

Figure 2.3. Exception algorithm.

Page 17: DEVICE TRACKING OF WINDOWS 8 MOBILE DEVICES

7

CHAPTER 3

ARCHITECTURE AND TECHNOLOGY

3.1 ACTUAL IMPLEMENTATION – DEVICE AGENT

The implementation of device agent is done in WinRT architecture. WinRT is a new

Windows Runtime that exposes operating system functionality in an object oriented fashion.

It is a platform homogenous architecture on Windows 8 and Windows RT operating systems.

WinRT is essentially a COM based API. Due to its COM-like basis, WinRT allows

interfacing from multiple languages. WinRT based development of the device agent was

done in 3 steps:

1. Planning an App:

Planning needs to be done in order to decide what APIs should be used and how the app capability can be affected by these APIs. The decision about which framework to choose affects the performance of the entire app.

2. Designing UX for an App:

UX designing guidance is provided on Microsoft’s dev center website. There are strict rules to be followed while designing WinRT based Windows 8 store app. It includes navigation between different pages of an app, touch gesture response, commanding/ user input etc.

3. Developing an App:

WinRT provides freedom to the developer to choose a programming language from the options below:

a. C#

b. C++

c. Javascript

d. HTML

e. VB

The Device Tracker app is developed using C# in combination with XAML. XAML

stands for Extensible Application Markup Language. XAML is a declarative XML-based

language created by Microsoft that is used for initializing structured values and objects.

When a user starts the app for the first time, app asks for the user permission to track his/ her

location. A registration screen is then shown to the user along with a world map centered at

Page 18: DEVICE TRACKING OF WINDOWS 8 MOBILE DEVICES

8

his/ her current location. The user then needs to provide registration information in the

textboxes and select a preferred location from the adjacent map. The user can select

maximum up to 8 points for each individual preferred location from the map. This data is

then sent to server once user clicks on register. This scenario is explained in Figure 3.1.

Figure 3.1. Device agent – Registration process.

3.2 ACTUAL IMPLEMENTATION – WEB SITE

The actual implementation of the server is done on WAMP configuration, where

WAMP stands for Windows, Apache, MySQL and PHP. Apache server is configured to run

PHP. All the data pertaining to user profile and devices is stored in the MySQL database. The

PHP scripts perform authentication, data extraction and processing and storing of data (Refer

Chapter 4 for actual implementation details). The login process is shown in Figure 3.2.

Figure 3.2. Website login process.

On successful login, exception information for all the devices of that user is listed for

quick view (see screenshots given in Figure 4.5 and Figure 4.6 in section 4.7, pages 17-19).

This avoids the necessity of the user to actually visit the tracked data information table and

then check for individual report analysis. Exception information retrieval is done as shown in

Figure 3.3:

Page 19: DEVICE TRACKING OF WINDOWS 8 MOBILE DEVICES

9

Figure 3.3. Exceptions information retriever.

The user can edit the device information from ‘Devices’ option provided on the

website as shown in Figure 3.4. The user can track for the preferred location of an individual

device on Nokia maps (the Here platform). A Nokia mapping platform known as Here is very

similar to the well-known Google maps. This project uses two different mapping platforms.

Bing Maps are used on the device side in device agent, while Nokia Here Maps are used on

the server side.

Figure 3.4. Device information retriever.

Page 20: DEVICE TRACKING OF WINDOWS 8 MOBILE DEVICES

10

Customizing preferred locations by giving a name and description to each of the

preferred locations is done as shown in Figure 3.5:

Figure 3.5. Preferred locations customization.

Boundary point configuration is provided as shown in Figure 3.6:

Figure 3.6. Boundary point configuration.

Device tracking data is provided as shown in Figure 3.7:

Figure 3.7. Device tracking data.

Page 21: DEVICE TRACKING OF WINDOWS 8 MOBILE DEVICES

11

Exception data raised by the C++ algorithm is fetched as shown in Figure 3.8:

Figure 3.8. Exception data fetching.

3.3 SERVER CONFIGURATION

The server should be connected to the internet. Server should run Apache HTTP

server and should support PHP. Server should also be connected to MySQL for making

appropriate entries to the database and for retrieving data from the database.

With the above server settings, different PHP scripts are installed in M-V-C fashion.

This is done by using the Codeigniter framework. Controller PHP files to be installed are:

1. Devicetracking.php: is the main controller file. This file provides user with the various options such as viewing past tracked data, configuring preferred locations etc.

2. Login.php: is the controller which takes care of the login process view.

3. Verifylogin.php: is the controller file which takes care of login process. The user entered login information is processed, e.g. password is encrypted using MD5 algorithm, and user session authentication is done.

4. Home.php: is the controller file responsible for the web site home screen view.

5. Service.php: is the controller file which takes care of the data received from the devices. Data is processed depending upon the type of the data. E.g. registration data contains email id, password etc., while location (tracking) data contains latitude, longitude, accuracy etc.

These PHP controller files are used for the M-V part of the M-V-C model to process

and display appropriate data to the user. C++ files for the exception algorithm should be

complied and the exe should be installed on the server.

Page 22: DEVICE TRACKING OF WINDOWS 8 MOBILE DEVICES

12

3.4 SOFTWARE FEATURES

The application is designed using different software technologies which have several

different software features.

3.4.1 WinRT

WinRT is a new set of APIs that have following properties:

1. Exposes the WPF/Silverlight XAML UI model.

2. Sandbox API, designed for developing self-contained app.

3. API definitions are exposed in ECMA 335 metadata format.

On top of COM, WinRT wraps new XAML based UI and old Win32 APIs [1].

3.4.2 Features and Benefits

In order to make sure that every Windows store app is designed to always respond to user input, every API that is supposed to take more than 50 milliseconds to run is made asynchronous.

Since WinRT is designed to be native API, code itself cannot contain metadata. WinRT stores its metadata in .winmd files which are encoded using the ECMA 335 metadata format [2].

Built in metadata system makes it an object-oriented type system.

Every class built in WinRT is called as WinRT component. WinRT component can be coded in any language supported by WinRT. Since WinRT is built on metadata structure, WinRT component written in one language can easily be used in another language.

Developer downloads page by Microsoft [3] provides all the necessary tools and SDK that are required for app development.

3.4.3 PHP and Codeigniter

PHP is a server-side scripting language designed to create dynamic Web pages. It has

quick performance time and very high performance. Codeigniter is an open source web

application framework, for building dynamic web sites with PHP [4]. Codeigniter is based on

the popular Model-View-Controller development pattern.

3.4.4 Main Features of Codeigniter

Compared with the other PHP frameworks, Codeigniter is much faster.

Grocery CRUD library works with Codeigniter in order to create stable CRUD operations with nice view and compatibility across the browsers.

Page 23: DEVICE TRACKING OF WINDOWS 8 MOBILE DEVICES

13

Codeigniter needs nearly zero configuration and provides exceptional performance.

3.4.5 MySQL

MySQL provides a very fast, multi-threaded, multi-user and robust SQL (Structured

Query Language) database server [5].

3.4.6 Main Features of MySQL

MySQL databases are relational that stores data in separate tables rather than putting all the data in one big storeroom. The database structures are organized into physical files and are optimized for speed.

MySQL can scale up to clusters of machines, networked together.

MySQL is written in C and C++ and it works on many different platforms.

Uses multi-layered server design with independent modules.

Uses a very fast thread based memory allocation system.

Implements in-memory hash tables. These tables are used as temporary tables.

Very fast joins using an optimized one-sweep multi-join, can mix tables from different databases.

Usually there isn’t any memory allocation at all after query initialization.

Page 24: DEVICE TRACKING OF WINDOWS 8 MOBILE DEVICES

14

CHAPTER 4

IMPLEMENTATION DETAILS

4.1 PROJECT DESCRIPTION

The goal of the project was to develop a mobile device Metro style app to track

Windows 8 based devices, report this data to the server for storage and raising exceptions.

4.2 INTRODUCTION

WAMP setup is done to support PHP and MySQL database. Codeigniter framework

is used for web-development which uses M-V-C design pattern. Grocery CRUD framework

is used to implement data handling and displaying on the website. Exception algorithms are

written in C++ to fetch data from the MySQL database, and raise exceptions depending on

conditions. All terminologies are explained in detail, later in this chapter.

4.3 WINRT BASED APP

This Metro style app is based on the WinRT foundation. The app has a user friendly

interface with minimal input from the user. Latitude and longitude inputs for preferred

locations are accepted by touch or mouse on the world map. The Bing map SDK, a Microsoft

mapping application, is used to configure the world map on the app screen. 70% of the screen

area is allocated for displaying the map which is centered at the current user location. User

can zoom in or zoom out of the map. User can also change the display mode of the map to

either road view or satellite view. This enhances the user experience by simplifying the

user’s preferred location input. Once the device registration is done on first time use of the

app, a background process is registered with Windows 8 OS. User input is blocked for

further accesses to the app in order to avoid configuration changes.

4.4 DEVICE AGENT

The Windows 8 store app which runs on the device is the device agent. The agent

runs on the device and sends necessary information to the server. As per the guidelines, the

Page 25: DEVICE TRACKING OF WINDOWS 8 MOBILE DEVICES

15

agent asks user permission before tracking his/ her current location. This is shown in the

Figure 4.1:

Figure 4.1. User permission.

Once the user allows the app to track his/ her current location, the Bing map zooms

itself to focus on the current location of the device. User can choose the view type of the

map, e.g. current view in the map is Road view as shown in the Figure 4.2:

The user can then set the preferred location for the device by choosing boundary

points on the map. As user chooses boundary points on the map, the corresponding latitude

and longitude gets listed on the left side panel as shown in Figure 4.2. When user clicks on

Register, a background process gets registered with the OS and an account gets created on

the server side. If an account is already present on the server with the given e-mail address,

the new device gets listed under the same user. The device is now safe and can be given to

any user who is not the owner of the device. Device agent is now blocked for altering any

information such as device name, e-mail address, password and preferred location. This is

shown in Figure 4.3. Only the owner can access this information through login into the

server.

Page 26: DEVICE TRACKING OF WINDOWS 8 MOBILE DEVICES

16

Figure 4.2. Device registration on device agent.

Figure 4.3. Blocked device agent.

Page 27: DEVICE TRACKING OF WINDOWS 8 MOBILE DEVICES

17

4.5 DEVICE REGISTRATION AND USER PROFILE

CREATION

The service.php listens to the http request at the server side. Depending on what kind

of data is received, data is processed and inserted into appropriate MySQL database tables.

Device registration information consists of:

1. Device name,

2. Email id of the device owner

3. Password

4. Preferred locations latitudes and longitudes

This information is separated and inserted into the following MySQL tables:

1. User

2. Preferred_location

3. Device

4. Location_device

5. User_device

6. Boundary_point

4.6 LOGIN AS EXISTING USER

PHP files running on the Apache server take login credentials from the user. The

existing user who has registered his device(s) can choose this option and he is prompted to

enter his/ her email id and password as shown in Figure 4.4.

The username (email id) and password is obtained from the user and the MD5

cryptographic hash function is used on the password. On the server side, the login state is

maintained and checked every time in order to avoid any sort of security threats.

4.7 QUICK VIEW OF EXCEPTIONS

Once the user is logged in successfully, he is shown the exception information for

quick view. C++ algorithm is used to process the tracked data and the preferred location

information. All this is done by querying the database. Figure 4.5 and Figure 4.6 show how

the quick view is used for displaying 2 types of exception data:

Page 28: DEVICE TRACKING OF WINDOWS 8 MOBILE DEVICES

18

Figure 4.4. User login.

Figure 4.5. Quick view 1 – Devices out of bounds.

Page 29: DEVICE TRACKING OF WINDOWS 8 MOBILE DEVICES

19

Figure 4.6. Quick view 2 – Devices not reporting.

4.8 DEVICE INFORMATION

The user’s device information is shown in this view (see Figure 4.7). If the user has

multiple devices, all devices pertaining to that user are listed in this view. Grocery CRUD

framework is used on top of the Codeigniter framework to combine data from multiple

MySQL database tables and display them in tabular format. The user gets summarized

information for all his devices at one stop, which includes:

1. Device name/ id

2. Device status

3. Device user email (in case the user of the device is not the owner)

4. Owner email id

5. Preferred location for the device

6. Device last report location (quick view icon is provided to map this location on visual map)

7. Exception if any, and its time

8. Device description (this is default text initially, but user can edit this text as per need)

9. Device last reported timestamp

10. Device registration timestamp

Page 30: DEVICE TRACKING OF WINDOWS 8 MOBILE DEVICES

20

Figure 4.7. Devices – One stop information.

4.9 PREFERRED LOCATIONS INFORMATION

Preferred locations get created at the time of device registration, if the user has picked

preferred location boundary points from the map. Default name and description is given to

this location, which can be edited from the website. Grocery CRUD framework allows the

user to create more preferred locations as per choice or edit existing preferred locations.

Preferred locations are displayed as shown in Figure 4.8:

4.10 BOUNDARY POINTS

Entries to the boundary points table are also made at the time the device gets

registered, if boundary points are selected by the user. The user also has an option to add

boundary points from the website for additional authorized locations. These boundary points

are the points of polygon which represents the preferred location area. Boundary points can

be added only by referring to some existing preferred location. An ordinal field is created to

help C++ algorithm to form a closed area from the boundary points. Ordinals should be

assigned to boundary points either in clockwise direction or in anti-clockwise direction.

Boundary point configuration is done as shown in Figure 4.9 and Figure 4.10:

Page 31: DEVICE TRACKING OF WINDOWS 8 MOBILE DEVICES

21

Figure 4.8. Preferred locations.

Figure 4.9 Boundary points – View.

Page 32: DEVICE TRACKING OF WINDOWS 8 MOBILE DEVICES

22

Figure 4.10. Boundary points – Add.

4.11 TRACKING DATA

With the WinRT restrictions, background processes can run only after a timeout of 15

minutes. If the device is registered, and 15 minutes time is passed, and the device is

connected to the internet, the tracking data is reported to the server and is visible in this view.

The user has also been given an option to export this data in excel format. Tracking view is

shown in Figure 4.11 and Figure 4.12:

4.12 EXCEPTIONS

If the algorithm finds any tracking data as out of bounds, or any device that has not

reported, it lists all such data under the exceptions view as shown in Figure 4.13. The user is

not allowed to alter this data for security reasons. Similar to tracking data view, export to

Excel format functionality is provided in this view, to make the system more useful.

4.13 DATABASE DESIGN

The database repository is created using MySQL as the database system. WAMP

setup gives an option to use the phpmyadmin tool for quick and more visual access to the

database. The name of the database is “device_tracking” and there are various tables defined

in this database. The normalization concept is used for the database design. Commonly used

Page 33: DEVICE TRACKING OF WINDOWS 8 MOBILE DEVICES

23

Figure 4.11. Tracking data – View.

Figure 4.12. Tracking data – Export to excel format.

Page 34: DEVICE TRACKING OF WINDOWS 8 MOBILE DEVICES

24

Figure 4.13. Exception data.

data is stored separately in parameter tables, in order to avoid frequent changes in the code.

This style of coding also allows a more human approach (e.g. preferred_location table allows

to give name and description for the location. The user can create boundary points for each of

these locations). The various tables and their uses are listed in Table 4.1.

4.14 ALGORITHM

Two different algorithms are used to generate exceptions on the tracked data of the

devices.

1. NotReporting algorithm

2. OutOfBounds algorithm

NotReporting algorithm fetches data from database, and checks if the device has

reported within some pre-decided interval. If the device record is not found, the device gets

added to the exception list. OutOfBound algorithm [6] fetches the data from the database,

and checks if the reported location was within the preferred location bounds. The algorithm

basically uses the concept that, a horizontal line is drawn through the reported location point.

If there are odd numbers of intersections with the polygon sides (preferred location polygon

boundaries) on each side of the current recorded data point, then the recorded location is

Page 35: DEVICE TRACKING OF WINDOWS 8 MOBILE DEVICES

25

Table 4.1. Database Design

TABLE NAME TABLE USE

user To store user details of the registered users.

device To store the device information of the registered devices.

user_device To store mapping between user and device table.

device_status To store parameters for device status. This simplifies data

processing for exceptions generating algorithms.

preferred_location To store parameters for preferred location. Human cannot

remember latitude and longitude numbers for boundary points

directly. This table allows to store name and description for

the preferred location.

boundary_point To store boundary points for the preferred locations stored in

preferred_location table.

location_device Single device can have multiple preferred locations.

Location_device table is used to store the mapping between

device table and preferred location table.

coordinate To store device tracking information (latitude and longitude

data reported by the devices that are registered with the

system.)

event_log To store logging information on the website.

exception To store exception information of the devices. This

information is used for the quick view on the website.

exception_cause To store parameters for exceptions. This technique enhances

modularity approach.

exception_user To store mapping between exception table and user table.

parameter To store commonly used data values e.g. admin email, server

name etc. This coding practice makes the system less error

prone by avoiding multiple changes.

Page 36: DEVICE TRACKING OF WINDOWS 8 MOBILE DEVICES

26

inside the preferred area. If there are even numbers of nodes on each side of the current

recorded data point, then the recorded location is outside the preferred area.

This is explained in Figure 4.14:

Figure 4.14. Point-in-polygon algorithm.

Page 37: DEVICE TRACKING OF WINDOWS 8 MOBILE DEVICES

27

CHAPTER 5

CONCLUSION AND OBSTACLES FACED

5.1 PROJECT FEATURES

WinRT based metro style app, allows registering and running background process on

Windows 8 platform based devices. The logic implemented at server side allows maximum

use of the available data.

5.2 GENERAL FEATURES

Metro UI: App UI is the focal point of the user experience on Windows 8. Well-designed animations bring to life and make the experience feel crafted. Use of touch interactions keep user in control and confident. The app includes consistent and performant set of user interactions compiling to the guidelines given by Microsoft [7].

Reusability: The application is designed in modular fashion to accomplish reusability. Most commonly used data is stored in the form of parameters in the database tables.

Security: The MD5 hashing function is used to secure the password entered by user. MD5 is designed to be very fast and efficient, thus making the login process fast.

Minimal memory utilization: The coding is done very carefully to accomplish usage of less memory as well as less data transfer over the network. With the Windows 8 platform, every background process gets time of 2 seconds in periodic time (every 15 minutes). Care has been taken to finish the process of location tracking and reporting within 2 seconds. Testing with the laptop and the tablet has shown that the tracking and reporting is done in less than 2 seconds.

High performance software suite: Very unique combination of different technologies is used to make system fast, reliable and less error prone. WinRT at mobile device, Apache server with PHP support, Codeigniter and Grocery CRUD frameworks, MySQL as database and C/C++ for coding algorithm to process exception data.

High-performance and human approach to Data Access: MySQL database provides faster data access. Codeigniter allows M-V-C approach, which makes code more readable, while Grocery CRUD allows displaying this data in more human approach.

5.3 SUMMARY

The Device Tracker metro style app registers background process with the native

Windows 8 OS. The background process runs after every 15 minutes, reporting its locational

information to the server. Apache server provides various configuration options to the device

owner. System is designed based on data-mining techniques to make best use of the available

Page 38: DEVICE TRACKING OF WINDOWS 8 MOBILE DEVICES

28

information. The devices that are not reporting or the devices that go out of bounds are raised

with exception. Thus Device Tracker app gives the user complete control of his/her devices.

5.4 CONCLUSION

The system is developed using the unique combination of different technologies.

System always takes care to reduce memory utilization, power utilization and network usage.

Being a legitimate combination in its implementation pattern, the project covers a fresh way

to the development in Windows 8 based applications. The basic project architecture, various

assumptions made while designing this project and limitations of the system are discussed in

a comprehensive manner. I envision that the outcome of this project makes the life of parents

and team managers much more comfortable.

5.5 OBSTACLES

Following challenges were faced during the project development:

1. Restricting the scope of the project was a big challenge. Single use case added to the project was opening multiple new threads.

2. Integrating the Grocery CRUD framework with the Codeigniter framework needed some extra efforts. But ultimately the results were achieved.

3. Some challenges were faced due to WinRT restrictions. Such as, background process registered with the Windows 8 OS can only run once in every 15 minutes.

A lot of exploration of technologies was done and different techniques were used to

overcome most of the obstacles.

Page 39: DEVICE TRACKING OF WINDOWS 8 MOBILE DEVICES

29

CHAPTER 6

FUTURE WORK

Although the project is complete in itself, few enhancements to the project can be

done as further improvements.

6.1 FUTURE IMPROVEMENTS

Developing a control app which can provide the device owner with all the functionalities which are provided by the website.

Server can be programmed to send alerts to the device owner whenever device exception is raised. A broadband app can be developed which can accept these alerts and the device owner can be informed about the device exception on the go.

6.2 EASING OF LIMITATIONS

1. The user is assumed to have a GPRS enabled mobile device with Windows 8 OS.

2. With the current WinRT structure, background process registered with the OS is allowed to run only after 15 minutes for the span of 2 seconds. User is assumed to have a device which has internet connectivity, so as to post the device tracking information to the server.

Page 40: DEVICE TRACKING OF WINDOWS 8 MOBILE DEVICES

30

REFERENCES

[1] M. DE LCAZA, WinRT demystified. Tirania, http://tirania.org/blog/archive/2011/Sep-15.html, accessed March 2013, last modified September 2011.

[2] B. SCHOOLEY, Windows 8 development tips #3: What is WinRT. Infragistics, http:// www.infragistics.com//community/blogs/brent_schooley/archive/2012/12/06/windows-8-development-tips-3-what-is-winrt.aspx, accessed March 2013, last modified December 2012.

[3] MICROSOFT, Developer downloads for programming Windows store apps. Microsoft, http://msdn.microsoft.com/en-US/windows/apps/br229516.aspx, accessed March 2013, n.d.

[4] WIKIPEDIA, CodeIgniter. Wikipedia, http://en.wikipedia.org/wiki/CodeIgniter, accessed March 2013, n.d.

[5] ORACLE CORPORATION, Chapter 1: General information. MySQL, http://dev.mysql.com/doc/refman/5.6/en/introduction.html, accessed March 2013, n.d.

[6] D. R. FINLEY, Point-In-Polygon algorithm – Determining whether a point is inside a complex polygon. Alienryderflex, http://alienryderflex.com/polygon/, accessed March 2013, n.d.

[7] MICROSOFT, Index of UX guidelines for Windows store apps. Microsoft, http://msdn.microsoft.com/en-us/library/windows/apps/hh465424.aspx, accessed March 2013, n.d.

Page 41: DEVICE TRACKING OF WINDOWS 8 MOBILE DEVICES

31

APPENDIX

GLOSSARY

Page 42: DEVICE TRACKING OF WINDOWS 8 MOBILE DEVICES

32

OS : Operating System

iOS : I phone Operating System

M-V-C : Model – View – Controller

CRUD : Create Read Update Delete

SQL : Structured Query Language

UX : User eXperience

WinRT : Windows Run Time

ECMA : European Computer Manufacturers Association

WAMP : Windows, Apache, MySQL, and PHP

GPRS : General Packet Radio Switching

MD5 : Message Digest Algorithm

PHP : Hypertext Preprocessor

COM : Component Object Model

API : Application Programming Interface

XAML : Extensible Application Markup Language