Top Banner
Smart City Guide 1 1. INTRODUCTION Tourists come from different places and they are new to city they don’t know about cities, cultures of the people, local language to communicate and how to approach. Tourist’s guides are the persons who guide the tourists about the city like visiting places, their importance and how to approach by taking money from them. Tourist guides take money from them by telling lies and cheating them. To overcome these problems an efficient and SMART CITY concept has been implemented. With the increasing popularity of mobile phones, city guide on a mobile is more desirable than website. Smart city guide is a mobile app for Bangalore city, which provides information related to the city for mobile users conveniently. All information about the Bangalore city will be available in a single place like tourist places, restaurants, Hangouts, Events this week, Week end gateways. It also makes use of Google map features to allow effective navigation. It may even help to refer the history of a particular place. Once can learn more detailed information of the places , and hence would replace tourist guide. The Mobile application installed on the mobile of tourist can act as a guide. Additionally, the application would help user to find out the weather forecast of the place, distance Department of Computer Science, Christ University
68
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: City Guide Chapters

Smart City Guide 1

1. INTRODUCTION

Tourists come from different places and they are new to city they don’t know about

cities, cultures of the people, local language to communicate and how to approach.

Tourist’s guides are the persons who guide the tourists about the city like visiting places,

their importance and how to approach by taking money from them. Tourist guides take

money from them by telling lies and cheating them. To overcome these problems an

efficient and SMART CITY concept has been implemented. With the increasing

popularity of mobile phones, city guide on a mobile is more desirable than website.

Smart city guide is a mobile app for Bangalore city, which provides information related

to the city for mobile users conveniently.  All information about the Bangalore city will

be available in a single place like tourist places, restaurants, Hangouts, Events this week,

Week end gateways.  It also makes use of Google map features to allow effective

navigation. It may even help to refer the history of a particular place. Once can learn

more detailed information of the places , and hence would replace tourist guide.

The Mobile application installed on the mobile of tourist can act as a guide. Additionally,

the application would help user to find out the weather forecast of the place, distance of

the place from current location, Google map, Famous spots etc.

Smart city guide offers below services:

1. It retrieves the user’s current geological information

2. It provides information about the tourist sites, popular hangouts, restaurants etc

3. It displays images of the famous tourist spots, hotels etc

4. It makes use of Google Map features to allow effective navigation.

Department of Computer Science, Christ University

Page 2: City Guide Chapters

Smart City Guide 2

1.1 PROBLEM STATEMENT

After the Android Operating system is developed for mobile the human life has become

so easy that the every day to day activity can be managed using a mobile application

(APP) .This Android application helps tourists to find places who had come from

different cities. There are many such applications which has been already developed, but

if we research on the functionality of this applications, we may notice that most of the

applications are web based applications.

The project is to investigate the realization of City Guide over the platform of Android.

One City Guide should contains some functionalities like automatic localization,

navigation support, retrieving information from points of interests,, adding reviews, and

so on. Moreover, the project should explore current innovational technologies as many as

possible and put them as building blocks like Google Map

1.2 OBJECTIVE

The Smart City is an online guide that provides information about business in the

categories of dining, entertainment, retail, travel and other services in the city

1.3 SCOPE

The Mobile user should be able to search appropriate location. The Mobile user should be

able to retrieve information for Bangalore city. The user can also be able to retrieve full

information like address, contact number, latitude and longitude for the any selected

category

1.4 EXISTING SYSTEM

In Existing system the person who are visiting a particular city need to gather information

from the person who is staying in the city or take the help of the guide in the city or the

person should visit few websites. The user should gather of all these information to visit

the city. In order to get each piece of information we need to go for help desk or we need

to take help of Google.

These posses a lot of time and pre-planning is required.

Department of Computer Science, Christ University

Page 3: City Guide Chapters

Smart City Guide 3

1.5 DISADVANTAGES OF EXISTING SYSTEM

1.5.1 Lack of Flexibility

Organized tours often have a time limit and you might find that you have to leave the site

before you have finished exploring. Tours also might follow a set route or visit only the

main attractions of a site. One solution would be to take a guided tour to learn the basic

information about the place, then return alone at a later date.

1.5.2 Cost

Employing a tour guide can be expensive, particularly if yours is only a small group, as

the cost usually is per day or trip, not per person. If you are traveling alone, it is more

economical to purchase a good-quality guidebook and read as much information as possi-

ble about the site you are visiting beforehand.

1.5.3 City Guide Websites

Several web sites for a city guide exist but may not come in handy. With the advent of

smart phones, mobile applications are more desirable.

1.6 PROPOSED SYSTEM

The proposed system entitled as "Smart City Guide" is an Mobile App". In the proposed

system the details of the Bangalore App is shown in a single application. It provides

Routes, Navigation, distance other details. The nearest hotels and the nearest hangouts for

the particular location are shown to make the journey of the user easy. It displays the

address along with the phone number. It contains the complete information about

Bangalore city like places to be visit, site maps route maps, restaurants, hang outs etc.

This app can be used by any person who is having general knowledge about internet. All

the users should install the app to know about the Bangalore city.

Department of Computer Science, Christ University

Page 4: City Guide Chapters

Smart City Guide 4

After a detailed study of the existing system and the requirement analysis this proposed

system will handle the following.

1.6.1 Mobile applications

The idea of developing standalone applications for regular mobile phones is a recent

phenomenon. The introduction of smart phones enabled the move from Website solutions

to standalone applications (Web App), and introduced new opportunities for creating

mobile services which comes in handy.

1.6.2 Smartphone’s

There is no widely agreed upon definition of what a Smartphone really is, but it is often

