Você está na página 1de 75

INTELLIGENT TOURIST SYSTEM

ACKNOWLEGEMENT
The success and final outcome of this project required a lot of guidance and assistance. We
take this opportunity to express a deep sense of gratitude to Ms Shelja, Trainer Regional
Center of Entrepreneurship, for her cordial support, valuable information and guidance, who
helped us in completing this task through various stages. We are obliged to staff members of
Regional Center of Entrepreneurship, for the valuable information provided by them in their
respective fields. We are grateful for their cooperation during the period of our project.
We are thankful to all those people who stood by us throughout the training & supported us in
our project.

Balpreet Singh
1145966
B.Tech (IT)

1 | Page

INTELLIGENT TOURIST SYSTEM

ABOUT THE COMPANY

Alcanttor Information Solutions Pvt. Ltd.


The education of a country defines the progressive path it's heading towards. In this age of
ever growing competitive technology, Alcanttor acts as a guiding light for you to shape your
own career.Alcanttor Information Solutions Pvt. Ltd. Is a leading software company and
offers Human-Centered solutions to help businesses thrive in a connected world with huge
clientele all over the world.
Alcanttor Information Solutions Pvt. Ltd. Having offices at Mississauga, Ontario, Canada and
at Jaipur, Rajasthan, India. Alcanttor showcases best of both worlds that India has to offer. It
empowers you with knowledge and skill set to become a successful and employable engineer
who may pursue his or her own dreams. Be it the aim of getting placed there in giant MNCs
or be it the passion of being an independent entrepreneur / freelancer we will have you
realize those goals and can achieve them.Alcanttor offers humancentered solutions to help
businesses thrive in a connected world. Ever expanding world of software technologies is our
domain and we bring the power to our solutions. We deliver what we promise.
Alcanttor Information Solutions Pvt. Ltd. is a Software Company majorly focusing
on the following:

Providing cost-effective and efficient project deliveries to our client.

Providing corporate training to Employees of the company on Emerging


Technologies.

Meeting the day-to-day demands of the Industry for hiring skilled youth.

Making the youth available to the companies by their joint participation in our
Industry Ready Programs.

A group of entrepreneurs across India empowers the Alcanttor Information Solutions Pvt.
Ltd. The highly skilled team provides next generation technology services to the world with a
vision to proof our country as a giant in workforce and quality of service providers.
2 | Page

INTELLIGENT TOURIST SYSTEM

ALCANTTORS OFFERINGS
1. Trainings: We team with the young engineers and technical enthusiasts to provide them
training and project guidance in Java, Android, PHP and CMS systems. Trainees will have
handson experience for industrial projects which we run as pilot initiations.
2. Services:We provide project based services in:
a. Staffing Solutions
b. Entrepreneurship Club
c. Certifications
d. Corporate Training

ALCANTTOR VISION AND VALUES


VISION
To be the most admired training company in India.
VALUES I H R 3

Integrity In all we do

Honesty In all our actions

Reliability To get the job done

Results Because actions speak louder than words

Respect For each other, always

3 | Page

INTELLIGENT TOURIST SYSTEM

PREFACE

The travel and tourism industry is a global (and a globalization) industry, with very specific
features .Travel and tourism represents approx. 11% of the world wide GDP (following the
tourism satellite account method of the World Travel & Tourism Council). It represents a
cross-sectoral industry, including many related economic sectors such as culture, sport or
agriculture.
Tourism is vital to the well being of many countries, because of the income generated by
the consumption of goods and services by tourists, the taxes levied on businesses in the
tourism industry and the opportunity for employment and economic advancement by
working in the industry. While travelling main problem faced by tourists is to search the
place where they want to go. Our application helps the tourists to search the nearby places
so that they could make their plan. Nearby Search is based on current location of person
which is detected with the help of GPS technology.

4 | Page

INTELLIGENT TOURIST SYSTEM

ABSTRACT

Objective
Tourism is vital to the well being of many countries, because of the income generated by
the consumption of goods and services by tourists, the taxes levied on businesses in the
tourism industry and the opportunity for employment and economic advancement by
working in the industry. While travelling main problem faced by tourists is to search the
place where they want to go. Our application helps the tourists to search the nearby places
so that they could make their plan visit the spots which they desire. Nearby Search is based
on current location of person which is detected with the help of GPS technology.
Need to choose
This project reduces the money and manpower required to do a guide for our travelling. We
also dont need to visit different sites on the internet before visiting a place.
Material and Method
In this Project we have used android sdk tools to design our application. Different activity
pages have been linked together. In the back end data of the user is maintained in SQLite
database. GPS connectivity has been done through Google Api.
Industry Application
Our application can help in promoting travel & tourism and taxi services. It can help
tourists to contact travel and tourism agents and hire taxi services. Travel and tourism
agencies can pay to post their ads on our application.

5 | Page

INTELLIGENT TOURIST SYSTEM

TABLE OF CONTENTS
S.No

CONTENTS

INTRODUCTION

TECHNOLOGY USED

TESTING TOOL

FEASIBILITY STUDY

REQUIREMENT ANALYSIS

MODULAR DESCRIPTION OF JOB

DATAFLOW DIAGRAM

DETAILED ANALYSIS OF INDIVIDUAL MODULE

SNAPSHOTS

10

CONCLUSION AND FUTURE SCOPE

11

BIBLIOGRAPHY

INTRODUCTION
1) Intelligent Tourism System
6 | Page

INTELLIGENT TOURIST SYSTEM

Now-a-days the necessity of executing things is increasing rapidly in our daily activities.
Technology plays a vital role in day to day activities. Similarly, this project Intelligent
Tourism System serves the need of the users and tourism management system. Technology
reduces the paper work and even a lot of time is saved by using the online app on their smart
phones and exploring their favourite touring places at just a single click ahead. We took up
the project to develop app, encode in ANDROID for online tourism.

2)Functional Components
There are two functional components in the Intelligent Tourism System namely:

User End

Back End

User End: The project Intelligent Tourism System deals with real time procedure of a user
wanting to visit different places. The user when plays the app can search for nearby places he
wants to visit to know more about the place. User can save the trip plan like the name of the
place where he wants to visit, duration of trip and the things he/she likes to do there.
Back End: In the back end data of the user is stored in SQLite database. New users are
requested to sign up for the application. User information like name, username, password and
security question and answer are stored in database. Trip plan of the user is also stored in the
database.

TECHNOLOGY USED
1.Java
7 | Page

INTELLIGENT TOURIST SYSTEM

Java is a programming language. It was first developed by James Gosling at Sun


Microsystems, which is now a part of Oracle Corporation. It was released in 1995 as a part of
Sun

Microsystems' Java

platform.

The

language

has

developed

much

of

its syntaxfrom C and C++. Java applications are usually compiled to byte code (class file)
that can run on any Java Virtual Machine (JVM). Java is currently one of the most popular
programming languages being used. It has about 10 million users. Sun Microsystems has
renamed the new J2 versions as Java SE, Java EE and Java ME respectively. Java is
guaranteed to be Write Once, Run Anywhere .
We have used java version 1.6 version in our application.

Java is an object-oriented language similar to C++, but simplified to eliminate


language features that cause common programming errors.

It is basically it is a general purpose programming language with a number of features


that make the language well suited for use on the World Wide Web.

Java source code files (files with a .java extension) are compiled into a format
called byte code (files with a .class extension), which can then be executed by a
Java interpreter.

Compiled Java code can run on most computers because Java interpreters and runtime
environments, known as Java Virtual Machines (JVMs), exist for most operating
systems, including UNIX, the Macintosh OS, and Windows. Byte code can also be
converted directly into machine language instructions by a just in time compiler (JIT).

Small Java applications are called Java applets and can be downloaded from a Web
server and run on your computer by a Java-compatible Web browser, such
as Netscape Navigator or Microsoft Internet Explorer.

8 | Page

INTELLIGENT TOURIST SYSTEM

ADVANTAGES
It is platform independent.
It is simple, small and familiar.
It is multithreaded
It is dynamic and extensible.
It is robust and secure.

Ease of development.

Good scalability and performance.

It is object oriented.

It is portable.

1.ANDROID
The Android software development kit (SDK) includes a comprehensive set of development
tools. These

include

a debugger,

libraries,

handset emulator based

on QEMU,

documentation, sample code, and tutorials. Currently supported development platforms


include computers running Linux (any modern desktop Linux distribution), Mac OS X 10.5.8
or later, and Windows XP or later. As of March 2015, the SDK is not available on Android
itself, but the software development is possible by using specialized Android applications.
Until around the end of 2014, the officially supported integrated development
environment (IDE) was Eclipse using the Android Development Tools (ADT) Plugin, Net
Beans IDE also supports Android development via a plugin. As of 2015, Android Studio,
made by Google and powered by IntelliJ, is the official IDE; however, developers are free to
use others. Additionally, developers may use any text editor to edit Java and XML files, then
use command line tools (Java Development Kit and Apache Ant are required) to create, build
and debug Android applications as well as control attached Android devices (e.g., triggering a
reboot, installing software package(s) remotely).
Enhancements to Android's SDK go hand in hand with the overall Android platform
development. The SDK also supports older versions of the Android platform in case
9 | Page