described as a mobile phone that runs an open operating system, with the ability to add

applications from third parties. City guide app is installed in Smartphone to know

information about Bangalore city.

1.6.3 Location sensing technologies

Location is one of the more important context variables a system can utilize, and a

number of technologies for determining the current location of a device exist.

1.6.4 GPS – Global Positioning System

GPS sends signals from a number of satellites encircling the earth to a receiver, enabling

it to determine its current location. GPS is becoming increasingly widespread, and many

high end mobile phones now have GPS receivers built in. However, GPS receivers do not

work very well indoors or around high rise buildings, and a GPS receiver will drain the

battery faster on mobile devices.

1.6.5 Wi-Fi localization

This technology uses an algorithm to calculate a user’s position based on data from

available Wi-Fi access points. Depending on environment characteristics, accuracy is

calculated to be in the range of 13-40 meters, which means it is considerably less precise

than GPS. However, unlike GPS technology, Wi-Fi localization will work both indoors

and outdoors.

Department of Computer Science, Christ University

Page 5: City Guide Chapters

Smart City Guide 5

In addition, Wi-Fi technology is built into many mobile devices that are not equipped

with GPS, which makes Wi-Fi localization the most precise positioning technology for

such devices.

1.6.6 Network based positioning

A third way of finding a user’s position is through cell network localization. This

technology is based on measuring the signal from various base stations nearby, and from

that calculating a user’s position. In many ways this is similar to Wi-Fi localization, but

on a bigger scale. However, there are some drawbacks; it must be supported by the

mobile operator, which may want to take money for such aservice, and precision is only

in the range of 50 meters.

1.7 ADVANTAGES OF PROPOSED SYSTEM

1. The user interface is easy to read on small screens.

2. Major city details in a single application

3. Easy to access

4. Google Map shows the users current position

5. The system makes the overall project management much easier and flexible.

6. Navigation technology takes user to the desired destination

Department of Computer Science, Christ University

Page 6: City Guide Chapters

Smart City Guide 6

2. SYSTEM ANALYSIS

2.1 FUNCTIONAL REQUIREMENTS

2.1.1 CUSTOMER REQUIREMENTS

The app should meet all the business requirements. . Time and Cost being the major

factors in business, the app should be fast enough to meet the business needs and also

help in reduce unnecessary expenses. The Mobile app should include a user friendly

interface that reduces the effort put in by the user.

2.1.2 USERS

The app should be developed considering the users who will be utilizing it for tourist

visits. The users should be able to access the app from their Android mobiles. The users

should be guaranteed of their business security and confidentiality as the app is going to

be a city guide.

2.1.3 INTENDED USE

The app should provide a portal to describe about their line of business. The main feature

to be developed is that the user should be able to view the places available in the city.

2.1.4 EXPECTATIONS

All information about the Bangalore city will be available in a single place like tourist

places, restaurants, Hangouts, Events this week, Week end gateways.  It also makes use

of Google map features to allow effective navigation. It may even help to refer the history

of a particular place. Once can learn more detailed information of the places, and hence

should replace tourist guide.

Department of Computer Science, Christ University

Page 7: City Guide Chapters

Smart City Guide 7

2.1.5 CHALLENGES

The app should be designed in such a way that even a common man should be able to

understand without any ambiguity.

2.2 SYSTEM REQUIREMENTS

The software requirements identified for developing the application are

1. Eclipse with ADT plugin

2. Android SDK

3. Google Maps Android API v2

4. OpenGL ES version 2 (to render the map)

5. Php Webservices(API).

6. Php version 5.3.1

7. Linux Server

8. MySql 5.0

2.2.1 SOFTWARE REQUIREMENTS

2.2.1.1 ECLIPSE

Eclipse is a multi-language software development environment comprising a workspace

and an extensible plug-in system. It is written mostly in Java. It can be used to develop

applications in Java and, by means of various plug-in, other programming languages.

This plug-in mechanism is a lightweight software component framework. In addition to

allowing the Eclipse Platform to be extended using other programming languages such as

C and Python, the plug-in framework allows the Eclipse Platform to work with

typesetting languages like LaTeX, networking applications such as telnet and database

management systems. The plug-in architecture supports writing any desired extension to

the environment, such as for configuration management. Java and CVS support is

provided in the Eclipse SDK, with support for other version control systems provided by

third-party plug-ins. The Eclipse SDK includes the Eclipse Java development tools

(JDT), offering an IDE with a built-in incremental Java compiler and a full model of the

Department of Computer Science, Christ University

Page 8: City Guide Chapters

Smart City Guide 8

Java source files. This allows for advanced refactoring techniques and code analysis. The

IDE also makes use of a workspace, in this case a set of metadata over a flat file space

allowing external file modifications as long as the corresponding workspace "resource" is

refreshed afterwards.

2.2.1.2 Android SDK

Android software development is the process by which new applications are created for

the Android operating system. Applications are usually developed in the Java

programming language using the Android Software Development Kit, but other

development tools are available. The Android software development kit (SDK) includes a

comprehensive set of development tools. These include a debugger, libraries, a handset

emulator based on QEMU, documentation, sample code, and tutorials. Enhancements to

Android's SDK go hand in hand with the overall Android platform development. Android

applications are packaged in .apk format and stored under /data/app folder on the Android

OS (the folder is accessible only to the root user for security reasons). APK package

contains .dex files (compiled byte code files called Dalvik executables), resource files,

etc.

2.2.1.3 Google Maps Android API v2

Google Maps is a desktop and mobile web mapping service application and technology

provided by Google, offering satellite imagery, street maps, and Street View