INTELLIGENT TOURIST SYSTEM

developers wish to target their applications at older devices. Development tools are
downloadable components, so after one has downloaded the latest version and platform, older
platforms and tools can also be downloaded for compatibility testing.
Android applications are packaged in .apk format and stored under folder /data/app 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.

We have used android V4.4.2 in our application with API 19 because android is emerging in
this world of upcoming technology very fast.

Android is a software bunch comprising not only operating system but also
middleware and key applications.

With a user interface based on direct manipulation, android a computing platform is


designed primarily for touch screen mobile devices such as Smart phones and tablet
computers, with specialized user interfaces for televisions (Android TV), cars
(Android Auto), and wrist watches (Android Wear).

It is owned by Google, Inc., which includes an operating system, software, and


applications.

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 touch screen input, it also has been used
in game consoles, digital cameras, regular PCs and other electronics.

The operating system is based on Linux, which provides advanced computer


processing.

Android technology is maintained and continually developed by the Android Open


Source Project (AOSP).

After original release there have been number of updates in the original version of
Android.
10 | P a g e

INTELLIGENT TOURIST SYSTEM

Android gives you a world-class platform for creating apps and games for android
users everywhere, as well as an open marketplace for distributing to them instantly.

Androids openness has made it a favourite for consumers and developers alike,
driving strong growth in app consumption.

Android users download more than 1.5 billion apps and games from Google Play
each month.

With its partners, Android is continuously pushing the boundaries of hardware and
software forward to bring new capabilities to users and developers.

For developers, Android innovation lets you build powerful, differentiated


applications that use the latest mobile technologies.

Android gives you everything you need to build best-in-class app experiences.

It gives you a single application model that lets you deploy your apps broadly to
hundreds of millions of users across a wide range of devices from phones to tablets
and beyond.

Android also gives you tools for creating apps that look great and take advantage of
the hardware capabilities available on each device. It automatically adapts your UI to
look its best on each device, while giving you as much control as you want over your
UI on different device types.

To help you develop efficiently, the Android Developer Tools offer a full Java IDE
with advanced features for developing, debugging, and packaging Android apps.

Using the IDE, you can develop on any available Android device or create virtual
devices that emulate any hardware configuration.

11 | P a g e

INTELLIGENT TOURIST SYSTEM

Android kitkat gives us android's most innovative, most beautiful and most useful
features to more devices everywhere.

Android 4.4 is designed to run fast, smooth, and responsively on a much broader
range of devices than ever before including on millions of entry-level devices around
the world.

KitKat streamlines every major component to reduce memory use and introduces
new APIs and tools to help you create innovative, responsive, memory-efficient
applications.

Features added in kitkat 4.4.2:

Secure Transactions :
It introduces new platform support for secure NFC-based transactionsthrough Host
Card Emulation (HCE), for payments, loyalty programs, card access, transit passes,
and other custom services. With HCE, any app on an Android device can emulate an
NFC smart card, letting users tap to initiate transactions with an app of their choice no
provisioned secure element (SE) inthe device is needed. Apps can also use a new
reader mode to act as readers for HCE cards and other NFC-based transactions.

Printing Framework :
It gives native support for printing, along with APIs for managing printing an dadding
new types of printer support. The platform provides a print manager that mediates
between apps requesting printing and installed print services that handle print
requests.The manger provides shared services and a system UI for printing, giving
users consistent control over printing from any app ensuring the security of content as
it's passed across processes, from an app to a print service.

Display :
It provides screen recording utility that lets you start and stop recording on a device
that's connected to your Android SDK environment over USB.
Better Memory Management:
KitKat is designed to run on devices with as little as 512MB of RAM.

Immersive mode:
It hides everything except the app youre using. We can just swipe the edge of the
screen to bring back your status bar and navigation buttons.
12 | P a g e

INTELLIGENT TOURIST SYSTEM

Improved power manager :New version of stamina mode and additional power
management tool to set the syncing of background data of apps in intervals rather than
simultaneously.

Storage access framework:


A new storage access framework makes it simple for users to browse and open
documents, images, and other files across all of their preferred document storage
providers. A standard, easy-to-use UI lets users browsefiles and access recent in a
consistent way across apps and providers.

Low power sensors:


It introduces platform support for hardware sensor batching, a new optimization that
can dramatically reduce power consumed by ongoing sensor activities.

Transitions framework for animating scenes:

The transitions framework lets you define scenes, typically view hierarchies, and transitions,
which describe how to animate or transform the scenes when the user enters or exits them.
We can also animate changes to your UI on the fly, without needing to define scenes.
These are the basics of Android applications:

Android applications are composed of one or more application components such as


activities, services, content providers, and broadcast receivers.

Each component performs a different role in the overall application behaviour, and
each one can be activated individually, even by other applications.

The manifest file must declare all components in the application and should also
declare all application requirements, such as the minimum version of Android
required and any hardware configurations required.

Non-code application resources like images, strings, layout files, etc. should include

13 | P a g e

INTELLIGENT TOURIST SYSTEM

alternatives for different device configurations such as different strings for different
languages

A software development kit (SDK) used to create applications, including the related
tools, plug-ins, and documentation

A run time used to execute and host Android applications, including the Dalvik
Virtual Machine (VM) and the core libraries that provide android specic
functionality. The run time is designed to be small and efficient for use on mobile
devices.

What do we need to develop Android applications?

JDK (version 6 or 7 required).

Eclipse (version 3.4-Ganymede or 3.5-Galileo, needed only if you want develop using
the ADT Plugin).

Base Android SDK . Download the Android SDK from the Android homepage. The
download contains a zip file which you can extract to any place in your file system,
e.g. I placed it under "C:\Program Files\android-sdk-windows.

Android Development Tools (ADT). Installing using Eclipse Update Manager as


shown in the next section of this tutorial is much easier

14 | P a g e

INTELLIGENT TOURIST SYSTEM

I.

Eclipse Update Manager for Android Development Tools (ADT)

Use the update manager of Eclipse to install all available plugins for the Android
Development Tools (ADT). From Eclipse, Help->Install New Software...

Fig 1
Type in URL "https://dl-ssl.google.com/android/eclipse/". Then, follow the directions.
Configuration
Next time (after you restart the Eclipse) we open up Eclipse for a new project, we will have
"Android"
project template as in the picture below.

Fig 2
But if you try to open up a new project, you will get error message related to the location of
Android SDK.

15 | P a g e

INTELLIGENT TOURIST SYSTEM

Fig 3
In Eclipse, open the Preferences dialog via Windows -> Preferences.
Select Android and type in the installation path of the Android SDK as the picture below

Fig 4
Select Window->Android SDK and AVD Manager from the menu.

Fig 5
Press "Install selected" and accept all package.

16 | P a g e

INTELLIGENT TOURIST SYSTEM

Fig 6
After the installation restart Eclipse.

17 | P a g e

INTELLIGENT TOURIST SYSTEM

II.

Device for Emulation - Android Virtual Devices

For emulation, we need to define a device.


Select Window -> Android SDK and AVD Manager from the menu.

Fig 7
Press "New", then you are about to create a New AVD as the picture below.

Fig 8
Press "Create AVD" button.
Then you will have this message from Android SDK and AVD Manager.

Fig 9
You have created AVD.

18 | P a g e

INTELLIGENT TOURIST SYSTEM

Fig 10
To test if your setup is correct, select your device and press "Start".

Fig 11
Check the "Scale display to real size" at the Launch Options window below.

Fig 12
At the Launch button, you will have the device, finally.

Fig 13

19 | P a g e

INTELLIGENT TOURIST SYSTEM

III.

Android Development Tools

Before we start a new project, let us get used to our tools.


The Android SDK includes several tools and utilities to help us create, test, and debug our
projects. ADT plug-in incorporates most of tools into the Eclipse IDE, where you can access
them from the DDMS perspective, including:

Android SDK and Virtual Device Manager


Used to create and manage Android Virtual Devices (AVD) and SDK packages. The
AVD hosts an emulator running a particular build of Android, letting you specify the
supported SDK version, screen resolution, SD card storage etc. So, you might have
several AVDs for different set of hardware.

Android Emulator
An implementation of the Android virtual machine designed to run within a virtual
device on our development computer.

Dalvik Debug Monitoring Service (DDMS)


Use DDMS to monitor and control the Dalvik virtual machines on which we are
debugging our applications.

Android Asset Packaging Tool (AAPT)


Constructs the distributable Android package files.

Android Debug Bridge (ADB)


A client-server application that provides a link to a running emulator. It lets us copy
files, install compiled application package (.apk) and run shell commands.

Creating a New Project


Select File -> New -> Project... -> Android -> Android Project and create the Android project
as in the picture below.

20 | P a g e

INTELLIGENT TOURIST SYSTEM

Fig 14

Enter the details for your new project.

Project name the name of your project file

Package name specifies its java package

Create Activity lets you specify the name of a class that will be your initial
Activity (note) An Activity represents a screen that an application can present to its
users. The more complicated an application, the more screens it needs.