perspectives, as well as functions such as a route planner for traveling by foot, car,

bicycle (beta test), or with public transportation. Also supported are maps embedded on

third-party websites via the Google Maps API, and a locator for urban businesses and

other organizations in numerous countries around the world. Google Maps satellite

images are not updated in real time; however, Google adds data to their Primary Database

on a regular basis, and most of the images are no more than 3 years old

Department of Computer Science, Christ University

Page 9: City Guide Chapters

Smart City Guide 9

2.2.1.4 OpenGL ES version 2 (to render the map)

OpenGL (Open Graphics Library) is a cross-language, multi-platform application

programming interface (API) for rendering 2D and 3D vector graphics. The API is

typically used to interact with a graphics processing unit (GPU), to achieve hardware-

accelerated rendering. The OpenGL specification describes an abstract API for drawing

2D and 3D graphics. Although it is possible for the API to be implemented entirely in

software, it is designed to be implemented mostly or entirely in hardware.

2.2.1.5 PHP WEBSERVICES API

It is used to communicate with server to get data’s

2.2.1.6 PHP

PHP is a server-side scripting language designed for web development but also used as a

general-purpose programming language. PHP code can be simply mixed with HTML

code, or it can be used in combination with various templating engines and web

frameworks. PHP code is usually processed by a PHP interpreter, which is usually

implemented as a web server's native module or a Common Gateway Interface (CGI)

executable. After the PHP code is interpreted and executed, the web server sends

resulting output to its client, usually in form of a part of the generated web page – for

example, PHP code can generate a web page's HTML code, an image, or some other data.

PHP has also evolved to include a command-line interface (CLI) capability and can be

used in standalone graphical applications.[8]

2.2.1.7 LINUX SERVER

A Linux server is a high-powered variant of the Linux open source operating system

that's designed to handle the more demanding needs of business applications such as net-

work and system administration, database management and Web services.

Department of Computer Science, Christ University

Page 10: City Guide Chapters

Smart City Guide 10

Linux servers are frequently selected over other server operating systems for their stabil-

ity, security and flexibility advantages. Leading Linux server operating systems include

CentOS, Debian, Ubuntu Server, Slackware and Gentoo.

2.2.1.8 MY SQL

MySQL is a popular choice of database for use in web applications, and is a central

component of the widely used LAMP open source web application software stack (and

other 'AMP' stacks). LAMP is an acronym for "Linux, Apache, MySQL,

Perl/PHP/Python." MySQL is a relational database management system (RDBMS), and

ships with no GUI tools to administer MySQL databases or manage data contained within

the databases. Users may use the included command line tools, or use MySQL "front-

ends", desktop software and web applications that create and manage MySQL databases,

build database structures, back up data, inspect status, and work with data records. The

official set of MySQL front-end tools, MySQL Workbench is actively developed by

Oracle, and is freely available for use.

2.2.1.9 WINDOWS OS

Microsoft Windows is a series of graphical interface operating systems developed,

marketed, and sold by Microsoft. The most recent client version of Windows is Windows

8. To develop the application Windows 7 or higher is required.

2.2.2 HARDWARE REQUIREMENTS

1. Intel Pentium 4 processor or higher.

2. Minimum RAM of 512mb.

3. Free disk space of 40 GB or more.

4. 1024 x 768 resolution monitor.

Department of Computer Science, Christ University

Page 11: City Guide Chapters

Smart City Guide 11

2.2.3 TECHNOLOGY

Technologies used are

Mobile Application:

1. Android

2. GPS (for getting user’s current location)

3. GPRS (for internet connectivity between mobile and server)

2.2.3.1 Android

Android is a mobile operating system (OS) based on the Linux kernel and currently

developed by Google. With a user interface based on direct manipulation, Android is

designed primarily for touchscreen mobile devices such as smartphones and tablet

computers, with specialized user interfaces for televisions (Android TV), cars (Android

Auto), and wrist watches (Android Wear). The OS uses touch inputs that loosely

correspond to real-world actions, like swiping, tapping, pinching, and reverse pinching to

manipulate on-screen objects, and a virtual keyboard. Despite being primarily designed

for touchscreen input, it also has been used in game consoles, digital cameras, and other

electronics.

2.2.3.2 GPS

The Global Positioning System (GPS) is a space-based satellite navigation system that

provides location and time information in all weather conditions, anywhere on or near the

Earth where there is an unobstructed line of sight to four or more GPS satellites. The

system provides critical capabilities to military, civil and commercial users around the

world. It is maintained by the United States government and is freely accessible to

anyone with a GPS receiver.

Department of Computer Science, Christ University

Page 12: City Guide Chapters

Smart City Guide 12

2.2.3.3 GPRS

General packet radio service (GPRS) is a packet oriented mobile data service on the

2G and 3G cellular communication system's global system for mobile communications

(GSM). GPRS was originally standardized by European Telecommunications Standards

Institute (ETSI) in response to the earlier CDPD and i-mode packet-switched cellular

technologies. It is now maintained by the 3rd Generation Partnership Project (3GPP).

GPRS usage is typically charged based on volume of data transferred, contrasting with

circuit switched data, which is usually billed per minute of connection time. Usage above

the bundle cap is either charged per megabyte or disallowed.

GPRS is a best-effort service, implying variable throughput and latency that depend on

the number of other users sharing the service concurrently, as opposed to circuit switch-

ing, where a certain quality of service (QoS) is guaranteed during the connection. In 2G

systems, GPRS provides data rates of 56–114 kbit/second. 2G cellular technology com-

bined with GPRS is sometimes described as 2.5G, that is, a technology between the sec-

ond (2G) and third (3G) generations of mobile telephony. It provides moderate-speed

data transfer, by using unused time division multiple access (TDMA) channels in, for ex-

ample, the GSM system.

Department of Computer Science, Christ University

Page 13: City Guide Chapters

Smart City Guide 13

3. SYSTEM DESIGN

3.1 SYSTEM ARCHITECTURE

Figure 3.1: Over All System Architecture

Department of Computer Science, Christ University

Page 14: City Guide Chapters

Smart City Guide 14

3.1.2 MODULE ARCHITECTURE

Figure 3.2: Module Architecture

Department of Computer Science, Christ University

Page 15: City Guide Chapters

Smart City Guide 15

3.2 MODULE DESIGN

The smart city app contains the following modules:

1. Tourist attractions

2. Restaurants

3. Hangouts

4. Events of the week

5. Week end gateways

6. Google Map

7. Location Navigator

8. Settings

9. Location Based Information

Modules Description:

3.2.1. Tourist attraction: It contains information about famous popular tourist places at

Bangalore. Once the user clicks the smart city app from the mobile, list of modules will

be displayed. Once the user clicks on the tourist attractions, all the tourist places will be

displayed

LalbaughVidhana SoudhaVishwesharaya

MuseumCubbon parkNational Park

If the user clicks on any of the tourist place, detailed information regarding the selected

tourist place will be displayed. It also displays information about the distance from the

user’s current location. Google map feature will help the user for navigation.

3.2.2. Restaurants: It contains information about the famous restaurants. Once the user

clicks on restaurants, the below categories will be displayed

ChineseSouth IndianSnacks cornersSea food North Indian

Department of Computer Science, Christ University

Page 16: City Guide Chapters

Smart City Guide 16

On click of each category, a list of restaurants will open up. On click of each restaurant,

some static information like address, costs shows up.

3.2.3. Hangouts: It displays information about the hang outs in a city like cafes, sports

bar, Malls and pubs. On click of each category , say cafes a list of cafes should be

displayed. A screens with static information will be displayed.

CafesSports barsMallsPubsTheme parks

3.2.4. Events this week: It shows the popular events of the week. It pulls up information

from the site like book my show.

Puppet showComedy showOne Nite stand- Live MusicDance with Kapoor

On clicking on each category a static information will be displayed. Google map feature

will help the user for navigation.

3.2.5. Weekend getaways- Information about the places around Bangalore (resorts etc)

for short weekend trips.

Nandi HillsShivanasamudramSavandurga HillsMadhugiri fortWine tour (Grover Zampa vineyards)Skandagiri

On click on each, a static screen with information is displayed.

3.2.6. Location Finder: This module is responsible to retrieve user’s current latitude and

longitude using GPS.

3.2.7. Settings: This module allows user to set some settings for the applications

Department of Computer Science, Christ University

Page 17: City Guide Chapters

Smart City Guide 17

3.2.8. Location Based Information: This module provides the timely updates and

activities happening around a particular place.

3.3 DATABASE DESIGN

The tables used in the data base are normalized. Database normalization, is a technique

for designing relational database tables to minimize duplication of information and, in so

doing, to safeguard the database against certain types of logical or structural problems,

namely data anomalies. The normal forms are applicable to individual tables; to say that

an entire database is in normal form n is to say that all of its tables are in normal form.

 

First normal form:

 The normalization process involves getting our data to conform to progressive normal

forms, and a higher level of normalization cannot be achieved unless the previous levels

have been satisfied. The first normal form requires that the values in each column of a ta-

ble are atomic.

 

Second Normal form:

 It deals with the relationships between composite key columns and non-key columns. To

achieve Second normal form, tables must already be in First normal form.

 Third Normal form:

 Third normal form requires that all columns depend directly on the primary key. Tables

violate the Third Normal form when one column depends on another column, which in

turn depends on the primary key.

3.3.1 TABLE DESIGN

Department of Computer Science, Christ University

Page 18: City Guide Chapters

Smart City Guide 18

3.3.1.1 DIMENSION TABLES

3.3.2 DATA DICTIONARY

Field Name Data Type Description

ID int (11) Primary Key

Title varchar(500)

Description varchar(500)

image varchar(500)

type varchar(500)

complete_address varchar(500)

latitude varchar(500)

longitude varchar(500)

3.3.3 DATA FLOW DIAGRAM

Department of Computer Science, Christ University

DIM_PLACESN _ID [P]V_TITLEV_DESCRIPTIONV_IMAGEV_TYPEV_ADDRESSV_LATITUDEV-LONGITUDE

Page 19: City Guide Chapters

Smart City Guide 19

Figure 3.3: Context Level3.3.4 USE CASE DIAGRAM

Department of Computer Science, Christ University

Smart City Mobile App

User

Restaurants

1

1 Restaurant Details

2 Hangouts

4 Navigation

5 MapLocation Finder

4

Google Map

5

Hangouts

2

Tourist Spots

3

Page 20: City Guide Chapters

Smart City Guide 20

Figure 3.4: Use Case Diagram

3.3.5 SEQUENCE DIAGRAM

Department of Computer Science, Christ University

Page 21: City Guide Chapters

Smart City Guide 21

3.3.5.1 SEQUENCE DIAGRAM TO SELECT CATEGORIES

Figure 3.5: Sequence diagram to select categories like Restaurants, Hang outs

Business Logic:

Actor : User

Description: The purpose of this system feature is to provide various categories available

for Bangalore city.

1. User selects the categories. List of categories like Restaurants, Hangouts etc

2. Selected category is forwarded to controller

3. Category is searched in the database

4. Result is displayed on the user interface