Application name friendly name for your application Min SDK Version the minimum
version of the SDK that your application will run on

Press "Finish"

You may get the following error message on the Problems tab field which is at the bottom
right side of Eclipse IDE when you open a new Android project:
The project cannot be built until the build path errors are resolved.
The project cannot be built until build path errors are resolved.
You can find quite a few solutions from the web. Some of them get around this problem by
using dummy libraries and some of them tweaks the /gen folder etc. What I've done was just
File->Exit and then fired up Eclipse again. Still, the message showed up and then magically
disappeared. Something's going on but do not know what that is.
21 | P a g e

INTELLIGENT TOURIST SYSTEM

This should see the following directory structure in the Package Explorer.

Fig 15
When you create a new Android project, you get several items in the project's root directory:

src / A folder that holds the Java source code

gen / This is where Android's build tools will place source code that they generate.
R.java" is a generated class which contains the text and the UI elements. Android
projects come with this free class 'R' which is short for Resource. This is an
automatically generated class that we can use to reference resources in our project. We
should not try to modify this class manually.

assets / A folder that holds other static files you wish packaged with the application
for deployment onto the device.

res / A folder that holds resources such as icons, graphic user interface (GUI) layouts,
etc. that are packaged with the compiled Java in the application.

AndroidMainFest.xml / An XML file describing the application being built and which
components (activities, services, and so on) are being supplied by the application.
This file is the foundation for any Android application. This is where you declare
what is inside your application. You also indicate how these pieces attach themselves
to the overall Android systems; for example, you can indicate which activity or
activities should appear on the device's main menu (a.k.a. the launcher). When you
create your application, a starter manifest will be generated for you automatically. For
a simple application, offering a single activity and nothing else, the auto generated
22 | P a g e

INTELLIGENT TOURIST SYSTEM

manifest will probably work out fine, or perhaps require a few minor modifications.
But on the other spectrum, the manifest file for the Android API demo suite is more
that 1,000 lines long. Your production applications will probably falls somewhere in
the middle. Most of the manifest will be describes detail in later chapters.

default. Properties Property files used by the Ant build script.

Creating an AVD
We need to run our application in the Android Emulator and before we can launch the
emulator, we must create an Android Virtual Device (AVD). An AVD defines the system
image

and

device

settings

used

by

the

emulator.

To create an AVD, use the "android" tool provided in the Android SDK. Open a command
prompt or terminal, navigate to the tools/ directory in the SDK package.

Fig 16
Then execute:
android create avd --target 2 --name my_avd

Fig 17
The tool now asks if you would like to create a custom hardware profile. For the time being,
press Return to skip it ("no" is the default response). That's it. This configures an AVD named
"my_avd" that uses the Android 1.6 platform. The AVD is now ready for use in the emulator.
23 | P a g e

INTELLIGENT TOURIST SYSTEM

In the above command, the --target option is required and specifies the deployment target to
run on the emulator. The name option is also required and defines the name for the new
AVD
Actually, if Android SDK with Android Development Tools (ADT) has been installed, we can
use SDK and AVD Manager instead of using the command "android ...."above.
Select Window -> Android SDK and AVD Manager from the menu.

Fig 18
Then we can see the AVD we've just made. As I said, we could have made it using this AVD
manager by clicking the New... button of this window.
Creating and running a New Android project
After creating an AVD, the next step is to start a new Android project in Eclipse.

From Eclipse, select File > New > Project.


If the ADT Plugin for Eclipse has been successfully installed, the resulting dialog
should have a folder labeled "Android" which should contain "Android Project".
(After you create one or more Android projects, an entry for "Android XML File" will
also be available.)

Select "Android Project" and click Next.

24 | P a g e

INTELLIGENT TOURIST SYSTEM

Fig 19

Fill in the project details with the following values:

Project name: HelloAndroid

Application name: Hello, Android

Package

name:

com.bogotobogo.helloandroid

(or

your

own

private

namespace)

Create Activity: HelloAndroid

Min SDK Version: 3

Fig 20
Click Finish.
Here is a description of each field:

Project Name

This is the Eclipse Project name , the name of the directory that will contain the project
files.

Application Name
This is the human-readable title for your application the name that will appear on the
Android device.
25 | P a g e

INTELLIGENT TOURIST SYSTEM

26 | P a g e

INTELLIGENT TOURIST SYSTEM

Package Name
This is the package namespace (following the same rules as for packages in the Java
programming language) that you want all your source code to reside under. This also
sets the package name under which the stub Activity will be generated.
Your package name must be unique across all packages installed on the Android
system; for this reason, it's very important to use a standard domain-style package for
your applications. The example above uses the "com.example" namespace, which is a
namespace reserved for example documentation when you develop your own
applications, you should use a namespace that's appropriate to your organization or
entity.

Create Activity
This is the name for the class stub that will be generated by the plugin. This will be a
subclass of Android's Activity class. An Activity is simply a class that can run and do
work. It can create a UI if it chooses, but it doesn't need to. As the checkbox suggests,
this is optional, but an Activity is almost always used as the basis for an application.

Min SDK Version


This value specifies the minimum API Level required by your application. If the API
Level entered here matches the API Level provided by one of the available targets,
then that Build Target will be automatically selected (in this case, entering "2" as the
API Level will select the Android 1.1 target). With each new version of the Android
system image and Android SDK, there have likely been additions or changes made to
the APIs. When this occurs, a new API Level is assigned to the system image to
regulate which applications are allowed to be run. If an application requires an API
Level that is higher than the level supported by the device, then the application will
not be installed.

27 | P a g e

INTELLIGENT TOURIST SYSTEM

Fig 21

Other fields
The checkbox for "Use default location" allows you to change the location on disk
where the project's files will be generated and stored. "Build Target" is the platform
target that your application

Running the Application


The Eclipse plugin makes it very easy to run our applications:
Select Run > Run.
Select "Android Application".
The Eclipse ADT will automatically create a new run configuration for our project and the
Android Emulator will automatically launch. Once the emulator is booted up, our application
will appear after a moment. We should now see something like this:

Fig 22
The "Hello, Android" you see in the grey bar is actually the application title. The Eclipse
plugin creates this automatically (the string is defined in the res/values/strings.xml file and
referenced by your AndroidManifest.xml file). The text below the title is the actual text that
you have created in the TextView object. That concludes the basic "Hello World" tutorial, but

28 | P a g e

INTELLIGENT TOURIST SYSTEM

you should continue reading for some more valuable information about developing Android
applications.

IV.

User Interface

In an Android application, the user interface is built using View and ViewGroup objects.
There are many types of views and view groups, each of which is a descendant of
the View class. When we look at the documentation, the View class is declared as:
View:
Extend: Object
implements Drawable.Callback KeyEvent.Callback
AccessibilityEventSource
And the ViewGroup is declared as:
ViewGroup
extends View
implements ViewManager ViewParent
View objects are the basic units of user interface expression on the Android platform. The
View class serves as the base for subclasses called "widgets," which offer fully implemented
UI objects, like text fields and buttons. The ViewGroup class serves as the base for subclasses
called "layouts," which offer different kinds of layout architecture, like linear, tabular and
relative.
A View object is a data structure whose properties store the layout parameters and content for
a specific rectangular area of the screen. A View object handles its own measurement, layout,
drawing, focus change, scrolling, and key/gesture interactions for the rectangular area of the
screen in which it resides. As an object in the user interface, a View is also a point of
interaction for the user and the receiver of the interaction events.

Fig 23
29 | P a g e

INTELLIGENT TOURIST SYSTEM

On the Android platform, you define an Activity's UI using a hierarchy of View and
ViewGroup nodes, as shown in the diagram above. This hierarchy tree can be as simple or
complex as you need it to be, and you can build it up using Android's set of predefined
widgets and layouts, or with custom Views that you create yourself.
In order to attach the view hierarchy tree to the screen for rendering, your Activity must call
the setContentView() method and pass a reference to the root node object: to inflate within an
Activity, usually within the onCreate() method, assetContentView() method accepts a
resource identifier
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
}
or as in the following example, to assign a user interface to an Activity, we can
call setContentView() method from the onCreate() method of our Activity. In the
example TextView is used as the Activity's user interface:
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
TextView tv = new TextView(this);
tv.setText("Hello, Android");
setContentView(tv);
}
The Android system receives this reference and uses it to invalidate, measure, and draw the
tree. The root node of the hierarchy requests that its child nodes draw themselves in turn,
each view group node is responsible for calling upon each of its own child views to draw
themselves. The children may request a size and location within the parent, but the parent
object has the final decision on where how big each child can be. Android parses the elements
of your layout in-order (from the top of the hierarchy tree), instantiating the Views and
adding them to their parent(s). Because these are drawn in-order, if there are elements that
overlap positions, the last one to be drawn will lie on top of others previously drawn to that
space.

30 | P a g e

INTELLIGENT TOURIST SYSTEM

V.

Widgets