3.3.5.2 SEQUENCE DIAGRAM TO SEARCH LOCATION

Department of Computer Science, Christ University

Page 22: City Guide Chapters

Smart City Guide 22

Figure 3.6: Sequence diagram to search location

Business Logic:

Actor : User

Description: The purpose of this system feature is to provide user to select location

1. User selects the location.

2. Selected location is forwarded to controller

3. Location is searched in the database

4. Result is displayed on the user interface

3.3.5.3 SEQUENCE DIAGRAM TO GET THE CURRENT LOCATION

Department of Computer Science, Christ University

Page 23: City Guide Chapters

Smart City Guide 23

Figure 3.7: Sequence diagram to get current location

Business Logic:

Actor : User

Description: The purpose of this system feature is to get the current location and display

the nearby restaurants, hang outs etc

1. GPS detects the current location of the user

2. List of nearby places will be displayed for the user

3. Google map is displayed with list of places

4. Result is displayed on the user interface

4. IMPLEMENTATION

Department of Computer Science, Christ University

Page 24: City Guide Chapters

Smart City Guide 24

CODING

The goal of the coding or programming phase is to translate the design of the system

produced during the design phase into code in a given programming language which can

be executed by a computer, and which performs the computation specified by the design.

For a given design, the aim is to implement the design in the best possible manner.The

coding phase affects both testing and maintenance profoundly. As we saw earlier, the

time spent in coding is a small percentage of the total software cost, while testing and

maintenance consume the major percentage. Thus it should be clear that the goal during

coding should be to reduce the cost of later phases, even if it means that the cost of this

phase has to increase. In other words, the goal during this phase is not to simplify the job

of the tester and the maintainer.

PROGRAMMING PRACTICE

Top-Down and Bottom-Up

The design of a software system consists of a hierarchy of modules. The main program

involves subordinate modules. In a top down implementation, the implementation starts

from the top of the hierarchy, and then proceeds to the lower level. In a bottom-up

implementation, the process is the reverse.

Structured Programming

Much emphasis is based on structured programming, although the concept and

motivation behind structured programming is often not well understood. Structured

programming is often regarded as goto-less programming.It has a static structure as well

as dynamic structure. The static structure is the structure of the text of the program which

is usually just a linear organization of statements of the program. The dynamic structure

of the program is the sequence in which statements are executed during the program

Information Hiding

Department of Computer Science, Christ University

Page 25: City Guide Chapters

Smart City Guide 25

To reduce coupling between modules of a system it is best that different modules be

allowed to access and modify only those data items that are needed by them. The other

data should be hidden from such modules and the modules should not be allowed to

access these data items.

4.1 SAMPLE CODES

Department of Computer Science, Christ University

Page 26: City Guide Chapters

Smart City Guide 26

4.1.1 Code to check if location can be retrieved from GPS or Network Service Provider

4.1.2 Main Class

Department of Computer Science, Christ University

public class CheckNetwork {

// Check Internet connectionpublic boolean isNetworkAvailable(Context context) {

// ConnectivityManager class Monitors network connec-tions

ConnectivityManager connectivityManager = (Connectivity-Manager) context

.getSystemService(Context.CONNECTIVITY_SER-VICE);

NetworkInfo activeNetworkInfo = connectivityManager.getActiveNetworkInfo();

return activeNetworkInfo != null && activeNetwork-Info.isConnected();

}

}

Page 27: City Guide Chapters

Smart City Guide 27

4.1.3 Class to parse the JSON array obtained:-

Department of Computer Science, Christ University

public class MainActivity extends ActionBarActivity implements OnClick-Listener ,LocationListener{

Button tourist_attractions;Button restaurant;Button hang_outs;Button event_this_week;Button weekend_gateways;PullData pullData ;double mLattitude;double mLongitude;Intent ListActivity;

@Overrideprotected void onCreate(Bundle savedInstanceState) {

super.onCreate(savedInstanceState);this.setRequestedOrientation(Activity-

Info.SCREEN_ORIENTATION_PORTRAIT);

setContentView(R.layout.activity_main);findviewbyid();tourist_attractions.setOnClickListener(this);restaurant.setOnClickListener(this);hang_outs.setOnClickListener(this);event_this_week.setOnClickListener(this);weekend_gateways.setOnClickListener(this);

LocationManager locationManager = (LocationManager) getSystem-Service(LOCATION_SERVICE);

// Creating a criteria object to retrieve providerCriteria criteria = new Criteria();

// Getting the name of the best providerString provider = locationManager.getBestProvider(criteria,

true);// Getting Current Location From GPSLocation location = locationManager.getLastKnownLocation(pro-

vider);

if(location!=null){onLocationChanged(location);

}

locationManager.requestLocationUpdates(provider, 20000, 0, this);

}