A widget is a View object that serves as an interface for interaction with the user. Android
provides a set of fully implemented widgets, like buttons, checkboxes, and text-entry fields,
so we can quickly build our UI. Some widgets provided by Android are more complex, like a
date picker, a clock, and zoom controls. But we're not limited to the kinds of widgets
provided by the Android platform. If we want to do something more customized and create
our own actionable elements, we can, by defining our own View object or by extending and
combining existing widgets.
VI.Labels
The simplest widget is the label. Labels are a text that cannot be edited directly by users.
Typically, they are used to identify adjacent widgets.
We can create a label by creating a TextView instance. Or we can create labels in XML layout
files by adding a TextView element to the layout, with an android:text property to set the
value of the label itself. If we need to swap labels based on certain criteria, such as
internationalization, we may wish to use a resource reference in the XML instead.
TextView has numerous other properties of relevance for labels:
android:typeface
Set the typeface to use for the label (e.g., monospace).
android:textStype
Indicates that the typeface should be made bold, italic, or bold. and italic.
android:textColor
Sets the color of the label's text, (e.g., #0000ff for blue).

VII.CheckBox
java.lang.Object -> android.view.View -> android.widget.TextView -> android.widget.Button
-> android.widget.CompoundButton -> android.widget.CheckBox.
A checkbox is a specific type of two-state button that can be either checked or unchecked. It
has following properties:

isChecked()
Determines if the check box has been checked.

setChecked()
Forces the check box into a checked or unchecked state.

31 | P a g e

INTELLIGENT TOURIST SYSTEM

toggle()
Toggles the check box as if the user checked it.

We can register a listener object (in this case, an instance of OnCheckedChangeListener) to


be notified when the state of the check box changes.

Fig 24

VIII.RadioButton
java.lang.Object -> android.view.View -> android.widget.TextView -> android.widget.Button
-> android.widget.CompoundButton -> android.widget.RadioButton.
A radio button is a two-states button that can be either checked or unchecked. When the radio
button is unchecked, the user can press or click it to check it. However, contrary to a
CheckBox, a radio button cannot be unchecked by the user once checked.
Radio buttons are normally used together in a RadioGroup. When several radio buttons live
inside a radio group, checking one radio button unchecks all the others.
IX.Others
There are other componets like ListView, Gallery, Spinner, ViewFlipper, and the more
special-purpose AutoCompleteTextView, ImageSwitcher, QuickContactBadge, date-time
pickers, auto-complete input boxes, maps, tab sheets, and TextSwitcher.
ListView
A view that shows items in a vertically scrolling list. The items come from the ListAdapter
associated with this view.
Gallery
A view that shows items in a center-locked, horizontally scrolling list. The default values for
the Gallery assume you will be using Theme_galleryItemBackground as the background for
each View given to the Gallery from the Adapter. If you are not doing this, you may need to

32 | P a g e

INTELLIGENT TOURIST SYSTEM

adjust

some

Gallery

properties,

such

as

the

spacing.

Views given to the Gallery should use Gallery. LayoutParams as their layout parameters type.
Spinner
A view that displays one child at a time and lets the user pick among them. The items in the
Spinner come from the Adapter associated with this view.
ViewFlipper
A View Group that lets us define a collection of Views as a horizontal row in which only one
View is visible at a time, and in which transitions between visible views are animated.
AutoCompleteTextView
An editable text view that shows completion suggestions automatically while the user is
typing. The list of suggestions is displayed in a drop down menu from which the user can
choose

an

item

to

replace

the

content

of

the

edit

box

with.

The drop down can be dismissed at any time by pressing the back key or, if no item is
selected

in

the

drop

down,

by

pressing

the

enter/dpad

center

key.

The list of suggestions is obtained from a data adapter and appears only after a given number
of characters defined by the threshold.
ImageSwitcher
QuickContactBadge
Displays a badge showing the image icon assigned to a contact we specify using a phone
number, name, e-mail address, or URI. Clicking the image will display the quick contact bar,
which provides shortcuts for contacting the selected contact - including calling, sending an
SMS, e-mail, and IM.
TextSwitcher
Specialized ViewSwitcher that contains only children of type TextView. A TextSwitcher is
useful to animate a label on screen. Whenever setText(CharSequence) is called, TextSwitcher
animates the current text out and animates the new text in.

X.Selection Widgets
Android adapters provide a common interface to the data model behind the selection widgets.
They are responsible for providing the data for a selection widget, as well as for converting
individual elements of data into specific views to be displayed inside the widgets.
The easies adapter to use is ArrayAdapter. All we need to do is wrap around a Java array or
java.util. List instance. Then, we have a fully functional adapter:
String[] arr = {"My", "first", "Android", "list"};
33 | P a g e

INTELLIGENT TOURIST SYSTEM

new ArrayAdapter<String> (this,android.R.layout.simple_list_item_1, arr);


The ArrayAdapter constructor takes following three parameters:
The Context to use, typically, this will be our activity instance.
The resource ID of a view to use, for example, built in resource ID.
The actual array or list.
The ArrayAdapter will invoke toString() on the objects in the list and wrap each of those
strings in the view designated by the supplied resource.

XI.Toast
A toast is a view containing a quick little message for the user. The toast class helps you
create and show those. When the view is shown to the user, appears as a floating view over
the application. It will never receive focus. The user will probably be in the middle of typing
something else. The idea is to be as unobtrusive as possible, while still showing the user the
information you want them to see.

XII.DatePicker
A DatePicker is a widget that allows the user to select a month, day and year. java.lang.Object
-> android.view.View -> android.view.ViewGroup -> android.widget.FrameLayout ->
android.widget.DatePicker.

34 | P a g e

INTELLIGENT TOURIST SYSTEM

Fig 25

35 | P a g e

INTELLIGENT TOURIST SYSTEM

XIII.TimePicker
A TimePicker is a widget that allows the user to select the time by hour, minute and AM or
PM.

Fig 26

VI.

Clocks

Displaying time is really easy.

Fig. 27

XIV.Chronometer
Chronometer class that implements a simple timer. We can give it a start time in
the elapsedRealtime() timebase, and it counts up from that, or if we don't give it a base time,
it will use the time at which we call start(). By default it will display the current timer value
in the form "MM:SS" or "H:MM:SS", or we can use setFormat(String) to format the timer
value into an arbitrary string.

36 | P a g e

INTELLIGENT TOURIST SYSTEM

XV.TabWidget
A TabWidget offers the ability to easily draw an interface that uses tabs to navigate between
different views. It displays a list of tab labels representing each page in the parent's tab
collection. The container object for this widget is TabHost. When the user selects a tab, this
object sends a message to the parent container, TabHost, to tell it to switch the displayed
page. We typically won't use many methods directly on this object. The container TabHost is
used to add labels, add the callback handler, and manage callbacks. We might call this object
to iterate the list of tabs, or to tweak the layout of the tab list, but most methods should be
called on the containing TabHost object.

Fig 28

XVI.Flipper
In TabWidget examples, the contents of each tab were set to be a View. This is easy and
straightforward, but it is not the only option. We can also integrate another activity from our
application via an intent.
Intent is the way of specifying something we want accomplished, and then telling Android to
go find something to accomplish it. Intent is an abstract description of an operation to be
performed. It can be used with startActivity to launch an Activity,broadcastIntent to send it to
an interested BroadcastReceiver components, and startService(Intent) or bindService(Intent,
ServiceConnection, int) to communicate with a background Service. An Intent provides a
facility for performing late runtime binding between the code in different applications. Its
most significant use is in the launching of activities, where it can be thought of as the glue
between activities. It is basically a passive data structure holding an abstract description of an
action to be performed. The primary pieces of information in an intent are:

37 | P a g e

INTELLIGENT TOURIST SYSTEM

action The general action to be performed, such as ACTION_VIEW, ACTION_EDIT,


ACTION_MAIN, etc.

data The data to operate on, such as a person record in the contacts database,
expressed as a Uri.

Frequently, intents are used to cause activities to spawn. For example, whenever we launch
an application from the main Android application launcher, the launcher creates an Intent and
has Android open the activity associated with that Intent.
Sometimes, we want the overall effect of tabs, but we do not want the actual UI
implementation of tabs. Maybe the tabs take up too much screen space. Maybe we want to
switch between perspectives based on a gesture or a device shake.
Fortunately, we can find the same logic of view-flipping from tabs in ViewFlipper container,
which can be used in other ways that the regular tab.
ViewFlipper inherits from FrameLayout, in the same way we use it to describe the innards of
a TabWidget. However, initially, theViewFlipper container just shows the first child view. It is
up to us to arrange for the views to flip, either manually by user interaction or automatically
utilizing timer.

Fig 29

XVII.SlidingDrawer
Unlike most other Android containers, SlidingDrawer moves, switching from a closed to an
open position. This puts some restrictions on which container holds the SlidingDrawer. It
needs

to

be

in

container

that

allows

multiple

widgets

to

sit

atop

each

other. RelativeLayout and FrameLayout satisfy this requirement; FrameLayout is a container


purely for stacking widgets atop one another. On the flip side, LinearLayout does not allow
widgets to stack (they fall one after another in a row or column), and so we should not have
a SlidingDrawer as an immediate child of a LinearLayout.

38 | P a g e

INTELLIGENT TOURIST SYSTEM

XVIII.Menus
Menus offer a way to expose application functions without sacrificing valuable screen space.
Each Activity
can specify its own menu that's displayed when the device's menu button is pressed.
Application menus are another important part of an application's UI. Menus offer a reliable
interface that reveals application functions and settings. The most common application menu
is revealed by pressing the MENU key on the device. However, you can also add Context
Menus, which may be revealed when the user presses and holds down on an item.
Menus are also structured using a View hierarchy, but you don't define this structure
yourself.Instead,

you

define

the

onCreateOptionsMenu() or onCreateContextMenu

() callback methods for your Activity and declare the items that you want to include in your
menu. At the appropriate time, Android will automatically create the necessary View
hierarchy for the menu and draw each of your menu items in it.
Menus also handle their own events, so there's no need to register event listeners on the items
in

your

menu.When

an

item

in

your

menu

is

selected,

the onOptionsItemSelected() or onContextItemSelected() method will be called by the


framework.
XIX.Layouts
Layouts are extensions of the ViewGroup class used to position child controls for UI.
Layouts can be nested, letting us create arbitrarily complicated interfaces using a combination
of layouts. Android SDK includes some simple layouts to help us construct our UI. It's up to
us to select the right combination of layouts to make our interface easy to understand and use.
The following includes some of the more versatile layout classes available.

FrameLayout
The simplest of the layout, the Frame Layout simply pins each child view to the top
left corner. Adding multiple children stacks each new child on top of the one before,
with each new View obscuring the last.

LinearLayout
A Linear Layout aligns each child View in either a vertical or a horizontal line. A
vertical layout has a column of Views, while a horizontal layout has a row of Views.

39 | P a g e

INTELLIGENT TOURIST SYSTEM

The Linear Layout enables us to specify a "widget" for each child View that controls
the relative size of each within the available space.

RelativeLayout
The most flexible of the native layouts, the Relative Layout lets us define the
positions of each child View relative to the others and to the screen boundaries.

TableLayout
The Table Layout lets us lay out Views using a grid of rows and columns. Tables can
span multiple rows and columns, and columns can be set to shrink or grow.

Gallery
A Gallery Layout displays a single row of items in a horizontally scrolling list.

XX.VI Events
Once you've added some Views/widgets to the UI, you probably want to know about the
user's interaction with them, so you can perform actions. To be informed of UI events, you
need to do one of two things:

Define

an

event

listener

and

register

it

with

the

View.

More often than not, this is how you'll listen for events. The View class contains a
collection of nested interfaces named OnListener, each with a call back method called
On().

For example,

View.OnClickListener
for handling "clicks" on a View.

View.OnTouchListener
for handling touch screen events in a View.

View.OnKeyListener
for handling device key presses within a View.

So if you want your View to be notified when it is "clicked" (such as when a button is
selected), implement OnClickListener and define its onClick() callback method

40 | P a g e

INTELLIGENT TOURIST SYSTEM

(where you perform the action upon click), and register it to the View with
setOnClickListener().

Override an existing callback method for the View.


This is what you should do when you've implemented your own View class and want
to listen for specific events that occur within it. Example events you can handle
include:

onTouchEvent()
Called when the touchscreen is pressed or released, or when it detects
movement.

onTrackballEvent()
Called when the device's trackball is moved.

onKeyDown()
Called when any device key is pressed; includes the D-pad, keyboard, hangup, call, back, and camera buttons.

onKeyUp()
Called when a user releases a pressed key.

This allows you to define the default behavior for each event inside your custom View
and determine whether the event should be passed on to some other child View.
Again, these are callbacks to the View class, so your only chance to define them is
when you build a custom component.
XXI.Intent
Intent is

basically

message

that

is

passed

between components

(such

as Activities, Services, Broadcast Receivers, and Content Providers). So, it is almost


equivalent to parameters passed to API calls. The fundamental differences between API calls
and intents' way of invoking components are:

API calls are synchronous while intent-based invocations are asynchronous.

API calls are compile time binding while intent-based calls are run-time binding.

Of course, Intents can be made to work exactly like API calls by using what are
called explicit intents, which will be explained later. But more often than not, implicit intents
are the way to go and that is what is explained here.
41 | P a g e

INTELLIGENT TOURIST SYSTEM

One component that wants to invoke another has to only express its intent to do a job. And
any other component that exists and has claimed that it can do such a job through intentfilters, is invoked by the android platform to accomplish the job. This means, both the
components are not aware of each other's existence and can still work together to give the
desired result for the end-user.
This invisible connection between components is achieved through the combination of
intents, intent-filters and the android platform.
This leads to huge possibilities like:

Mix and match or rather plug and play of components at runtime.

Replacing the inbuilt android applications with custom developed applications.

Component level reuse within and across applications.

Service orientation to the most granular level, if I may say.

Here is additional description about intent, almost formal.


An intent is an abstract description of an operation to be performed. It can be used
with startActivity to

launch

an Activity,broadcastIntent to

interested BroadcastReceiver components,and startService(Intent) or

send

it

to

any

bindService(Intent,

ServiceConnection, int) to communicate with a background Service.


An Intent provides a facility for performing late runtime binding between the code in
different applications. Its most significant use is in the launching of activities, where it can be
thought of as the glue between activities. It is basically a passive data structure holding an
abstract description of an action to be performed. The primary pieces of information in an
intent are:

action The general action to be performed, such as ACTION_VIEW, ACTION_EDIT,


ACTION_MAIN, etc.

data The data to operate on, such as a person record in the contacts database,
expressed as a Uri.

Explicit Intent

42 | P a g e

INTELLIGENT TOURIST SYSTEM

In an explicit intent, we actually specify the activity that is required to respond to the intent.
In other words, we explicitly designate the target component. This is typically used for
application internal messages.

Preferences
Shared Preferences are a simple, lightweight key/value pair mechanism for saving primitive
application data, most commonly a user's application preferences.
Using the SharedPreferences class, we can create named maps of key/value pairs within our
application that can be shared among application components running in the same application
context.
Shared Preferences support the primitive types Boolean, string, float, long, and integer,
making them an ideal means of quickly storing default values, class instance variables, the
current UI state, and user preferences. They are most commonly used to persist data across
user sessions and to share settings among application components.
How we get access to the preference?

getPreference() from within Activity: to access activity specific preference.

getSharedPreferences() from within Activity or other application Context : to access


application-level preference.

getDefaultSharedPreferences() on PreferencesManager
to get the shared preferences that work in concert with Android's overall preference
framework.

All of these methods return an instance of SharedPreferences, which offers a series of


getters to access named preferences, returning a suitably typed result. The getters also take a
default value, which is returned if there is no preference set under the specified key.
Given the appropriate SharedPreferences object, we can use edit() to get an editor for the
preferences. This object has a set of setters that mirror the getters on the
parent SharedPreferences object. It also has the following methods:

remove(): Deletes a single named preference.

clear(): Deletes all preferences.

commit(): Persists our changes made via the editor.

43 | P a g e

INTELLIGENT TOURIST SYSTEM

The commit() method is important. If we modify preferences using the editor and fail
to commit() the changes, those changes will evaporate once the editor goes out of scope.
Conversely, since the preferences object supports live changes, if one part of our application
modifies shared preferences, another part of our application will have access to the changed
value immediately.

Manifest
The foundation for any Android application is the manifest file. Every application must have
an AndroidManifest.xml file in its root directory. The manifest presents essential
information about the application to the Android system, information the system must have
before it can run any of the application's code. Among other things, the manifest does the
following:

It names the Java package for the application. The package name serves as a unique
identifier for the application.

It describes the components of the application - the activities, services, broadcast


receivers, and content providers that the application is composed of. It names the
classes that implement each of the components and publishes their capabilities (for
example, which Intent messages they can handle). These declarations let the Android
system know what the components are and under what conditions they can be
launched.

It determines which processes will host application components.

It declares which permissions the application must have in order to access protected
parts of the API and interact with other applications.

It also declares the permissions that others are required to have in order to interact
with the application's components.

It lists the Instrumentation classes that provide profiling and other information as the
application is running. These declarations are present in the manifest only while the
application is being developed and tested; they're removed before the application is
published.

It declares the minimum level of the Android API that the application requires.

It lists the libraries that the application must be linked against.


44 | P a g e

INTELLIGENT TOURIST SYSTEM

45 | P a g e

INTELLIGENT TOURIST SYSTEM

Structure of the AndroidManifest.xml File


The diagram below shows the general structure of the manifest file and every element that it
can contain. Each element, along with all of its attributes, is documented in full in a separate
file.
<?xml version="1.0" encoding="utf-8"?>
<manifest>
<uses-permission />
<permission />
<permission-tree />
<permission-group />
<instrumentation />
<uses-sdk />
<uses-configuration />
<uses-feature />
<supports-screens />
<application>
<activity>
<intent-filter>
<action />
<category />
<data />
</intent-filter>
<meta-data />
</activity>
<activity-alias>
<intent-filter> . . . </intent-filter>
<meta-data />
</activity-alias>
<service>
<intent-filter> . . . </intent-filter>
46 | P a g e

INTELLIGENT TOURIST SYSTEM