public class PlaceJSONParser {

/** Receives a JSONObject and returns a list */public List<HashMap<String,String>> parse(JSONObject jObject){

JSONArray jPlaces = null;try {

/** Retrieves all the elements in the 'places' array */

jPlaces = jObject.getJSONArray("results");} catch (JSONException e) {

e.printStackTrace();}/** Invoking getPlaces with the array of json object * where each json object represent a place */return getPlaces(jPlaces);

}

Page 28: City Guide Chapters

Smart City Guide 28

4.1.4 The AndroidManifest.xml file which declares all the activities:-

Department of Computer Science, Christ University

Page 29: City Guide Chapters

Smart City Guide 29

4.1.5 Activities

Department of Computer Science, Christ University

<?xml version="1.0" encoding="utf-8"?><manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.rahul.maptest" android:versionCode="1" android:versionName="1.0" >

<uses-sdk android:minSdkVersion="8" android:targetSdkVersion="21" />

<uses-permission android:name="android.permission.INTERNET" /> <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> <uses-permission android:name="com.google.android.providers.gs-f.permission.READ_GSERVICES" /> <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" /> <uses-permission android:name="android.permission.ACCESS_FINE_LOC-ATION" /> <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/> <uses-feature android:glEsVersion="0x00020000" android:required="true"/>

<application android:allowBackup="true" android:icon="@drawable/ic_launcher" android:label="@string/app_name" android:theme="@style/AppTheme" > <activity android:name=".MainActivity" android:label="@string/app_name" > <intent-filter> <action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.cat-egory.LAUNCHER" /> </intent-filter> </activity>

Page 30: City Guide Chapters

Smart City Guide 30

4.1.6 MapActivity Code:-

Department of Computer Science, Christ University

<activity android:name=".ShowLocation" android:label="@string/app_name" > </activity> <activity android:name=".MapActivity" android:label="@string/app_name" > </activity> <activity android:name=".PlacesListActivity" android:label="@string/app_name" > </activity>

<meta-data android:name="com.google.android.gms.version" android:value="4323000" /> <meta-data android:name="com.google.android.maps.v2.API_KEY" android:value="AIzaSyDb3-m-5A7xx4Z4xD8ecHqjHpA_9JHBNmQ" /> </application>

</manifest>

Page 31: City Guide Chapters

Smart City Guide 31

4.1.7 Array Adapter for Place Types

4.1.7 Array Adapter for Place Types

Department of Computer Science, Christ University

public class MapActivity extends FragmentActivity implements OnClick-Listener, OnInfoWindowClickListener, LocationListener,OnMarkerClick-Listener {

GoogleMap mGoogleMap;Button findButton;Spinner locSpinner;

// LocationManager locationManager;CheckNetwork checkNetwork;

String[] mPlaceType=null;String[] mPlaceTypeName=null;

double mLatitude=0;double mLongitude=0;

@Overrideprotected void onCreate(Bundle savedInstanceState) {

super.onCreate(savedInstanceState);this.setRequestedOrientation(Activity-

Info.SCREEN_ORIENTATION_PORTRAIT);

setContentView(R.layout.map_activity);

findButton = (Button) findViewById(R.id.btnFind);locSpinner = (Spinner) findViewById(R.id.locSpinner);

// Set to listen on click eventsfindButton.setOnClickListener(this);// Array of place typesmPlaceType = getResources().getStringArray(R.ar-

ray.place_type);

// Array of place type namesmPlaceTypeName = getResources().getStringArray(R.ar-

ray.place_type_name);// Array of place type namesmPlaceTypeName = getResources().getStringArray(R.ar-

ray.place_type_name);

Page 32: City Guide Chapters

Smart City Guide 32

4.1.8 Internet Availability

Department of Computer Science, Christ University

// Creating an array adapter with an array of Place types// to populate the spinnerArrayAdapter<String> adapter = new

ArrayAdapter<String>(this, android.R.lay-out.simple_spinner_dropdown_item, mPlaceTypeName);

locSpinner.setAdapter(adapter);

checkNetwork = new CheckNetwork();

int status = GooglePlayServicesUtil.isGooglePlaySer-vicesAvailable(getBaseContext());

if(status!=ConnectionResult.SUCCESS){ // Google Play Services are not available

int requestCode = 10;Dialog dialog = GooglePlayServicesUtil.getError-

Dialog(status, this, requestCode);dialog.show();

}else { // Google Play Services are available

// Getting reference to the SupportMapFragmentSupportMapFragment fragment = ( SupportMapFrag-

ment) getSupportFragmentManager().findFragmentById(R.id.map);

// Getting Google MapmGoogleMap = fragment.getMap();

// Enabling MyLocation in Google MapmGoogleMap.setMyLocationEnabled(true);

mGoogleMap.setOnInfoWindowClickListener(this);

// Getting LocationManager object from System Ser-vice LOCATION_SERVICE

LocationManager locationManager = (LocationMan-ager) getSystemService(LOCATION_SERVICE);

// Creating a criteria object to retrieve providerCriteria criteria = new Criteria();

// Getting the name of the best providerString provider =

locationManager.getBestProvider(criteria, true);// Getting Current Location From GPSLocation location = locationManager.getLastKnown-

Location(provider);

Page 33: City Guide Chapters

Smart City Guide 33

4.1.9 Google place Json data

Department of Computer Science, Christ University

if(location!=null){onLocationChanged(location);

}