<meta-data/>
</service>
<receiver>
<intent-filter> . . . </intent-filter>
<meta-data />
</receiver>
<provider>
<grant-uri-permission />
<meta-data />
</provider>
<uses-library />
</application>
</manifest>
File Conventions
Some conventions and rules apply generally to all elements and attributes in the manifest:
Elements
Only the <manifest> and <application> elements are required, they each must be present and
can occur only once. Most of the others can occur many times or not at all although at least
some of them must be present for the manifest to accomplish anything meaningful. If an
element contains anything at all, it contains other elements. All values are set through
attributes, not as character data within an element. Elements at the same level are generally
not ordered. For example, <activity>, <provider>, and <service> elements can be intermixed
in any sequence. (An <activity-alias> element is the exception to this rule: It must follow the
<activity> it is an alias for.)

47 | P a g e

INTELLIGENT TOURIST SYSTEM

Attributes
In a formal sense, all attributes are optional. However, there are some that must be specified
for an element to accomplish its purpose. Use the documentation as a guide. For truly
optional attributes, it mentions a default value or states what happens in the absence of a
specification. Except for some attributes of the root <manifest> element , all attribute names
begin with an android: prefix for example, android:alwaysRetainTaskState. Because the
prefix is universal, the documentation generally omits it when referring to attributes by name.
Declaring class names
Many elements correspond to Java objects, including elements for the application itself (the
<application> element) and its principal components activities (<activity>), services
(<service>), broadcast receivers (<receiver>), and content providers (<provider>). If you
define a subclass, as you almost always would for the component classes (Activity, Service,
BroadcastReceiver, and ContentProvider), the subclass is declared through a name attribute.
The name must include the full package designation. For example, an Service subclass might
be declared as follows:
<manifest . . . >
<application . . . >
<service android:name="com.example.project.SecretService" . . . >
...
</service>
...
</application>
</manifest>
Multiple values
If more than one value can be specified, the element is almost always repeated, rather than
listing multiple values within a single element. For example, an intent filter can list several
actions:
<intent-filter . . . >
<action android:name="android.intent.action.EDIT" />
<action android:name="android.intent.action.INSERT" />
<action android:name="android.intent.action.DELETE" />
...
</intent-filter>
48 | P a g e

INTELLIGENT TOURIST SYSTEM

Resource values
Some attributes have values that can be displayed to users for example, a label and an icon
for an activity. The values of these attributes should be localized and therefore set from a
resource or theme. Resource values are expressed in the following format,
@[package:]type:name
where the package name can be omitted if the resource is in the same package as the
application, type is a type of resource such as "string" or "drawable" and name is the name
that identifies the specific resource.
String values
Where an attribute value is a string, double backslashes ('\\') must be used to escape
characters for example, '\\n' for a newline or '\\uxxxx' for a Unicode character.
File Features
The following sections describe how some Android features are reflected in the manifest file.
Intent Filters
The core components of an application (its activities, services, and broadcast receivers) are
activated by intents. An intent is a bundle of information (an Intent object) describing a
desired action including the data to be acted upon, the category of component that should
perform the action, and other pertinent instructions. Android locates an appropriate
component to respond to the intent, launches a new instance of the component if one is
needed, and passes it the Intent object.
Components advertise their capabilities the kinds of intents they can respond to
through intent filters. Since the Android system must learn which intents a component can
handle before it launches the component, intent filters are specified in the manifest as <intentfilter> elements. A component may have any number of filters, each one describing a
different capability.
An intent that explicitly names a target component will activate that component; the filter
doesn't play a role. But an intent that doesn't specify a target by name can activate a
component only if it can pass through one of the component's filters.
Icons and Labels
A number of elements have icon and label attributes for a small icon and a text label that can
be displayed to users. Some also have a description attribute for longer explanatory text that
can also be shown on-screen. For example, the <permission> element has all three of these
49 | P a g e

INTELLIGENT TOURIST SYSTEM

attributes, so that when the user is asked whether to grant the permission to an application
that has requested it, an icon representing the permission, the name of the permission, and a
description of what it entails can all be presented to the user.
In every case, the icon and label set in a containing element become the default icon and label
settings for all of the container's sub elements. Thus, the icon and label set in the
<application> element are the default icon and label for each of the application's components.
Similarly, the icon and label set for a component for example, an <activity> element are the
default settings for each of the component's <intent-filter> elements. If an <application>
element sets a label, but an activity and its intent filter do not, the application label is treated
as the label for both the activity and the intent filter.
The icon and label set for an intent filter are used to represent a component whenever the
component is presented to the user as fulfilling the function advertised by the filter. For
example,

filter

with

"android.intent.action.MAIN"

and

"android.intent.category.LAUNCHER" settings advertises an activity as one that initiates an


application that is, as one that should be displayed in the application launcher. The icon and
label set in the filter are therefore the ones displayed in the launcher.
Permissions:A permission is a restriction limiting access to a part of the code or to data on
the device. The limitation is imposed to protect critical data and code that could be misused to
distort or damage the user experience.
Each permission is identified by a unique label. Often the label indicates the action that's
restricted. For example, here are some permissions defined by Android:
android.permission.CALL_EMERGENCY_NUMBERS
android.permission.READ_OWNER_DATA
android.permission.SET_WALLPAPER
android.permission.DEVICE_POWER
A feature can be protected by at most one permission.
If an application needs access to a feature protected by a permission, it must declare that it
requires that permission with a <uses-permission> element in the manifest. Then, when the
application is installed on the device, the installer determines whether or not to grant the
requested permission by checking the authorities that signed the application's certificates and,
in some cases, asking the user. If the permission is granted, the application is able to use the
protected features. If not, its attempts to access those features will simply fail without any
notification to the user.
50 | P a g e

INTELLIGENT TOURIST SYSTEM

An application can also protect its own components (activities, services, broadcast receivers,
and content providers) with permissions. It can employ any of the permissions defined by
Android (listed in android.Manifest.permission) or declared by other applications. Or it can
define its own. A new permission is declared with the <permission> element. For example, an
activity could be protected as follows:
<manifest . . . >
<permission android:name="com.example.project.DEBIT_ACCT" . . . />
...
<application . . .>
<activity android:name="com.example.project.FreneticActivity"
android:permission="com.example.project.DEBIT_ACCT"
...>
...
</activity>
</application>
...
<uses-permission android:name="com.example.project.DEBIT_ACCT" />
...
</manifest>
The <permission-tree> element declares a namespace for a group of permissions that will be
defined in code. And <permission-group> defines a label for a set of permissions (both those
declared in the manifest with <permission> elements and those declared elsewhere). It affects
only how the permissions are grouped when presented to the user. The <permission-group>
element does not specify which permissions belong to the group; it just gives the group a
name. A permission is placed in the group by assigning the group name to the <permission>
element's permissionGroup attribute.
Libraries
Every application is linked against the default Android library, which includes the basic
packages for building applications (with common classes such as Activity, Service, Intent,
View, Button, Application, ContentProvider, and so on).
However, some packages reside in their own libraries. If your application uses code from any
of these packages, it must explicitly ask to be linked against them. The manifest must contain

51 | P a g e

INTELLIGENT TOURIST SYSTEM

a separate element to name each of the libraries. (The library name can be found in the
documentation for the package.)

Animation
Android supports three types of animation:

Frame-by-frame animation : A series of frames is drawn one after the other at regular
intervals.

Layout animation : Animate views inside a container view such as lists and tables.

View animation : Animate any general-purpose view.

3.SQL:
We have used SQL in our project to enter databases.

SQL is a standard language for accessing and manipulating databases.

SQL stands for Structured Query Language.

SQL lets you access and manipulate databases.

SQL is an ANSI (American National Standards Institute) standard.

SQL can execute queries against a database.

It can retrieve data from a database.

It can insert records in a database.

It can update records in a database.

It can delete records from a database, create new database, create new tables in the
database, create new views.

It can create stored procedures in a database.

It can set permissions on tables, procedures, and views.

Originally based upon relational algebra and tuple relational calculus, SQL consists of
a data definition language and a data manipulation language.

It also includes procedural elements.


52 | P a g e

INTELLIGENT TOURIST SYSTEM

The scope of SQL includes data insert, query, update and delete, schema creation and
modification, and data access control.

Queries allow the user to describe desired data, leaving the database management
system (DBMS) responsible for planning, optimizing, and performing the physical
operations necessary to produce that result as it chooses.

4.SQLite Database
SQLite is a relational database management system contained in a C programming library. In
contrast to many other database management systems, SQLite is not a clientserver database
engine. Rather, it is embedded into the end program. SQLite reads and writes directly to
ordinary disk files. A complete SQL database with multiple tables, indices, triggers, and
views, is contained in a single disk file. The database file format is cross-platform - you can
freely copy a database between 32-bit and 64-bit systems.
Main Features of SQLite:

Transactions are atomic, consistent, isolated, and durable (ACID) even after system
crashes and power failures.

Zero-configuration - no setup or administration needed.

Full SQL implementation with advanced features like partial indexes and common
table expressions.

A complete database is stored in a single cross-platform disk file. Great for use as
an application file format.

Supports terabyte-sized databases and gigabyte-sized strings and blobs.

Small code footprint: less than 500KiB fully configured or much less with optional
features omitted.

Simple, easy to use API.

Well-commented source code with 100% branch test coverage.

Self-contained: no external dependencies.

Cross-platform: Android, *BSD, iOS, Linux, Mac, Solaris, VxWorks, and Windows
(Win32, WinCE, WinRT) are supported out of the box. Easy to port to other systems.

Sources are in the public domain. Use for any purpose.


53 | P a g e

INTELLIGENT TOURIST SYSTEM

Comes with a standalone command-line interface (CLI) client that can be used to
administer SQLite databases.

Content Providers Introduction


Content Providers are one of the fundamental building blocks of the Android Platform.
Content Provider brings us to the concept of how to deal with data stored in the Android.
A content provider is a wrapper around the data. Android exposes data through a content
provider.
When using a content provider, all we really need to know is the provider's base URI. From
there, we can run queries and construct a URI to a specific instance.
The URI always starts with content://, indicating it is a content URI instead of a URI to a web
resource, http://.
Any application on the device can make use of these URIs to access and manipulate data. As
a consequence, content providers play a significant role in sharing data between applications.
There are 4 ways we can store data:

Preferences
Preferences are used to store user preferences for a single application or across
applications in a mobile. They are typically name-value pairs accessible to the
context.

Files
Files can be stored directly on to the mobile or to extended storage mediums. They are
by default not accessible to applications other than the one that created it.

Database (RDBMS)
Android supports creation of databases based on SQLite. These are again private to
the application that created it.

Network
Android provides API support to store data over the network on to a server.

No matter how the data is stored, Content Providers give a uniform interface to access the
data. Data is exposed as a simple table with rows and columns where row is a record and
column is a particular data type with a specific meaning. A row could be about a single
person and the columns could be the person first name, number, address, email id etc.
54 | P a g e

INTELLIGENT TOURIST SYSTEM

Life Cycle
Writing an application with a good understanding of the activity life cycle is critical to ensure
that our application provides a seamless user experience and properly manages its resources.
Android application does not control its own process lifetimes. The Android run time
manages the process of each application. While the run time handles the termination and
management of an activity's process, the activity's state helps determine the priority of its
parent application. The application priority, in turn, affects the likelihood that the run time
will terminate it and the activities running within it.
Activity Stacks
The state of each activity is determined by its position on the activity stack. When a new
activity starts, the current foreground screen is moved to the top of the stack. If the user
navigates back using the Back button or the foreground activity is closed, the next activity on
the stack moves up and becomes active.
An application's priority is influenced by its highest-priority activity. When the Android
memory manager is deciding which application to terminate to free resources, it uses this
stack to determine the priority of applications based on their activities.
Activity States
As activities are created and destroyed they move in and out of the stack. They transition
through 4 states:

Active
When an activity is at the top of the stack it is the visible, focused, foreground activity
that is receiving user input. Android will attempt to keep it alive at all cost, killing
activities further down the stack as needed, to ensure that it has the resources it needs.
When another activity becomes active, this one will be paused.

Paused
In some cases our activity will be visible but will not have focus. At this point it's
paused. This state is reached if a transparent or not-full-screen activity is active in
front of it. When paused, an activity is treated as if it were active. However, it doesn't
receive user input events. In extreme cases, Android will kill a paused activity to
recover resources for the active activity. When an activity becomes totally obscured, it
is stopped.

55 | P a g e

INTELLIGENT TOURIST SYSTEM

Stopped
When an activity isn't visible, it stops. The activity will remain in memory, retaining
all state information. However, it is now a candidate for termination when the system
requires memory elsewhere. When an activity stopped, it's important to save data and
the current UI state. Once an activity exited or closed, it becomes inactive.

Inactive
After an activity has been killed, and before it's been launched, it's inactive. Inactive
activities have been removed from the activity stack and need to be restarted before
they can be displayed and used.

State transitions are nondeterministic and are handled entirely by the Android memory
manager. Android will start by closing applications that contain inactive activities, followed
by those that are stopped. In extreme cases it will remove those that are paused.
Activity Lifetimes:
Within an activity's full lifetime, between creation and destruction, it will go through one or
more iterations of the active and visible lifetimes. Each transition will trigger the method
handlers as shown in the previous code sample.
Full Lifetime
The full life time of our activity occurs between the first call to onCreate() and the final call
to onDestroy(). It's possible, in some cases, for an activity's process terminates without the
onDestroy() not being called.
Use the onCreate() method to initialize activity. Inflate the user interface, allocate references
to

class

variables,

bind

data

to

controls,

and

create

services

and

threads.

The onCreate() method is passed a Bundle to restore the user interface to its previous state,
either

within

the onCreate() method

or

by overriding onRestoreInstanceState().It's

recommended that we avoid the creation of short-term objects. Rapid creation and destruction
of objects force additional garbage collection.

56 | P a g e

INTELLIGENT TOURIST SYSTEM

Visible Lifetime
An activity's visible lifetimes are bound between calls to onStart() and onStop(). Between
these calls our activity will be visible to the user, although it may not have focus and may be
partially obscured. Activities are likely to go through several visible lifetimes during their full
lifetime, as they move between the foreground and background. While it's unusual, Android
run time will kill an activity during its visible lifetime without a call to onStop().
The onStop() method should be used to pause or stop animations, threads, sensor listeners,
GPS lookups, timers, services, or other processes that are used exclusively to update the user
interface. There's little value in consuming resources to update the UI when it isn't visible.
Use the onStart() method to resume or restart these processes when the UI is visible again.
The onStart() method is called immediately prior to all but the first call to onStart(). Use it
to implement special processing that we want done only when the activity restarts within its
full lifetime.The onStart()/onStop() methods are also used to register and unregister
Broadcast Receivers that are being used exclusively to update the user interface

Active Lifetime
The active lifetime starts with a call to onResume() and ends with a call to onPause().
An active activity is in the foreground and its receiving user input events. Our activity is
likely to go through several active lifetimes before it's destroyed, as the active lifetime will
end when a new activity is displayed, the device goes to sleep, or the activity loses focus.
Try to keep code in the onPause() and onResume() methods relatively fast and lightweight
to ensure that our application remains responsive when moving in and out of the foreground.
Immediately before onPause(), a call is made to onSaveInstanceState(). This method
provides an opportunity to save the activity's UI state in a Bundle that will be passed to
the onCreate() and onRestoreInstanceState() methods. UseonSaveInstanceState() to save
the UI state to ensure that the activity can present the same UI when it next becomes active.
We can safely assume that during the active
lifetime onSaveInstanceState() and onPause() will be called before the process is
terminated.
Most activity implementations will override at least the onPause() method to commit
unsaved changes, as it marks the point beyond which an activity may be killed without
warning. Depending on our application, we may also choose to suspend threads, processes,
Broadcast Receivers while our activity is not in the foreground.
57 | P a g e

INTELLIGENT TOURIST SYSTEM

The onResume() method can be very lightweight. We will not need to reload the UI state
here as this is handled by theonCreate() and onRestoreInstanceState() methods when
required. Use onResume() to reregister any Broadcast Receivers or other processes we may
have suspended in onPause().
Activity Classes
Here is the list of the most useful activity classes.

MapActivity
Encapsulates the resource handling required to support a MapView widget within an
activity.

ListActivity
Wrapper class for activities that feature a ListView bound to a data source as the
primary UI metaphor, and exposing event handlers for list item selection.

ExpandableActivity
Similar to the ListActivity but supporting an ExpandableListView bound to a data
source as the primary UI metaphor, and exposing event handlers for list item
selection.

TabActivity

a. Enables us to embed multiple activities or View within a single screen using a tab
widget to switch among them.
b.Query the local Bluetooth adapter for paired Bluetooth devices
c. Connect to other devices through service discovery
d. Transfer data to and from other devices
e. Manage multiple connections

58 | P a g e

INTELLIGENT TOURIST SYSTEM

59 | P a g e

INTELLIGENT TOURIST SYSTEM

Testing Tool:
It is used to testing of application to find errors or any other designing
Problems.

Genymotion :
We have used genymotion to evaluate our project.

It is an Android emulator which comprises a complete set of sensors and


features in order to interact with a virtual Android environment.

It (currently in beta) is available for Linux, Windows and Mac OS X and


requires virtual box.

It is free to use.It offers OpenGL hardware acceleration, multi screen, full


screen display.

It is fast, simple to install and powerful thanks to user-friendly sensor widgets


and interaction features.

It is available for Windows, Mac OS X and Linux operating systems.

Control simulated sensors like battery, GPS, and accelerometer with a the
user-friendly interface.

It offerspowerful command line tools allow you to build complex tests.It has
user-friendly interface

Taking advantage of OpenGL hardware acceleration, it allows you to test your


applications with amazing 3D performance.

It usesx86 architecture

virtualization, making it much more efficient.

It perfectly integrates in your development environment with Eclipse plug-in.

It is packaged for Windows, Mac and Linux. It controls powerful sensors to


test specialized features on your app. It lets you emulate Android directly
from your desktop.