locationManager.requestLocationUpdates(provider, 20000, 0, this);

}}@Overridepublic void onClick(View v) {

switch (v.getId()) {case R.id.btnFind:

if(checkNet-work.isNetworkAvailable(getBaseContext()))

{// we will check the internet availabilty once

it is availble we will send following variables to google services// 1. Nearby location & 2. Users selected

type like Restaurant, Hospitals, etc

int selectedPosition = locSpinner.getSelected-ItemPosition();

String type = mPlaceType[selectedPosition];

StringBuilder sb = new String-Builder("https://maps.googleapis.com/maps/api/place/nearbysearch/json?");

sb.append("location="+mLatitude+","+mLongit-ude);

sb.append("&radius=5000");sb.append("&types="+type);sb.append("&sensor=true");sb.append("&key=AIzaSyAj3Gv5AYuQWPlD826k-

SuoA36W84uo5es0");

// Creating a new non-ui thread task to download Google place json data

PlacesTask placesTask = new PlacesTask();

// Invokes the "doInBackground()" method of the class PlaceTask

placesTask.execute(sb.toString());

}else{

// we will tell user to connect to internet by giving toast noatification

String message = "Please check internet con-nection try again";

Toast.makeText(getBaseContext(), message, Toast.LENGTH_LONG).show();

}break;

default:break;

}}@Overridepublic void onInfoWindowClick(Marker arg0) {

// Show the Full Address here dialogue here

new AlertDialog.Builder(this) .setTitle("Complete Address") .setMessage(arg0.getTitle()) .setPositiveButton("OK", new DialogInter-

face.OnClickListener() { public void onClick(DialogInterface dia-

log, int which) { dialog.dismiss(); } }) .setIcon(android.R.drawable.ic_dialog_alert) .show();

}

Page 34: City Guide Chapters

Smart City Guide 34

4.2 SCREEN SHOTS

4.2.1 CITY GUIDE MENU

4.2 SCREEN SHOTS

Department of Computer Science, Christ University

Page 35: City Guide Chapters

Smart City Guide 35

4.2.1 CITY GUIDE MENU

Figure 4.1: City Guide Menu

Department of Computer Science, Christ University

Page 36: City Guide Chapters

Smart City Guide 36

4.2.2 TOURIST ATTARACTIONS

Figure 4.2: Tourist Attractions

4.2.3 MAP VIEW

Department of Computer Science, Christ University

Page 37: City Guide Chapters

Smart City Guide 37

Figure 4.3: Map View

4.2.4 RESTAURANTS

Department of Computer Science, Christ University

Page 38: City Guide Chapters

Smart City Guide 38

Figure 4.4: Restaurants

4.2.5 HANG OUTS

Department of Computer Science, Christ University

Page 39: City Guide Chapters

Smart City Guide 39

Figure 4.5: Hang outs

4.2.6 WEEKEND GATEWAYS

Department of Computer Science, Christ University

Page 40: City Guide Chapters

Smart City Guide 40

Figure 4.6: Weekend Gateways

5. TESTING

Department of Computer Science, Christ University

Page 41: City Guide Chapters

Smart City Guide 41

Software testing is the process used to measure the quality of developed computer

software. The separation of debugging from testing was initially introduced by Glenford

J.Myres in 1979. Usually, quality is constrained to such topics as correctness,

completeness, security, but can also include more technical requirements as described

under the ISO standard ISO 9126, such as capability, reliability, efficiency, portability,

maintainability, compatibility and usability. Testing is process of technical investigation,

performed on behalf of stakeholders, that is intended to reveal quality-related information

about the product with respect to the context in which it is intended to operate. This

included, but is not limited to, the process of executing a program or application with the

intent of finding errors.

A good test is sometimes described as one which reveals an error; however, more recent

thinking suggests that a good test is Sone which reveals information of interest to

someone who matters within the project community, as a tests will measure quality and

therefore May well be unable to find any error, because the software works the way it

was specified.

5.1 UNIT TESTING

Unit testing tests the minimal software component, or module. Each unit of the software

is tested to verify that the detailed design for the unit has been correctly implemented.

Unit testing is a procedure used to validate that individual units of source code are

working properly. A unit is the smallest testable part of an application. In procedural

programming a unit may be an individual program, function, procedure, etc., while in

object-oriented programming, the smallest unit is always a Class; which may be a

base/super class, abstract class or derived/child class. Units are distinguished from

modules in that modules are typically made up of units.

The goal of unit testing is to isolate each part of the program and show that the individual

parts are correct. A unit test provides a strict, written contract that the piece of code must

satisfy. As a result, it affords several benefits.

Department of Computer Science, Christ University

Page 42: City Guide Chapters

Smart City Guide 42

Features:

Facilitates Change

Simplifies Integration

Documentation

Separation of interface from implementation

Unit testing will not catch every error in the program. By definition, it only tests the

functionality of the units themselves. Therefore, it will not catch integration errors,

performance problems or any other system-wide issues. In addition, it may not be easy to

anticipate all special cases of input the program unit under study may receive in reality.

Unit testing is only effective if it used in conjunction with other software testing

activities.

5.2 INTEGRATION TESTING

Integration testing exposes defects in the interfaces and interaction between integrated

components. Progressively larger groups of tested software components corresponding to

elements of the architectural design are integrated and tested until the software works as a

whole.

Integration testing is the phase of software testing in which individual software modules

are combined and tested as a group. It follows unit testing and precedes system

testing.Integration testing takes as its input modules that have been unit tested, groups

them in larger aggregates, applies tests defined in an integration test plan to those

aggregates, and delivers as its output the integrated system ready for system testing.

The different types of integration testing are:

Big Bang

Bottom Up

5.3. SYSTEM TESTING

Department of Computer Science, Christ University

Page 43: City Guide Chapters

Smart City Guide 43

System testing is testing conducted on a complete, integrated system to evaluate the

system’s compliance with its specified requirements. System testing falls within the

scope of black box testing, and as such, should require no knowledge of the inner design

of the code or logic.

As a rule, systems testing rakes, as its input, all of the “integrated” software components

that have successfully passed integration testing and also the software system itself

integrated with any applicable hardware system.

5.4. ACCEPTANCE TESTING

Acceptance testing can be conducted by the end-user, customer or client to validate

whether or not to accept the product. Acceptance testing can be performed after the

testing and before the implementation phase.It is the black box testing performed on a

system in most environments, acceptance testing by the system provider is distinguished

from acceptance testing by the customer. It generally involves running a suite of tests on

the completed system.

5.5. WHITE BOX TESTING

It uses an internal perspective of the system to design cases based on internal structure. It

requires programming skills to identify all paths through the software. The tester chooses

test case inputs to exercise paths through the code determines the appropriate outputs.

It includes:

a. Control flow testing

b. Data flow testing

5.6. BLACK BOX TESTING

It takes an external perspective of the test object to derive test cases. These tests can be

functional or non-functional. The designer selects valid and invalid input and determines

the correct output. There is no knowledge of the test objects internal structure his method

Department of Computer Science, Christ University

Page 44: City Guide Chapters

Smart City Guide 44

of test design is applicable to all levels of software testing unit, integration, functional

testing, system and acceptance. This method can uncover unimplemented parts of the

specification, one cannot be sure that all existent paths are tested.

5.7 TEST CASES

Test Case1

Title: City Guide

Description: User wants to know about the city

Actor: User

Pre- Condition: User should install the Smart city guide app on the mobile

Action: User clicks on the City guide app

Expected Result: City Guide app should display various modules

Test Case2

Title: Various Modules in City Guide App

Description: It displays the various modules in the app

Actor: User

Pre-Condition: User should install the Smart city guide app on the mobile

Action:

Step 1: Click on the Smart City Guide App

Step 2 : View the Various Modules

Expected Result: City Guide App should display the modules in the following order

a. Tourist Attractions

b. Restaurants

c. Hangout

d. Temples

e. Weekend Gateways

Test Case 3:

Department of Computer Science, Christ University

Page 45: City Guide Chapters

Smart City Guide 45

Title: User Clicks on Tourist Attractions

Description: It displays the various Tourist Attractions in Bangalore City

Actor: User

Pre- Condition: User should install the Smart city guide app on the mobile and should

click on the app

Action: User clicks on the module “Tourist Attractions”

Expected Result: List of Tourist Attractions should displayed along with the image and

description about the selected place.

Test Case 4:

Title: User selects an option from Tourist Attraction

Description: It displays the Address information in the Map View

Actor: User

Pre- Condition:

a. User should install the Smart city guide app on the mobile and should click on the

app

b. User should click on the module “Tourist Attractions”

Action: User clicks on one category from the module “Tourist Attractions”

Expected Result: Map view should be displayed along with the address information.

Test Case 5:

Title: User Clicks on Restaurants

Description: It displays the various Restaurants in Bangalore City

Actor: User

Pre- Condition: User should install the Smart city guide app on the mobile and should

click on the app

Action: User clicks on the module “Restaurants”

Expected Result: List of Restaurants should be displayed along with the image and

description about the selected place.

Test Case 6:

Department of Computer Science, Christ University

Page 46: City Guide Chapters

Smart City Guide 46

Title: User selects an option from Restaurants

Description: It displays the Address information in the Map View

Actor: User

Pre- Condition:

a. User should install the Smart city guide app on the mobile and should click on the

app

b. User should click on the module “Restaurants”

Action: User clicks on one category from the module “Restaurants”

Expected Result: Map view should be displayed along with the address information.

Test Case 7:

Title: User Clicks on Hangouts

Description: It displays the various Hangouts in Bangalore City

Actor: User

Pre- Condition: User should install the Smart city guide app on the mobile and should

click on the app

Action: User clicks on the module “Hangouts”

Expected Result: List of Hangouts should be displayed along with the image and

description about the selected place.

Test Case 8:

Title: User selects an option from Hangouts

Description: It displays the Address information in the Map View

Actor: User

Pre- Condition:

a. User should install the Smart city guide app on the mobile and should click on the

app

b. User should click on the module “Hangouts”

Action: User clicks on one category from the module “Hangouts”

Expected Result: Map view should be displayed along with the address information.

6. CONCLUSION

Department of Computer Science, Christ University

Page 47: City Guide Chapters

Smart City Guide 47

The objective of the project is to build a City Guide Mobile App for Tourists who are

visiting the city for the first time or they do not know any details about the city. The City

Guide Mobile App has been built and is ready to use with some technical issues. There

can be future enhancement where in many other features can be included which can make

the package more comfortable to work on for the organization.

5.1 DESIGN AND IMPLEMENTATION ISSUES

One major issue in the design and implementation is that UI is not Eye Catching. There

were few development issues like non-functioning of few modules. Integration of the two

modules is not possible at the current stage of the project.

5.2 ADVANTAGES AND DISADVANTAGES

Advantages:

1. The user interface is easy to read on small screens.

2. Major city details in a single application

3. Easy to access and it is handy

4. Google Map shows the users current position

5. The system makes the overall project management much easier and flexible.

6. Navigation technology takes user to the desired destination

Disadvantages:

1. It displays details about only one city

2. Limited information is provided about the places

3. Based on the current location, nearest places are displayed.

4. Search functionality should be implemented.

Department of Computer Science, Christ University

Page 48: City Guide Chapters

Smart City Guide 48

5.3 FUTURE ENHANCHEMENTS

The final project is capable of implementing the proposed features providing access to a

variety of users using the same interface. The proportion of data may sometimes hinder

the project speed of loading and running. The reports serve the purpose as thought.

Search functionality should be implemented to find all the places in the city.

Department of Computer Science, Christ University

Page 49: City Guide Chapters

Smart City Guide 49

7.0 REFERENCES

BIBILOGRAPHY

Books:

[1] Reto Meier, Professional Android 4 Application Development New York: Oxford UP

[2] O'Reilly, Learning Android

[3] Wei-Meng , Beginning Android Development

[4] Rick Rogers, Android Application Development: Programming with the Google SDK,

John Lumbardo Oct 1 2000

[5] Sheran Gunasekara, Android Apps Security

[6] Herve Guihot, Pro Android App Performance Optimization

Department of Computer Science, Christ University