Version are 2.3.1,2.3.0,2.2.0,2.2.2

The version of genymotion used in this project is version 2.3.0

60 | P a g e

INTELLIGENT TOURIST SYSTEM

FEASIBILITY STUDY
A feasibility study is carried out to select the best system that meets performance
requirements. The main aim of the feasibility study activity is to determine whether it would
be financially and technically feasible to develop the application. The feasibility study
activity involves the analysis of the problem and comment of all relevant information relating
to the application, such as the different data items which would be input to the system.

1. Technical Feasibility
This is concerned with specifying application that will successfully satisfy the user
requirement. The technical needs of the system may vary considerably, but might
include:
The facility to produce outputs in a given time.
Response time under certain conditions.
Facility to communicate data to distant locations.
In examining technical feasibility, configuration of the system is given more
importance than the actual make of hardware. The configuration should give the
complete picture about the system required.

2. Economic Feasibility
Economic analysis is the most frequently used technique for evaluating the effectiveness of a
proposed system. More commonly known as Cost / Benefit analysis, the procedure is to
determine the benefits and savings that are expected from a proposed system and compare
them with costs. If benefits outweigh costs, a decision is taken to design and implement the
system. Otherwise, further justification or alternative in the proposed system will have to be
made if it is to have a chance of being approved.
This is an outgoing effort that improves in accuracy at each phase of the system life cycle.

REQUIREMENT ANALYSIS
61 | P a g e

INTELLIGENT TOURIST SYSTEM

Eclipse IDE
In computer programming, Eclipse is an integrated development environment (IDE). It
contains a base workspace and an extensible plug-in system for customizing the environment.
Written mostly in Java, Eclipse can be used to develop applications. Eclipse got its start in
2001 when IBM donated three million lines of code from its Java tools. The original goal of
Eclipse was to create and foster an open source IDE community that would complement the
community that surrounds Apache.
Eclipse provides a common user interface (UI) model for working with tools. It is designed
to run on multiple operating systems while providing robust integration with each underlying
OS. Plug-ins can program to the Eclipse portable APIs and run unchanged on any of the
supported operating systems.
At the core of Eclipse is architecture for dynamic discovery, loading, and running of plug-ins.
The platform handles the logistics of finding and running the right code. The platform UI
provides a standard user navigation model. Each plug-in can then focus on doing a small
number of tasks well like Defining, testing, animating, publishing, compiling, debugging and
diagramming.
The Eclipse platform defines an open architecture so that each plug-in development team can
focus on their area of expertise. Let the repository experts build the back ends and the
usability experts build the end user tools. If the platform is designed well, significant new
features and levels of integration can be added without impact to other tools. The Eclipse
platform uses the model of a common workbench to integrate the tools from the end user's
point of view. Tools that you develop can plug into the workbench using well defined hooks
called extension points.

62 | P a g e

INTELLIGENT TOURIST SYSTEM

Eclipse ADT (Android Development Tools)


Android Development Tools (ADT) is a Google-provided plugin for the Eclipse IDE that is
designed to provide an integrated environment in which to build Android applications. ADT
extends the capabilities of Eclipse to let developers set up new Android projects, create an
application UI, add packages based on the Android Framework API, debug their applications
using the Android SDK tools, and export signed (or unsigned) .apk files in order to distribute
their applications. It is free download. It was the official IDE for Android but has been
replaced by Android Studio (based on IntelliJ IDEA Community Edition).

63 | P a g e

INTELLIGENT TOURIST SYSTEM

MODULAR DESCRIPTION OF JOB


We have done this project in Eclipse ADT. This application contains some module as if user
module and back-end i.e. database module. We have done these modules that were assigned
by our team leader. In this firstly we had to learn about basics of Eclipse ADT. And after this
we started working on this project.

Database Module
As the name specifies Database it contains all the tables in the database. Database is used to
store different types of data at different locations. The whole data in the database is in the
form of table it means data can be stored in the form of tables. The database used in this
project Intelligent tourism system are:
Users Information Table
So user table it contain the users information in this table. Whenever any new user registers
on the website all the registration form data will be saved in users table.
Trip plan Table
In this table all the information about the trip is stored which is planned by the user.
IV.2- User Module
This is our next module (it is a front-end of our project). User module also further divided
into sub module as if registration for a new user, login for users who already registered, and
main page of application. Further description is given below:

We have created first page that we all know the login page it contain login for
existing user and a signup form for new users who are not registered .

The second page that we have created is register page which contains form for
new users who are not registered to the application.

Then third page is the main page of the application where a user can search for the
nearby places he/she wants to visit.

Another pages in our application includes forgot password page and trip planning
page.

64 | P a g e

INTELLIGENT TOURIST SYSTEM

DATAFLOW DIAGRAM

LOGIN

REGISTER

DATABASE

NEAR BY

MY PLAN

CREATE
PLA

MY
POCKET

VIEW PLAN

DATABASE

65 | P a g e

INTELLIGENT TOURIST SYSTEM

VI- DETAILED ANALYSIS OF INDIVIDUAL MODULE


1.Front Page

66 | P a g e

INTELLIGENT TOURIST SYSTEM

2.Login Page
In Login Page user has to put in their username and password to open their profile. It also
contains links to forget password and register page. Null value validations has been applied
on each edit text field i.e. user cannot left any field blank. There is also a button to reset the
fields in case user has input the wrong username and password. Username and password are
fetched from database to login in activity.

67 | P a g e

INTELLIGENT TOURIST SYSTEM

3.Registration Page
In registration page a new user can register. He/She has to fill in details such as his/her name,
password, email address and security question and answer to register on the application.
There is also a confirm password field. Each user is given a unique username which is used to
login in activity. Null value validations has been applied on each edit text field i.e. user
cannot left any field blank. All the database of the user is maintained in SQLite database
which is further used to login into activity. Two buttons are present on the registration page
one is submit button which is used to submit the detail of user and store it into the database
and another button is reset button which is used to reset the fields to blank.

68 | P a g e

INTELLIGENT TOURIST SYSTEM

4.Login Page

69 | P a g e

INTELLIGENT TOURIST SYSTEM

5.Main Activity Page


In this there is links been provided to search for the nearby places and plan the trip. To search
for the nearby places user must be connected to the internet and has activated GPS on his/her
mobile.PS will fetch the current location of the user and will show the nearby places. User
can select the option from the drop down list to show the place of his/her choice. Logout
button is used to exit the application. Person is directed to login page after clicking the logout
button.

70 | P a g e

INTELLIGENT TOURIST SYSTEM

6.Trip plan page


On this page person can make the plan for the trip and view the plan. Person can enter the
plan name, duration of the plan, name of the place where he/she wants to visit and can tick
the check boxes for the things he/she wants to do there. After filling all the data person
needs to click on the create button to store the plan into the database. The stored plan can be
viewed on view plan page.

71 | P a g e

INTELLIGENT TOURIST SYSTEM

7.Near By

72 | P a g e

INTELLIGENT TOURIST SYSTEM

8.My Pocket

73 | P a g e

INTELLIGENT TOURIST SYSTEM

CONCLUSION AND FUTURE ENHANCEMENTS

1.Conclusion
Tourism is a major source of income for many countries, and affects the economy of host
country . So, it is required to build a system for mobile devices which can help tourists
conveniently. This mobile application helps the tourists to know more about the visiting
places and plan there trip accordingly. It makes the trip of the tourist easy and convenient.
Person can easily find the nearby plan places. User can register and login to use the
application.

2. FUTURE ENHANCEMENTS

Smoothing object search technique

Deletion and modification of trip plans

Adding email verification technique

We can add on hotels nd taxi services

74 | P a g e

INTELLIGENT TOURIST SYSTEM

BIBLIOGRAPHY
Websites

http://stackoverflow.com/

http://developer.android.com/index.html

www. HYPERLINK
"http://www.tutorialspoint.com/android/android_tutorial.pdf"tutorials
HYPERLINK
"http://www.tutorialspoint.com/android/android_tutorial.pdf"point.com/
HYPERLINK
"http://www.tutorialspoint.com/android/android_tutorial.pdf"android
HYPERLINK "http://www.tutorialspoint.com/android/android_tutorial.pdf"/
HYPERLINK
"http://www.tutorialspoint.com/android/android_tutorial.pdf"android
HYPERLINK "http://www.tutorialspoint.com/android/android_tutorial.pdf"_
HYPERLINK
"http://www.tutorialspoint.com/android/android_tutorial.pdf"tutorial
HYPERLINK "http://www.tutorialspoint.com/android/android_tutorial.pdf".
HYPERLINK "http://www.tutorialspoint.com/android/android_tutorial.pdf"pdf

www. HYPERLINK "http://www.tutorialspoint.com/eclipse/"tutorials


HYPERLINK "http://www.tutorialspoint.com/eclipse/"point.com/ HYPERLINK
"http://www.tutorialspoint.com/eclipse/"eclipse HYPERLINK
"http://www.tutorialspoint.com/eclipse/"/

Books

Java the complete reference- Herbert Schildt

Programming with Java- E Balagurusamy

75 | P a g e

Você também pode gostar