Final document
-
Upload
- -
Category
Data & Analytics
-
view
95 -
download
1
Transcript of Final document
i
DECLARATION This is to declare thatproject work which is done under the supervision of Daniel Mehetote
and having title TourGondar city guide mobile application is the sole contribution of:
BONSA FEKADU MEDIHANIT KALARO MERON NEGASH MINTESNOT KASU WORKNESH TSEGUYE
No part of the project work has been reproduced illegally (copy and paste) which can be
considered as Plagiarism. All referenced parts have been used to argue the idea and have
cited properly. We will be responsible and liable for any consequence if violation of this
declaration is proven.
Date:_____________________________
Group Members:
Full Name Signature
BONSA FEKADU __________________ MEDIHANIT KALARO __________________ MERON NEGASH __________________ MINTESNOT KASU __________________ WORKNESH TSEGUYE __________________
TOURGONDAR CITY GUIDE MOBILE APPLICATION
ii
CERTIFICATE This is to certify that this BSc industrial project report entitled TourGondar city guide mobile
application by:
BONSA FEKADU MEDIHANIT KALARO MERON NEGASH MINTESNOT KASU WORKNESH TSEGUYE
is approved by me for submission. I certify further that, to the best of my knowledge, the
report represents work carried out by these students.
______________________________ __________________________________
Date Name and signature of supervisor
TOURGONDAR CITY GUIDE MOBILE APPLICATION
iii
Acknowledgment Tour Gondar city guide application would like to thank all our project supporters for this success, it
will not be successful without those who scarified their time, share experience and support with idea
next to God. We also like to express our warmest blessing and appreciation to our advisor Daniel
Mahetot for his patience, good humor and helpful comments, suggestion to finalize this project.
Secondly we would like to thank administration of Gondar city and Tourism office for supporting the
project by giving us the necessary information.
Last but not least our deep gratitude goes to our family who help us by giving moral, economical and
materials support for this project.
TOURGONDAR CITY GUIDE MOBILE APPLICATION
iv
Table of Contents DECLARATION .......................................................................................................................................... i
CERTIFICATE ............................................................................................................................................ ii
Acknowledgment ................................................................................................................................... iii
List of Tables ......................................................................................................................................... vii
List Of Figure ........................................................................................................................................ viii
CHAPTER ONE ......................................................................................................................................... 1
1.1. Introduction ..................................................................................................................................... 1
1.2. Background ...................................................................................................................................... 2
1.3. Statement of the problem ............................................................................................................... 3
1.4. Objective of the project ................................................................................................................... 3
1.4.1 .General objective ......................................................................................................................... 3
1.4.2 .Specific objective .......................................................................................................................... 3
1.5. Scope of the project ........................................................................................................................ 4
1.6. System Development Methodology ................................................................................................ 4
1.6.1. Investigation (fact-finding) methods ............................................................................................ 5
1.6.2. System Development Tools .......................................................................................................... 5
1.6.2.1. Hardware ................................................................................................................................... 5
1.6.2.2. Software .................................................................................................................................... 5
1.7. Significance of the project ............................................................................................................... 6
1.8. Beneficiaries .................................................................................................................................... 6
1.9. Time schedule .................................................................................................................................. 7
CHAPTER TWO ........................................................................................................................................ 8
2. Requirement Analysis ........................................................................................................................ 8
2.1. Introduction ..................................................................................................................................... 8
2.2. Current System ................................................................................................................................ 8
TOURGONDAR CITY GUIDE MOBILE APPLICATION
v
2.2.1. Major function of current system ................................................................................................ 8
2.2.2. Problem of existing system .......................................................................................................... 8
2.3. Gathering Information ..................................................................................................................... 9
2.3.1 Requirement Gathering Methodologies ..................................................................................... 10
2.3.2. Result Found ............................................................................................................................... 10
2.4. Proposed System ........................................................................................................................... 10
2.4.1. Overview ..................................................................................................................................... 10
2.4.2 Functional Requirement .............................................................................................................. 11
2.4.3. Non-Functional Requirement ..................................................................................................... 11
2.4.3.1. User interface and Human Factors .......................................................................................... 11
2.4.3.2. Documentation ........................................................................................................................ 12
2.4.3.3. Hardware consideration .......................................................................................................... 12
2.4.3.4. Performance characteristics .................................................................................................... 12
2.4.3.5. Error Handling and Extreme conditions .................................................................................. 12
2.4.3.6. Quality Issues ........................................................................................................................... 13
2.4.3.7. System Modifications .............................................................................................................. 13
2.4.3.8. Physical Environment .............................................................................................................. 13
2.4.3.9. Security Issues ......................................................................................................................... 14
2.4.3.10. Resource Issues ..................................................................................................................... 14
2.5. System Model ................................................................................................................................ 15
2.5.1. Scenario ...................................................................................................................................... 15
2.5.2. Use case Model .......................................................................................................................... 17
2.5.2.1. Use case diagram ..................................................................................................................... 17
2.5.2.2. Description of Use case Model ................................................................................................ 19
2.5.3. Activity Diagram ......................................................................................................................... 23
2.5.4. Object Model .............................................................................................................................. 31
2.5.4.1. Data Dictionary ........................................................................................................................ 31
2.5.4.2. Class Modeling ......................................................................................................................... 32
2.5.4.3. Dynamic Modeling ................................................................................................................... 34
2.5.5. User Interface ............................................................................................................................. 41
CHAPTER THREE ................................................................................................................................... 42
3. System Design ............................................................................................................................... 42
TOURGONDAR CITY GUIDE MOBILE APPLICATION
vi
3.1. Introduction ................................................................................................................................... 42
3.2. Current software architecture ....................................................................................................... 42
3.3. Proposed software architecture .................................................................................................... 42
3.3.1. Overview ................................................................................................................................. 42
3.3.2. Subsystem decomposition ..................................................................................................... 43
3.3.3. Hardware/Software mapping ..................................................................................................... 45
3.3.4. Persistent data management ..................................................................................................... 46
3.3.5. Access control and security ........................................................................................................ 49
3.3.6. Subsystem services ..................................................................................................................... 50
3.3.7. Detailed class diagram ................................................................................................................ 51
3.3.8. Package ....................................................................................................................................... 52
CHAPTER FOUR ..................................................................................................................................... 53
4. Implementation ................................................................................................................................ 53
4.1. Mapping models to code ............................................................................................................... 53
4.2. Source codes of major classes, packages or interfaces ................................................................. 55
4.3. Screen Images .............................................................................................................................. 109
CHAPTER 5 .......................................................................................................................................... 114
5. Conclusion and Recommendation .................................................................................................. 114
5.1. Conclusion ................................................................................................................................... 114
5.2. Recommendation ........................................................................................................................ 114
5.3. Bibliography ................................................................................................................................. 115
Appendix A ......................................................................................................................................... 116
TOURGONDAR CITY GUIDE MOBILE APPLICATION
vii
List of Tables
Table 1 Events ..................................................................................................................................... 46
Table 2 hotels ...................................................................................................................................... 46
Table 3 hotels pictures ....................................................................................................................... 46
Table 4 restaurants ............................................................................................................................. 46
Table 5 restaurant pictures ................................................................................................................ 47
Table 6 attractions .............................................................................................................................. 47
Table 7 attraction pictures ................................................................................................................. 47
Table 8 bank ........................................................................................................................................ 47
Table 9 bank pictures ......................................................................................................................... 47
Table 10 health center ........................................................................................................................ 48
Table 11 health center pictures ......................................................................................................... 48
Table 12 police station ........................................................................................................................ 48
Table 13 police station pictures ......................................................................................................... 48
Table 14 tour and travel agent .......................................................................................................... 48
Table 15 TTA pictures ....................................................................................................................... 49
Table 16 Access control and security ................................................................................................ 49
TOURGONDAR CITY GUIDE MOBILE APPLICATION
viii
List of Figure Figure 1 Time schedule ........................................................................................................................ 7
Figure 2 Use case diagram ................................................................................................................ 18
Figure 3 Update content activity diagram ........................................................................................ 23
Figure 4 Delete content activity diagram ......................................................................................... 24
Figure 5 Upload content activity diagram ........................................................................................ 25
Figure 6 Change language activity diagram .................................................................................... 26
Figure 7 Detect location activity diagram ........................................................................................ 27
Figure 8 Attraction activity diagram ................................................................................................ 28
Figure 9 Available service activity diagram ..................................................................................... 29
Figure 10 Search activity diagram .................................................................................................... 30
Figure 11 High level Class diagram .................................................................................................. 33
Figure 12 Sequence diagram for updating content ......................................................................... 37
Figure 13 Sequence diagram for deleting content ........................................................................... 38
Figure 14 Sequence diagram for uploading content ........................................................................ 39
Figure 15 Sequence diagram for search ........................................................................................... 40
Figure 16 Overview of the new system ............................................................................................. 43
Figure 17 Components diagram for subsystem decomposition ...................................................... 44
Figure 18 Deployment diagram for hardware/software mapping ................................................. 45
Figure 19 Detailed class diagram ..................................................................................................... 51
Figure 20 Package diagram ............................................................................................................... 52
1
CHAPTER ONE
1.1. Introduction
A mobile device, which is also referred to as a handheld device or handheld computer, is a
pint-sized computing device. Mobile devices usually come with a touch or non-touch display
screen and sometimes, even a mini keyboard. There are many types of mobile devices; the
commonest ones are mobile phones, smart phones, PDAs, pagers and Personal Navigation
Devices. PDAs and smart phones are among the most preferred mobile devices, which offer
all the conveniences of a personal computer, along with a very small form factor.
Although mobile phones have taken over our current society, they have been around for
several decades in some form or another. Beginning in the late 1940s, the technology that
would later be used in today’s cell phones was created and the idea of a mobile phone was
introduced. This cell technology was first used in mobile rigs which were mainly used in
taxis, police cars and other emergency vehicles and situations. Truckers also used a form of
this technology to communicate with each other. The first mobile phones, referred to as First
Generation or 1G, were introduced to the public market in 1983 by the Motorola Company.
These first mobile phones used analog technology which was much less reliable than the
digital technology we use today. The analog phones also had a great deal more static and
noise interference than we are accustomed to today. The main purpose of this First
Generation technology was for voice traffic, but consumers felt insecure about people
listening in on their conversations. During the 1990s, great improvements were made in the
mobile phone technology. These phones used Second Generation, or 2G technology. In 1990,
the first cell phone call was made using the new digital technology that became characteristic
of this era. The Second Generation cellular phone technology was faster and much quieter
than its analog predecessor. As a result, it became even more popular than previous models,
too. The new technology also made them capable of being smaller rather than the large
briefcase-sized units from the 1980s.The Third Generation technology, or 3G, is what many
people currently use in their digital cellular phones today. This technology was created very
soon after the excitement that the 2G technology created. This new technology is not only
capable of transferring voice data (such as a phone call), but it is also able to transfer other
types of data, including emails, information and instant messages. There are currently plans
TOURGONDAR CITY GUIDE MOBILE APPLICATION
2
in place to develop a Fourth Generation – 4G – technology. Goals for this new set of
standards include a combination of technologies that will make information transfer and
internet capabilities faster and more affordable for cellular phones.
A mobile application (or mobile app) is a software application designed to run on smart
phone, tablet computer and other mobile devices. They are usually available through
application distribution platforms, which are typically operated by the owner of the mobile
operating system. A mobile operating system (OS) is software that allows smart phones,
tablet Pcs and other devices to run applications and programs. A mobile OS typically starts
up when a device powers on, presenting a screen with icons or tiles that present information
and provide application access. Mobile operating systems also manage cellular and wireless
network connectivity, as well as phone access. Examples of mobile device operating systems
include Apple iOS, Google Android, BlackBerry OS, Nokia’s Symbian, Hewlett-Packard’s
webOS (formerly Palm OS) and Microsoft’s Windows Phone OS. Android is one of the most
popular Linux based mobile operating system.[1]
1.2. Background
The mobile phone device is a very important communication tool as it was built to enhance
social contacts and network while enhancing business productivity. The mobile phone
enables us to be on time during appointments. It also helps in verifying the degree of
temperature to enable us chose appropriate dress code for the day. It keeps us informed on
current events because of its connectivity to the internet. It relaxes it also when we play
games with it or listen to music through it. The mobile device can provide the information
about something and also it detecting the location of the user.
Today, a mobile application plays a great role in our day to day activities. Tour Gondar
application is a city guide mobile application which is run in the smart phones. This
application provides basic information about the services which reside Gondar town like
Hotels, Restaurants, Attraction places, Banks, Tour and Travel agents and Health centers.
The application informs the current events in the town and also it detects the current location
of the users.
TOURGONDAR CITY GUIDE MOBILE APPLICATION
3
1.3. Statement of the problem
Gondar is one of the oldest and historical town in Ethiopian history. In this town there are
money Attraction and Historical places, Hotels ,Restaurants, Banks, Health centers and Tour
and Travel agents and also many events are happen in this town like the great epiphany
ceremony (carnival). But the people which are living in this town and also the visitors cannot
access the information about the service providers and events easily. More specific problem
listed as follows:
User cannot access well organized information at anywhere about service provider
like Hotels, Restaurants, Attraction and Historical places ,Banks, Health centers and
Tour and Travel Agents.
User cannot get information about service provider for 24/7 hours.
When there is a new event(like carnival ceremony) happen in the town the user must
be wait until announced and post in mass media.
There is no a mechanism a visitor to detect the current location.
Manually system needs more human power and time.
1.4. Objective of the project
The general and specific objectives of the study are described below.
1.4.1 .General objective
The general objective of this project is to developing a city guide android mobile
application.
1.4.2 .Specific objective
In order to achieve the general objective of this project, the following specific objectives are
addressed.
The system provide information about service provider either in Amharic or English
language
The system detect the current location of the user,
The system provide new update information about events like celebrity;
TOURGONDAR CITY GUIDE MOBILE APPLICATION
4
The system also provides a city map to user to search a point of interests like
Attractions places, Hotels and Restaurants.
1.5. Scope of the project
Tour Gondar mobile application is software application which is run only in smartphones and
performs the following activities:
The application gives information about the types of service which is provided by
service provider.
The application provides a working day, time and location of service providers.
The application provides new updated information about service providers and
events.
But the application does not include the following activities:
The application doesn’t provide any information about services provider which is
located outside of Gondar town.
Tour Gondar application is not operates other language rather than Amharic and
English languages.
1.6. System Development Methodology
Since the entire project requirements are not well known in detail initially, the development
team chooses prototype system development methodology to develop the new system. The
basic idea of prototype model is that a prototype build, test, and then rework as necessary
until an acceptable prototype is finally achieved from which the complete system or product
can now be developed. It is an iterative, trial-and-error process that takes place between the
developers and the users. The most significant advantage of using prototype system
development methodology is listed as follows:
Users are actively involved in the development.
Errors can be detects much earlier.
Quicker user feedback is available leading to better solutions.
Missing functionality can be identifying easily.
Confusing or difficult functions can be identifying.
TOURGONDAR CITY GUIDE MOBILE APPLICATION
5
Since in this methodology a working model of the system is provided, the users get a
better understanding of the system being developed.[2]
1.6.1. Investigation (fact-finding) methods
For gathering information to our project we use different methods.
Observation: Observation is one of the most important methodologies to gathering
information by physical going to the place and looks how the current system. It can
be very difficult for humans to explain what they do or to even describe accurately
how they achieve a task, so observation very crucial to gathering information.
Interview: Interview is another important methodology to gathering information by
asking someone a set of questions. It helps us to get critical and important
information about the overall view of the current system.
Document analysis: This is also another information gathering methodology by
referring the document of the existing system.
1.6.2. System Development Tools
1.6.2.1. Hardware
The system needs different materials to develop the mobile application and to run the system
in the real world, the basic hardware are:
Personal computer(PC)
Android platform mobile
Flash disc
Digital camera
1.6.2.2. Software
We use the following tools to develop the mobile application:
Eclipse (IDE)
MySQL
Apache
TOURGONDAR CITY GUIDE MOBILE APPLICATION
6
Edraw-max
Adobe Photoshop
Microsoft Word
1.7. Significance of the project
At the end of this project, the application will raise the following significance for the users
and the town.
The user can access organized information about services at anywhere and at any
time.
The users (visitors) can easily detecting the current location.
The user can find the services in a simple user interface.
When we develop the mobile application there is some significant role in developing
technology by making the society more interact with technology, this leads to the
Gondar town to shift one step in technology.
1.8. Beneficiaries
The most beneficiaries are:
User: when the users use this mobile application it saves their time and money.
Town: it will enhance the development of the town in the side of technology.
TOURGONDAR CITY GUIDE MOBILE APPLICATION
7
1.9. Time schedule
Figure 1 Time schedule
8
CHAPTER TWO
2. Requirement Analysis
2.1. Introduction
Requirements analysis, also called requirements engineering, is the process of determining
user expectations for a new or modified product. These features, called requirements, must be
quantifiable, relevant and detailed. In software engineering, such requirements are often
called functional specification.
Requirements analysis is critical to the success of a systems or software project. The purpose
of Requirements Analysis is to obtain a thorough and detailed understanding of the user
needs and to break it down into discrete requirements, which are then clearly define, review
and agree upon with the Customer Decision-Makers. Requirements Analysis provides the
foundation for the desired product or services. [4]
2.2. Current System
2.2.1. Major function of current system
The major functions of the system that are currently available in Gondar town are providing
information manually about the service providers like Hotels, Restaurants, Tour and Travel
agent, Banks and Health centers. Other function of the current system is providing
information about events manually. Bazars, pamphlet papers and mass media are using to
advertising the town. Generally the current system uses a manually system.
2.2.2. Problem of existing system
As we have observed the existing system it is not preferable for the user since everything is
manually. As mention above the current system providing information about the service
providers and events but it is not attractive for the users and it needs more human power to
perform the activity. And also the way of advertising the town cannot address many people.
The major problems which are found in the existing g system listed as follow as:
Availability: The current system which is existed in Gondar town is not available at
anywhere and at any time. The system does not easily providing information about
TOURGONDAR CITY GUIDE MOBILE APPLICATION
9
the service providers to the user when the user is located outside of Gondar town and
also the system doesn’t work for 24/7 hours.
Performance: The other problem which is resided in the current system is
performance. We are measuring the performance of the current system in terms time.
The time took by the current system to proving information about the service
provider to user so slow.
Data Storage mechanism: The data storage mechanism which is used by the existing
system is manually. The current system used more stationary materials like papers
and pen frequently to store data. Because of this the current system spent more cost
for data storage mechanism.
Efficiency: The other crucial problem which is found in the existing system is
efficiency. We are measuring the efficiency of the current system in terms of
resource: human and time resources. The existing system needs more human power
and time to perform the task like advertising, announcing new information and store
data.
Security: Since the current system used manually system it is easily expose to
security problem. The existing system used hard copy document to store data and it
may be stole the information by unauthorized user easily and it cause a serious
problem.
2.3. Gathering Information
Different fact finding techniques were used to gathering information about the current
system. It is the fundamental activity for the development of the system. Without them data
modeling cannot be constructed. In order to know how the existing system work and what
problem are there we have been using the following fact-finding techniques.
Interviewing
Observations
Document analysis
TOURGONDAR CITY GUIDE MOBILE APPLICATION
10
2.3.1 Requirement Gathering Methodologies
To develop the new system we have to collect information, to collect information we use
different methodologies.
Observation: The development team visiting and take look how the manual system
works.
Interview: The development team interviewed administrator of Gondar town about
how the user gain information about the service provider which available in the
town, what is working time and days of the current system , what kind services are
provided by the current system ,what kind services are not provided by the current
system and also ask the challenge which is found in the current system and we
interviewed manager of tourism office about the general working system of tourism
in Gondar town and also we interviewed some people about how much the current
system is effective.
Document analysis: The development team also referring the document of the
existing system.
2.3.2. Result Found
After interviewing, observing and analyzing of the current system, the development team
found some results those are listed as below:
The current system provide information about service providers manually,
The current system works from Monday to Friday for 7 hours in each day,
The current system provide information about attraction and historical places
manually and
The current system needs more time and human power.
2.4. Proposed System
2.4.1. Overview
We would like to create a mobile city guide application. Users of this application will be able
to search services, historical places and other points of interest by using two type of interface:
either a categorized list or by viewing a map. Users can also see more details of a point of
interest when they select it, like a describing text.
TOURGONDAR CITY GUIDE MOBILE APPLICATION
11
2.4.2 Functional Requirement
It is a function or features that must be include in the new system to satisfy the user needs
and also be acceptable to the user and solve the problem in the current system.
The functionality of this system are:
The system must provide the working time, days and location of the service
providers.
The system must provide a searching mechanism to the user to find information about
service providers.
The system must providing information in either Amharic or English.
The system must provide new updated information about service provider and events.
The system must provide a map view to users to find the points of interest.
2.4.3. Non-Functional Requirement
It deals with the performance, time, cost and so on. It also describes the importance that is
not directly related to the system.
The non-functionalities of the system are:
The user can access the information about the service provider with a second.
Easy user interface to communication with the user.
The user can access more relevant and reliable information.
The user can access information at anywhere for 24/7 hours.
2.4.3.1. User interface and Human Factors
When conceptualizing the mobile applications user interface, there are a few things that you
should keep in mind. Some of the basic things such as clarity of interface, consistency from
one view to the next, and making sure that size and uniformity user interface element .
The user interface of mobile application must be easy for the user to use without any
ambiguity. Tour Gondar city guide mobile application having attractive list view, consistent
user interface and few and uniform buttons. Even if the interface is easy to use the customers,
there will be some difficulties in understanding some part of the system like how to use and
TOURGONDAR CITY GUIDE MOBILE APPLICATION
12
accessing the system. So the user must have some level of experience to accesses and use the
system easily and effectively such as:
The user must have knowledge about how to use the smart phone
2.4.3.2. Documentation
Tour Gondar city guide mobile application provided two documentation which helps to the
user help menu and technical documentation .The help menu providing information to the
user how to use the application. The system might need to be maintained and modified in the
future therefore the maintainers will be provided with technical documentation which are the
analysis, design and implementation documents.
2.4.3.3. Hardware consideration
Tour Gondar City Guide application is deploy in Android 4.2.2 and late versions because
this are the latest’s version for android mobile phone and most people having this versions in
their mobile phone.
Version: Android 4.2.2 versions
Processor: 1GHZ
Memory: at least 512RAM
2.4.3.4. Performance characteristics
The user to access information about the service provider from server it takes only a second.
Since the information is accessed from the database, the new system can support one
thousand users at time and the user can use the system efficiently.
2.4.3.5. Error Handling and Extreme conditions
When the user make an error or extreme condition like that is not allowed by the system, the
system handle error or extreme condition by giving or show an error message and also alert
message to user.
The extreme condition that may occur in this system is:
Out of range(when the user out of Gondar city),the system doesn’t detect the current
location of the user
TOURGONDAR CITY GUIDE MOBILE APPLICATION
13
2.4.3.6. Quality Issues
The new system is reliable, robust compare with the current system and also when we
observe the current system it’s not always available anywhere and anytime as the new
system.
Availability: The new system providing service to the client without concerning the locations
of the user and also it works for 24 hours.
Reliability: The user of the new system can access more relevant and reliable information
about the services and also it detect the current location accurately.
Robustness: The ability of error detecting of the new system more efficient than current
system. Since new system is based on client server architecture when error occurred we just
concerning manly on server side. For this reason we are saving time to detecting error.
Content Richness: The new system providing rich information about Hotels, Restaurants,
Attraction and historical places and events in the town.
In case of our new system user involvement in the development processes is vital
requirement for the quality of the system.
2.4.3.7. System Modifications
In the future the system can be modified in order to have the following extra features that are
not implementing now.
This can be listed as:
Enabling the users to detect the current locations using Wi-Fi rather than GPS.
Enabling the users to viewing offline map rather than online map.
Those new features can be implemented by another programmer or by the team in future.
2.4.3.8. Physical Environment
The System is deploy in each individual smart phone. In order to detect the current location
of the user the system need protection from external factors like those things that does not
make clear line between the device and the sky since the GPS system need a clear line
between the phone and Satellites to detect the location of the user.
TOURGONDAR CITY GUIDE MOBILE APPLICATION
14
2.4.3.9. Security Issues
To protect the application from unauthorized user and malicious attack, we will concern the
security issues into two perspectives: from client and server perspective.
Client perspective
Compared with personal computers or servers, mobile devices store much more sensitive
personal information and are thus attractive targets for attackers seeking financial gain.
Because these devices are always online and have a restricted user interface, it is easier for
attackers to hide their malicious activities. This special issue aims to present high-quality
articles describing security algorithms, protocols, policies, and frameworks for applications
running on modern mobile platforms such as Android, iOS, and Windows Mobile. Security is
a major part of any Android device. Since the system will be hosted on the user smart phone
the user will provide security tools such as antivirus to protect the applications.
Server perspective
An electronic announcement board where authorized users can publish and/or read
announcements. There two types of user, author user and read-only user. The rights of a user
are determined by its type: An author user has the right to create new announcements and to
modify or delete announcements authored by himself. A read-only user has the right to read
all announcements. The announcements are centrally stored in a database server and the
author users and read-only users, can use mobile devices to perform their application related
operations remotely. The core of the application is built on mobile database technology. So
by giving such kind of privilege to the user, we can protect the data in database server from
unauthorized user.
2.4.3.10. Resource Issues
The system has a resource that requires the following performance characteristics:
The smart phone must have enough memory space to process the application.
The smart phone must have high processor speed.
The phone must have a latest version of android OS.
TOURGONDAR CITY GUIDE MOBILE APPLICATION
15
2.5. System Model
A system model is the conceptual model that describes and represents a system. A system
comprises multiple views such as planning, requirement analysis, design, implementation,
deployment, structure, behavior, input data, and output data views. A system model is
required to describe and represent all these multipleviews.
System modeling is intended to assist in developing and maintaining large systems with
emphasis on the Construction phase. The idea is to encapsulate complex or changeable
aspects of a design inside separate components with well-defined interfaces indicating how
each component interacts with its environment. Complete systems are then developed by
composing these components. System modeling can increase reliability and reduce
development cost by making it easier to build systems, to reuse previous built components
within new systems, to change systems to suit changing requirements such as functional
enhancement and platform changes, and to understand systems. In this way, a system model
can satisfy different requirements such as documenting the system, providing a notation for
tools such as consistency checkers and can also be used in the design stage of system
development.[2]
Thus, system modeling is used to ensure that a developing piece of software evolves in a
consistent manner and that the task of integrating software components is simplified.
2.5.1. Scenario
A scenario is a brief narrative, or story, that describes the hypothetical use of a system in one
or more paragraph.
Scenario for update content
Scenario name: Update content
Actor: Administrator
Flow event: 1. Administrator request for updating.
2. The system verifies if the user is authorized or not.
3. The system allows to updating the content.
4. Administrator updates the content.
TOURGONDAR CITY GUIDE MOBILE APPLICATION
16
Scenario for delete content
Scenario name: Delete content
Actor: Administrator
Flow event: 1. Administrator request for deleting.
2. The system verifies if the user is authorized or not.
3. The system allow to deleting the content
4. Administrator deletes the content.
Scenario for upload content
Scenario name: Upload content
Actor: Administrator
Flow event: 1. Administrator request for upload.
2. The system verifies if the user is authorized or not.
3. The system allows to uploading the content.
4. Administrator uploads the content
Scenario for change language
Scenario name: Change language
Actor: User
Flow event: 1. User touches on link which is allowed to change the language.
2. The system changed into the selected language.
Scenario for detect location
Scenario name: Detect location
Actor: User
Flow event: 1. User starts the application.
2. The system starts detecting the current location.
TOURGONDAR CITY GUIDE MOBILE APPLICATION
17
3. The system displays the current location.
Scenario for Attractions
Scenario name: Attractions
Actor: User
Flow event: 1. User touches on attraction link.
2. The system listed different attractions and historical places.
3. The user selects one of the types.
4. The system display basic information about the particular place.
Scenario for Available services
Scenario name: Available services
Actor: User
Flow event: 1. User touches on service link.
2. The system listed different available services.
3. The user selects one of the types.
4. The system display basic information about the particular service.
2.5.2. Use case Model
2.5.2.1. Use case diagram
Use case diagram is a visual depiction of the different scenarios of the interaction between
actor and use case. An actor is an idealization of an external person, process, things that
interact with the system or subsystem. A use case is logical description of the slice of the
system functionality.[3]
TOURGONDAR CITY GUIDE MOBILE APPLICATION
18
Figure 2 Use case diagram
TOURGONDAR CITY GUIDE MOBILE APPLICATION
19
2.5.2.2. Description of Use case Model
Actor description
Name: Administrator
Description: A person who is responsible for updating, deleting, and uploading information.
Name: User
Description: Someone who wants to visit Gondar town. She/he can access information about
the service providers and events in Gondar town.
Use case description
Use case Name: Update Content
Actor: Administrator
Description: Administrator changes some new information to the application.
Precondition: Administrator should have some new information to add in the
application.
Main sequence: 1. Administrator makes a link to the database.
2. Administrator enters valid user name and password.
3. Administrator changes the old information by the new one.
4. Post the new information to the application.
5. Use case ends.
Alternative sequence: 2. Invalid inputs, system display invalid user name and password.
Post condition: New information is added.
Use case Name: Delete Content
Actor: Administrator
Description: Administrator deleting unnecessary information from the application.
Precondition: Administrator should have some data to be deleted.
Main sequence: 1. Administrator makes a link to the database.
TOURGONDAR CITY GUIDE MOBILE APPLICATION
20
2. Administrator enters a valid user name and password.
3. The administrator deletes some data from the existed one which is
Unnecessary currently.
4. Display to the application.
5. Use case ends.
Alternative sequence: 2. Invalid input system display invalid user name and password.
Post condition: Data is deleted successfully.
Use case Name: Upload Content
Actor: Administrator
Description: Administrator adds a new data to the application.
Precondition: Administrator should have new information to add in the application.
Main sequence: 1 .Administrator makes a link to the database.
2. Administrator enters valid user name and password.
3. Administrator adds new data.
4. Display to the application.
5. Use case ends
Alternative sequence: 2. Invalid input. System display invalid user name and password
Post condition: New information is added successfully.
Use case Name: Change Language
Actor: User
Description: The user can change the language either Amharic or English.
Precondition: Home screen displayed with “ወደአማርኛ” or “To English ” button.
Main sequence: 1. User touch on ወደአማርኛ or To English button.
2. The application changed into the selected language.
TOURGONDAR CITY GUIDE MOBILE APPLICATION
21
3. Use case ends.
Alternative sequence: 1.If the user does not want to change language, he/she will not be
touch on “ወደአማርኛ” or “To English” button.
Post condition: Language successfully changed.
Use case Name: Detect Location
Actor: User
Description: The user can detect the current location automatically in every 10 meters.
Precondition: The user should run the application.
Main sequence: 1. User run the application.
2. The system automatically detecting the current location in every 10
meters.
3. Use case ends.
Alternative sequence: 1. Out of Range location, system display “You are out Reach” alert
message.
Post condition: The system displays the current location.
Use case Name: Attraction
Actor: User
Description: User can access basic information about attraction and historical place.
Precondition: Home screen displayed with Attraction link.
Main sequence: 1. User touch on Attraction link.
2. The System listed attracting and historical place.
3. Select one of type.
4. System display information about particular place.
5. Use case ends.
TOURGONDAR CITY GUIDE MOBILE APPLICATION
22
Alternative sequence: 1.If user does not want to see attracting and historical place, he/she
will not be touch on Attraction link.
Post condition: System display basic information about particular place
Use case Name: Available Service
Actor: User
Description: User selects the serviceto get information about the service provider.
Precondition: Home screen displayed with servicelink.
Main sequence: 1 .User touch on servicelink.
2. The system listed different service provider.
3. Select one of the types.
4. System display information about a particular service provider.
5. Use case ends.
Alternative sequence: 2.If the user does not want to get information about the service, he/she
will not be touch on service link
Post condition: System display basic information about a particular service.
Use case Name: Search
Actor: User
Description: The user enters the text in search text field and the system retrieves
information from the database that match with the input text.
Precondition: The search text field appears on each service screen.
Main sequence: 1.The user enters the text in the search text field.
2. Touch on filter button.
3. Use case ends.
Alternative sequence: 2. Mismatch input text.
Post condition: The system retrieves information that match with the input text.
TOURGONDAR CITY GUIDE MOBILE APPLICATION
23
2.5.3. Activity Diagram
Activity diagram is basically a flow chart to represent the flow form one activity to another
activity. The activity can be described as an operation of the system.[3]
.
Figure 3 Update content activity diagram
TOURGONDAR CITY GUIDE MOBILE APPLICATION
24
Figure 4 Delete content activity diagram
TOURGONDAR CITY GUIDE MOBILE APPLICATION
25
Figure 5 Upload content activity diagram
TOURGONDAR CITY GUIDE MOBILE APPLICATION
26
Figure 6 Change language activity diagram
TOURGONDAR CITY GUIDE MOBILE APPLICATION
27
Figure 7 Detect location activity diagram
TOURGONDAR CITY GUIDE MOBILE APPLICATION
28
Figure 8 Attraction activity diagram
TOURGONDAR CITY GUIDE MOBILE APPLICATION
29
Figure 9 Available service activity diagram
TOURGONDAR CITY GUIDE MOBILE APPLICATION
30
Figure 10 Search activity diagram
TOURGONDAR CITY GUIDE MOBILE APPLICATION
31
2.5.4. Object Model
2.5.4.1. Data Dictionary
User –has the following attributes
Name
Location
Administrator-has the following attributes
User Name
Password
Location detector -has the following attributes
Outdoor
Language-has the following attributes
Amharic Label
English Label
Events-has the following attributes
Cultural event
Religious event
Institutional event
Service provider-has the following attributes
Name
Location
Phone no.
Web site
Hotels- has the following attributes
Hotels_services
Restaurant- has the following attributes
Restaurant_services
TOURGONDAR CITY GUIDE MOBILE APPLICATION
32
Police station- has the following attributes
Police_services
Bank- has the following attributes
Bank_services
Health center- has the following attributes
Medical_services
Hospital- has the following attributes
Examine
Bed_room
Clinic- has the following attributes
Drugs_shop
Tour and Travel agent- has the following attributes
Tour_services
Car_rentals
Attraction- has the following attributes
Cultural
Natural
Pictures - has the following attributes
Category
Image
2.5.4.2. Class Modeling
The purpose of the class diagram is to model the static view of an application. The class
diagrams are the only diagrams which can be directly mapped with object oriented languages
and thus widely used at the time of construction.[3]
TOURGONDAR CITY GUIDE MOBILE APPLICATION
33
High level Class diagram for the new system.
Figure 11 High level Class diagram
TOURGONDAR CITY GUIDE MOBILE APPLICATION
34
2.5.4.3. Dynamic Modeling
State chart diagram
Figure 12 state chart diagrams for administrator
TOURGONDAR CITY GUIDE MOBILE APPLICATION
35
Figure 13 State chart diagram for users
TOURGONDAR CITY GUIDE MOBILE APPLICATION
36
Sequence Diagram
A sequence diagram is an interaction diagram that shows how processes operate with one
another and in what order. It is a construct of a Message Sequence Chart. A sequence
diagram shows object interactions arranged in time sequence. It depicts the objects and
classes involved in the scenario and the sequence of messages exchanged between the objects
needed to carry out the functionality of the scenario. Sequence diagrams are typically
associated with use case realizations in the Logical View of the system under development.
Sequence diagrams are sometimes called event diagrams, event scenarios
A sequence diagram shows, as parallel vertical lines (lifelines), different processes or objects
that live simultaneously, and, as horizontal arrows, the messages exchanged between them, in
the order in which they occur. This allows the specification of simple runtime scenarios in a
graphical manner.[3]
TOURGONDAR CITY GUIDE MOBILE APPLICATION
37
Here is some sequence diagram of the new system.
Figure 12 Sequence diagram for updating content
TOURGONDAR CITY GUIDE MOBILE APPLICATION
38
Figure 13 Sequence diagram for deleting content
TOURGONDAR CITY GUIDE MOBILE APPLICATION
39
Figure 14 Sequence diagram for uploading content
TOURGONDAR CITY GUIDE MOBILE APPLICATION
40
Figure 15 Sequence diagram for search
41
2.5.5. User Interface
Figure 16 User interface
TOURGONDAR CITY GUIDE MOBILE APPLICATION
42
CHAPTER THREE
3. System Design
3.1. Introduction
Systems design is the process of defining the architecture, components, modules, interfaces,
and data for a system to satisfy specified requirements. The System Design Document
describes the system requirements, operating environment, system and subsystem
architecture, files and database design, input formats, output layouts, human-machine
interfaces, detailed design, processing logic, and external interfaces.
In this chapter we try to discuss the design part and also we see the architecture part. After
this has been done, the analysis was completed using different UML diagram. System design
is the first step to get into the solution domain. In this document we will try to describe the
design aspect of the new system.[2]
3.2. Current software architecture
In the city currently there is no any software in use to guide the city for the users.
3.3. Proposed software architecture
3.3.1. Overview
We try show the bird’s eye view of the new system so that, the software architecture for each
subsystem functionality will be the following.
TOURGONDAR CITY GUIDE MOBILE APPLICATION
43
Figure 16 Overview of the new system
3.3.2. Subsystem decomposition
Component diagram is a special kind of diagram in UML. It does not describe the
functionality of the system but it describes the components used to make those
functionalities.
So from that point component diagrams are used to visualize the physical components in a
system. Component diagrams can also be described as a static implementation view of a
system. Static implementation represents the organization of the components at a particular
moment.
Use component diagram to partition a system into subcomponents. The main subsystem of
the system list as follows:
User Interface subsystem
Database subsystem
Account Management subsystem.[3]
TOURGONDAR CITY GUIDE MOBILE APPLICATION
44
Figure 17 Components diagram for subsystem decomposition
TOURGONDAR CITY GUIDE MOBILE APPLICATION
45
3.3.3. Hardware/Software mapping
Deployment diagrams are used for describing the hardware components where software
components are deployed.[3]
Figure 18 Deployment diagram for hardware/software mapping
TOURGONDAR CITY GUIDE MOBILE APPLICATION
46
3.3.4. Persistent data management
Persistence modeling is used to communicate the design of the database, usually to the
developers. It is also used to describe the persistence data aspect of the system.
Scheme diagram
Events
Information Pictures
Table 1 Events
Hotels
Hotels-name Location Phone_no e-mail Hotel_services
Table 2 hotels
Hotel pictures
Hotels-name Category pictures
Table 3 hotels pictures
Restaurants
Restu-name Location Phone_no e-mail Restuarant_services
Table 4 restaurants
TOURGONDAR CITY GUIDE MOBILE APPLICATION
47
Restaurant pictures
Restu-name Category pictures
Table 5 restaurant pictures
Attractions
Att-name Location Phone_no e-mail Services
Table 6 attractions
Attraction pictures
Att-name Category pictures
Table 7 attraction pictures
Bank
Bank-name Location Phone_no e-mail Bank_services
Table 8 bank
Bank pictures
Bank-name Category pictures
Table 9 bank pictures
TOURGONDAR CITY GUIDE MOBILE APPLICATION
48
Health centers
HealthCenter-name Location Phone_no e-mail Medical_services
Table 10 health center
Health center pictures
HealthCenter-name Category pictures
Table 11 health center pictures
Police station
Poli-name Location Phone-no e-mail Police_services
Table 12 police station
Police station pictures
Poli-name Category pictures
Table 13 police station pictures
Tour and Travel agent
TTA-name Location Phone_no e-mail Tour_services Car_rental
Table 14 tour and travel agent
TOURGONDAR CITY GUIDE MOBILE APPLICATION
49
TTA pictures
TTA-name Category Pictures
Table 15 TTA pictures
3.3.5. Access control and security
In this new system different actor have access to different functionality and data. Who can
access what is by using an access control matrix is describe in the following table. The
following table describes an actor who is involved in the scene and the possible benefit
assigned to the actor.
Actor Privilege
User requestToView();
Administrator uploadData();
updataData();
deleteData();
Table 16 Access control and security
TOURGONDAR CITY GUIDE MOBILE APPLICATION
50
3.3.6. Subsystem services
In this section try to cover the main subsystems that are used in the system and the service
provide by each subsystem. Those are:
User interface subsystem: this subsystem used to interact the user with system and it
is majorly connected with the database subsystem for displaying up to date
information that is stored in database.
Database subsystem: this subsystem is used to perform the task that is performed by the
administrator. The tasks that are performed in the database are updating information such as
deleting and uploading information.
Account management subsystem: this subsystem is used to perform user management
and validating there account.
TOURGONDAR CITY GUIDE MOBILE APPLICATION
51
3.3.7. Detailed class diagram
Figure 19 Detailed class diagram
TOURGONDAR CITY GUIDE MOBILE APPLICATION
52
3.3.8. Package
Package diagram is UML structure diagram which shows packages and dependencies
between the packages. Package diagram enables you to gain a high level understanding of the
collaboration among model elements through analyzing the relationships among their parent
package. This also helps explain the system's architecture from a broad view.[3]
Figure 20 Package diagram
TOURGONDAR CITY GUIDE MOBILE APPLICATION
53
CHAPTER FOUR
4. Implementation
4.1. Mapping models to code
The system has the following actors.
Administrator
User
The administrator who controls all over the system and access the tables in the database these
are:
Administrator
Figure 22 Mapping model for administrator
Notice: The administrator has permission of managing or controlling the application and it
has one to one relationship.
Events
Hotels
Restaurants
Attractions
Banks
Health Centers
Tour and Travel agent
TOURGONDAR CITY GUIDE MOBILE APPLICATION
54
The users can view and access information from the database.
User
Figure 23 Mapping model for User
Notice: The user has the permission to view information that is filled by administrator.It has
one to one relationship.
Events
Hotels
Restaurants
Attractions
Banks
Health Centers
Tour and Travel agent
TOURGONDAR CITY GUIDE MOBILE APPLICATION
55
4.2. Source codes of major classes, packages or interfaces
//Android manifest file for Gondar city guide application
<?xmlversion="1.0"encoding="utf-8"?> <manifestxmlns:android="http://schemas.android.com/apk/res/android" package="com.example.gondarcityguide" android:versionCode="1" android:versionName="1.0"> <uses-sdk android:minSdkVersion="8" android:targetSdkVersion="17"/> <permissionandroid:name="com.example.gondarcityguide.permission.MAPS_RECEIVE" android:protectionLevel="signature"/> <uses-permissionandroid:name="com.example.gondarcityguide.permission.MAPS_RECEIVE"/> <uses-permissionandroid:name="android.permission.INTERNET"/> <uses-permissionandroid:name="android.permission.ACCESS_NETWORK_STATE"/> <uses-permissionandroid:name="com.google.android.providers.gsf.permission.READ_GSERVICES"/> <uses-permissionandroid:name="android.permission.WRITE_EXTERNAL_STORAGE"/> <uses-permissionandroid:name="android.permission.ACCESS_COARSE_LOCATION"/> <uses-permissionandroid:name="android.permission.ACCESS_FINE_LOCATION"/> <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="com.example.gondarcityguide.Home_Eng" android:label="@string/app_name"> <intent-filter> <actionandroid:name="android.intent.action.MAIN"/>
TOURGONDAR CITY GUIDE MOBILE APPLICATION
56
<categoryandroid:name="android.intent.category.LAUNCHER"/> </intent-filter> </activity> <activityandroid:name=".Home_Amh"android:label="ጎንድርንይጎብኙ"></activity> <activityandroid:name=".Hotel_Eng"android:label="Hotels"android:icon="@drawable/hotels"></activity> <activityandroid:name=".Hotel_Amh"android:label="ሆቴል"android:icon="@drawable/hotels"></activity> <activityandroid:name=".Restaurant_Eng"android:label="Restaurants"android:icon="@drawable/resturant"></activity> <activityandroid:name=".Restaurant_Amh"android:label="ሬስቶራንት"android:icon="@drawable/resturant"></activity> <activityandroid:name=".Attraction_Eng"android:label="Attractions"android:icon="@drawable/attraction"></activity> <activityandroid:name=".Attraction_Amh"android:label="መስብ"android:icon="@drawable/attraction"></activity> <activityandroid:name=".Bank_Eng"android:label="Banks"android:icon="@drawable/bank"></activity> <activityandroid:name=".Bank_Amh"android:label="ባንክ"android:icon="@drawable/bank"></activity> <activityandroid:name=".FourSistersRestaurant_Eng"android:label="Four Sisters Restaurant"android:icon="@drawable/resturant"/> <activityandroid:name=".FourSistersRestaurant_Amh"android:label="ፎርሲስተር "android:icon="@drawable/resturant"></activity> <activityandroid:name=".MasterChefRestaurant_Eng"android:label="Master Chef Restaurant"android:icon="@drawable/resturant"></activity> <activityandroid:name=".MasterChefRestaurant_Amh"android:label="ማስተርቼፍ"android:icon="@drawable/resturant"></activity> <activityandroid:name=".DashenBreweryRestaurant_Eng"android:label="Dashen Brewery Restaurant"android:icon="@drawable/resturant"></activity> <activityandroid:name=".DashenBreweryRestaurant_Amh"android:label="ዳሽንቢራ"android:icon="@drawable/resturant"></activity> <activityandroid:name=".GohaHotelRestaurant_Eng"android:label="Goha Hotel Restaurant"android:icon="@drawable/resturant"></activity> <activityandroid:name=".GohaHotelRestaurant_Amh"android:label="ጎሃሆቴልሬስቶራንት"android:icon="@drawable/resturant"></activity> <activityandroid:name=".TayeBelayHotelRestaurant_Eng"android:label="Taye Belay Hotel Restaurant"android:icon="@drawable/resturant"></activity> <activityandroid:name=".TayeBelayHotelRestaurant_Amh"android:label="ታዬበላይሆቴልሬስቶራንት"android:icon="@drawable/resturant"></activity> <activityandroid:name=".HashBazRestaurant_Eng"android:label="Hash-Baz Restaurant"android:icon="@drawable/resturant"></activity>
TOURGONDAR CITY GUIDE MOBILE APPLICATION
57
<activityandroid:name=".HashBazRestaurant_Amh"android:label="ሀሽ -ባዝ"android:icon="@drawable/resturant"></activity> <activityandroid:name=".EliltaCulturalRestaurant_Eng"android:label="Elilta Cultural Restaurant"android:icon="@drawable/resturant"></activity> <activityandroid:name=".EliltaCulturalRestaurant_Amh"android:label="እልልታየባህልሬስቶራንት"android:icon="@drawable/resturant"></activity> <activityandroid:name=".HabeshaKitfoRestaurant_Eng"android:label="Habesha Kitfo Restaurant"android:icon="@drawable/resturant"></activity> <activityandroid:name=".HabeshaKitfoRestaurant_Amh"android:label="ሀበሻክትፎ ሬስቶራንት"android:icon="@drawable/resturant"></activity> <activityandroid:name=".MiniFogeraRestaurant_Eng"android:label="Mini Fogera Restaurant"android:icon="@drawable/resturant"></activity> <activityandroid:name=".MiniFogeraRestaurant_Amh"android:label="ሚኒፎገራሬስቶራንት"android:icon="@drawable/resturant"></activity> <activityandroid:name=".HabeshaCoffeeRestaurant_Eng"android:label="Habesha Coffee Restaurant"android:icon="@drawable/resturant"/> <activityandroid:name=".HabeshaCoffeeRestaurant_Amh"android:label="ሀበሻኮፊሬስቶራንት "android:icon="@drawable/resturant"></activity> <activityandroid:name=".CircleHotelRestaurant_Eng"android:label="Circle Hotel Restaurant"android:icon="@drawable/resturant"></activity> <activityandroid:name=".CircleHotelRestaurant_Amh"android:label="ሰርክልሆቴልሬስቶራንት"android:icon="@drawable/resturant"></activity> <activityandroid:name=".AgHotel_Eng"android:label="AG Hotel"android:icon="@drawable/hotels"></activity> <activityandroid:name=".AgHotel_Amh"android:label="ኤጂሆቴል"android:icon="@drawable/hotels"></activity> <activityandroid:name=".LShapeHotel_Eng"android:label="L-Shape Hotel"android:icon="@drawable/hotels"></activity> <activityandroid:name=".LShapeHotel_Amh"android:label="ኤል-ሼፕሆቴል"android:icon="@drawable/hotels"></activity> <activityandroid:name=".FloridaHotel_Eng"android:label="Florida International Hotel"android:icon="@drawable/hotels"></activity> <activityandroid:name=".FloridaHotel_Amh"android:label="ፍሎሪዳኢተርናሽናልሆቴል"android:icon="@drawable/hotels"></activity> <activityandroid:name=".TayeBelayHotel_Eng"android:label="Taye Belay Hotel"android:icon="@drawable/hotels"></activity> <activityandroid:name=".TayeBelayHotel_Amh"android:label="ታዬበላይሆቴል"android:icon="@drawable/hotels"></activity> <activityandroid:name=".GohaHotel_Eng"android:label="Goha Hotel"android:icon="@drawable/hotels"></activity> <activityandroid:name=".GohaHotel_Amh"android:label="ጎሃሆቴል"android:icon="@drawable/hotels"></activity> <activityandroid:name=".QuaraHotel_Eng"android:label="Quara Hotel"android:icon="@drawable/hotels"></activity> <activityandroid:name=".QuaraHotel_Amh"android:label="ቋራሆቴል"android:icon="@drawable/hotels"></activity>
TOURGONDAR CITY GUIDE MOBILE APPLICATION
58
<activityandroid:name=".NewFesicaHotel_Eng"android:label="New Fesica Hotel"android:icon="@drawable/hotels"></activity> <activityandroid:name=".NewFesicaHotel_Amh"android:label="ኒውፋሲካሆቴል"android:icon="@drawable/hotels"></activity> <activityandroid:name=".YalewAykerHotel_Eng"android:label="Yalew Ayker Hotel"android:icon="@drawable/hotels"></activity> <activityandroid:name=".YalewAykerHotel_Amh"android:label="ያለውአይቀርሆቴል"android:icon="@drawable/hotels"></activity> <activityandroid:name=".LammergeyerHotel_Eng"android:label="Lammergeyer Hotel"android:icon="@drawable/hotels"></activity> <activityandroid:name=".LammergeyerHotel_Amh"android:label="ላመርገየርሆቴል"android:icon="@drawable/hotels"></activity> <activityandroid:name=".FogeraHotel_Eng"android:label="Fogera Hotel"android:icon="@drawable/hotels"></activity> <activityandroid:name=".FogeraHotel_Amh"android:label="ፎገራሆቴል"android:icon="@drawable/hotels"></activity> <activityandroid:name=".CircleHotel_Eng"android:label="Circle Hotel"android:icon="@drawable/hotels"></activity> <activityandroid:name=".CircleHotel_Amh"android:label="ሰርክልሆቴል"android:icon="@drawable/hotels"></activity> <activityandroid:name=".QueensHotel_Eng"android:label="Queens Hotel"android:icon="@drawable/hotels"></activity> <activityandroid:name=".QueensHotel_Amh"android:label="ኪዊስሆቴል"android:icon="@drawable/hotels"></activity> <activityandroid:name=".LandmarkHotel_Eng"android:label="Landmark Hotel"android:icon="@drawable/hotels"></activity> <activityandroid:name=".LandmarkHotel_Amh"android:label="ጎንደርላድማርክሆቴል"android:icon="@drawable/hotels"></activity> <activityandroid:name=".JantekleHotel_Eng"android:label="Jantekle Hotel"android:icon="@drawable/hotels"></activity> <activityandroid:name=".JantekelHotel_Amh"android:label="ጃንተክልሆቴል"android:icon="@drawable/hotels"></activity> <activityandroid:name=".DebreBerhanSelassie_Eng"android:label="Debre Berhan Selassie"android:icon="@drawable/attraction"></activity> <activityandroid:name=".DebreBerhanSelassie_Amh"android:label="ደብረብርሃንስላሴ "android:icon="@drawable/attraction"></activity> <activityandroid:name=".SimenLandTour_Eng"android:label="Simen Land Tour"android:icon="@drawable/attraction"></activity> <activityandroid:name=".SimenLandTour_Amh"android:label="የሰሜንተራሮች"android:icon="@drawable/attraction"></activity> <activityandroid:name=".FasilGehbbi_Eng"android:label="Fasil Gehbbi"android:icon="@drawable/attraction"></activity> <activityandroid:name=".FasilGehbbi_Amh"android:label="ፋሲልግቢ"android:icon="@drawable/attraction"></activity> <activityandroid:name=".FasiladasBath_Eng"android:label="Fasiladas Bath Timket"android:icon="@drawable/attraction"></activity>
TOURGONDAR CITY GUIDE MOBILE APPLICATION
59
<activityandroid:name=".FasiladasBath_Amh"android:label="የፋሲለደስመዋኛገንዳ"android:icon="@drawable/attraction"></activity> <activityandroid:name=".Gondar_Eng"android:label="Gondar"android:icon="@drawable/attraction"></activity> <activityandroid:name=".Gondar_Amh"android:label="ጎንደር"android:icon="@drawable/attraction"></activity> <activityandroid:name=".AtseBekefa_Eng"android:label="Atse Bekefa"android:icon="@drawable/attraction"></activity> <activityandroid:name=".AtseBekefa_Amh"android:label="አዔባካፋየባህልምሽት "android:icon="@drawable/attraction"></activity> <activityandroid:name=".Event_Eng"android:label="Events"></activity> <meta-data android:name="com.google.android.maps.v2.API_KEY" android:value="Your api key"/> <meta-dataandroid:name="com.google.android.gms.version" android:value="@integer/google_play_services_version" /> </application> </manifest>
//Source code for Get JSON object from URL
package com.example.gondarcityguide; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.UnsupportedEncodingException; import java.util.List; import org.apache.http.HttpEntity; import org.apache.http.HttpResponse; import org.apache.http.NameValuePair; import org.apache.http.client.ClientProtocolException; import org.apache.http.client.entity.UrlEncodedFormEntity; import org.apache.http.client.methods.HttpGet; import org.apache.http.client.methods.HttpPost; import org.apache.http.client.utils.URLEncodedUtils; import org.apache.http.impl.client.DefaultHttpClient; import org.json.JSONException; import org.json.JSONObject; import android.util.Log;
TOURGONDAR CITY GUIDE MOBILE APPLICATION
60
publicclass JSONParser { static InputStream is=null; static JSONObject jObj=null; static String json=""; // constructor public JSONParser(){ } // function get json from url // by making HTTP POST or GET mehtod public JSONObject makeHttpRequest(String url,String method,List<NameValuePair>params){ // Making HTTP request // check for request method try{if(method=="POST") { // request method is POST // defaultHttpClient DefaultHttpClient httpClient = newDefaultHttpClient(); HttpPost httpPost = newHttpPost(url); httpPost.setEntity(new UrlEncodedFormEntity(params)); HttpResponse httpResponse = httpClient.execute(httpPost); HttpEntity httpEntity = httpResponse.getEntity(); is = httpEntity.getContent(); }elseif(method == "GET"){ // request method is GET DefaultHttpClient httpClient = newDefaultHttpClient(); String paramString = URLEncodedUtils.format(params, "utf-8"); url += "?" + paramString; HttpGet httpGet = newHttpGet(url); HttpResponse httpResponse = httpClient.execute(httpGet); HttpEntity httpEntity = httpResponse.getEntity(); is = httpEntity.getContent(); }
TOURGONDAR CITY GUIDE MOBILE APPLICATION
61
}catch(UnsupportedEncodingException e) { e.printStackTrace(); }catch(ClientProtocolException e) { e.printStackTrace(); }catch(IOException e) { e.printStackTrace(); } try{ //BufferedReader reader = new BufferedReader(new InputStreamReader(is, "iso-8859-1"), 8); BufferedReader reader = newBufferedReader(new InputStreamReader(is, "UTF-8"), 8000); StringBuilder sb = newStringBuilder(); String line = null; while ((line = reader.readLine()) != null) { sb.append(line + "\n"); } is.close(); json = sb.toString(); }catch(Exception e) { Log.e("Buffer Error", "Error Converting Result"+e.toString()); } // try parse the string to a JSON object try { jObj=new JSONObject(json); } catch (JSONException e) { Log.e("JSON Parse", "Error parsing"+e.toString()); } // return JSON String returnjObj; } } //Source code for Home Screen in English java code
package com.example.gondarcityguide; import android.os.Bundle; import android.app.Activity;
TOURGONDAR CITY GUIDE MOBILE APPLICATION
62
import android.content.Intent; importandroid.view.Menu; import android.view.View; import android.view.View.OnClickListener; import android.widget.AdapterView; import android.widget.AdapterView.OnItemClickListener; import android.widget.Button; importandroid.widget.ImageButton; import android.widget.ListView; importandroid.widget.TextView; publicclass Home_Eng extends Activity implements OnItemClickListener { ListView listView; Button eventBtnEng; Button btnAmahric; String[] title={"Attractions", "Hotels", "Restaurants", "Banks", "Tour and Travel Agents", "Health Centers", "Police Stations"}; Integer[] imageId={R.drawable.attraction, R.drawable.hotels, R.drawable.resturant, R.drawable.bank, R.drawable.tour, R.drawable.health, R.drawable.police}; @Override protectedvoid onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.home__eng); CustomListHomeEng adapter=newCustomListHomeEng(Home_Eng.this,title,imageId); listView=(ListView) findViewById(R.id.listHomeEng); listView.setAdapter(adapter); listView.setOnItemClickListener(this); btnAmahric=(Button) findViewById(R.id.btnAmahric); btnAmahric.setOnClickListener(new OnClickListener() { @Override
TOURGONDAR CITY GUIDE MOBILE APPLICATION
63
publicvoid onClick(View arg0) { startActivity(new Intent(getApplicationContext(), Home_Amh.class)); } }); eventBtnEng=(Button) findViewById(R.id.eventBtnEng); eventBtnEng.setOnClickListener(new OnClickListener() { @Override publicvoid onClick(View arg0) { startActivity(new Intent(getApplicationContext(), Event_Eng.class)); } }); } @Override publicvoid onItemClick(AdapterView<?> parent, View view, int position, long id) { // TODO Auto-generated method stub //use switch to launch different Activity switch(position){ case 0: Intent att = newIntent(getApplicationContext(), Attraction_Eng.class); startActivity(att); break; case 1: Intent hotel = newIntent(getApplicationContext(), Hotel_Eng.class); startActivity(hotel); break; case 2: Intent res = newIntent(getApplicationContext(), Restaurant_Eng.class); startActivity(res); break; case 3: Intent bank = newIntent(getApplicationContext(), Bank_Eng.class); startActivity(bank); break;
TOURGONDAR CITY GUIDE MOBILE APPLICATION
64
default: break; } } }
//Xml file for Home Screen in English
<RelativeLayoutxmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:gravity="center" tools:context=".Home_Eng"> <TextViewandroid:id="@+id/textLang" android:layout_width="150dp" android:layout_height="38dp" android:text="Language Option" android:paddingLeft="20dp" android:paddingTop="10dp" android:layout_alignParentTop="true" android:textAlignment="center" android:textSize="15dp"/> <Button android:id="@+id/btnAmahric" android:layout_width="174dp" android:layout_height="38dp" android:background="@drawable/toamahricbtn" android:textAlignment="center" android:layout_alignParentRight="true" android:layout_alignParentTop="true" /> <ImageView android:id="@+id/imageView1" android:layout_width="fill_parent" android:layout_height="170dp"
TOURGONDAR CITY GUIDE MOBILE APPLICATION
65
android:layout_alignParentLeft="true" android:src="@drawable/homegondarimageenglish" android:adjustViewBounds="true" android:scaleType="fitXY" android:layout_below="@+id/btnAmahric" /> > <ListView android:id="@+id/listHomeEng" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_alignParentLeft="true" android:layout_below="@+id/cityMapBtnEng" android:paddingTop="10dp"> </ListView> <Button android:id="@+id/cityMapBtnEng" android:layout_width="150dp" android:layout_height="40dp" android:layout_below="@+id/imageView1" android:layout_alignParentRight="true" android:background="@drawable/citymapbtnenglish"/> <Button android:id="@+id/eventBtnEng" android:layout_width="150dp" android:layout_height="40dp" android:layout_alignParentLeft="true" android:layout_below="@+id/imageView1" android:background="@drawable/eventsbtnenglish"/> </RelativeLayout> //Source code for Home Screen in Amharic java code
package com.example.gondarcityguide; import android.app.Activity; importandroid.app.ListActivity; import android.content.Intent; import android.os.Bundle; import android.view.View; import android.view.View.OnClickListener;
TOURGONDAR CITY GUIDE MOBILE APPLICATION
66
import android.widget.AdapterView; import android.widget.AdapterView.OnItemClickListener; import android.widget.Button; import android.widget.ImageButton; import android.widget.ListView; publicclass Home_Amh extends Activity implements OnItemClickListener { ListView listView; ImageButton eventImageBtn; String[] title={ "መስብ", "ሆቴል", "ሬስቶራንት", "ባንክ", "አስጎብኚድርጅት", "የጤናተቀም", "ፖሊስጣቢያ", }; Integer[] imageId={R.drawable.attraction, R.drawable.hotels, R.drawable.resturant, R.drawable.bank, R.drawable.tour, R.drawable.health, R.drawable.police}; @Override protectedvoid onCreate(Bundle savedInstanceState) { // TODO Auto-generated method stub super.onCreate(savedInstanceState); setContentView(R.layout.home_amh); CustomListHomeAmh adapter=newCustomListHomeAmh(Home_Amh.this, title, imageId); listView=(ListView) findViewById(R.id.listHomeAmh); listView.setAdapter(adapter); listView.setOnItemClickListener(this); Button btnToEnglish=(Button) findViewById(R.id.btnEnglish); btnToEnglish.setOnClickListener(new OnClickListener() { @Override publicvoid onClick(View arg0) { startActivity(new Intent(getApplicationContext(), Home_Eng.class)); }
TOURGONDAR CITY GUIDE MOBILE APPLICATION
67
}); } @Override publicvoid onItemClick(AdapterView<?> parent, View view, int position, long id) { //use switch to launch different activity switch(position) { case 0: startActivity(new Intent(getApplicationContext(), Attraction_Amh.class)); break; case 1: startActivity(new Intent(getApplicationContext(), Hotel_Amh.class)); break; case 2: startActivity(new Intent(getApplicationContext(), Restaurant_Amh.class)); break; case 3: startActivity(new Intent(getApplicationContext(), Bank_Amh.class)); break; default: break; } } }
//Xml file for Home Screen in Amharic
<RelativeLayoutxmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:gravity="top" tools:context=".Home_Eng"
TOURGONDAR CITY GUIDE MOBILE APPLICATION
68
> <TextViewandroid:id="@+id/textLangAmh" android:layout_width="150dp" android:layout_height="38dp" android:text="የቋንቋአማራጭ" android:paddingLeft="20dp" android:paddingTop="10dp" android:layout_alignParentTop="true" android:textAlignment="center" android:textSize="15dp"/> <Button android:id="@+id/btnEnglish" android:layout_width="175dp" android:layout_height="38dp" android:background="@drawable/toenglishbtn" android:textAlignment="center" android:layout_alignParentRight="true" android:layout_alignParentTop="true" /> <ImageView android:id="@+id/imageView1" android:layout_width="fill_parent" android:layout_height="170dp" android:layout_alignParentLeft="true" android:src="@drawable/homegondarimageamahric" android:adjustViewBounds="true" android:scaleType="fitXY" android:layout_below="@+id/btnEnglish" /> <Button android:id="@+id/eventBtnAmh" android:layout_width="150dp" android:layout_height="40dp" android:layout_below="@+id/imageView1" android:layout_alignParentLeft="true" android:background="@drawable/eventsbtnamahric" android:paddingLeft="10dp"/> <Button
TOURGONDAR CITY GUIDE MOBILE APPLICATION
69
android:id="@+id/citymapBtnAmh" android:layout_width="150dp" android:layout_height="40dp" android:layout_below="@+id/imageView1" android:layout_alignParentRight="true" android:background="@drawable/citymapbtnamahric"/> <ListView android:id="@+id/listHomeAmh" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_alignParentLeft="true" android:layout_below="@+id/eventBtnAmh" android:paddingTop="10dp"> </ListView> </RelativeLayout> //Source code for Hotel Activity in English java code
package com.example.gondarcityguide; import java.io.File; import java.io.FileOutputStream; import java.io.InputStream; import java.net.HttpURLConnection; import java.net.URL; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import org.apache.http.NameValuePair; import org.json.JSONArray; import org.json.JSONException; import org.json.JSONObject; import android.app.AlertDialog; import android.app.ListActivity; import android.app.ProgressDialog; import android.content.DialogInterface; import android.content.Intent; import android.graphics.Bitmap; import android.graphics.BitmapFactory; import android.os.AsyncTask; import android.os.Bundle; import android.util.Log;
TOURGONDAR CITY GUIDE MOBILE APPLICATION
70
import android.view.View; import android.view.View.OnClickListener; import android.widget.AdapterView; import android.widget.AdapterView.OnItemClickListener; import android.widget.Button; import android.widget.EditText; import android.widget.ListView; import android.widget.SimpleAdapter; publicclass Hotel_Eng extends ListActivity implements OnItemClickListener{ ListView list; EditText getHotel; Button btnFilterHotel; // Progress Dialog private ProgressDialog pDialog; // Creating JSON Parser object JSONParser jParser = newJSONParser(); List<HashMap<String,Object>>hotelList; // url to get all hotels list privatestatic String urlHotel="http://10.139.179.119/test/hotels.php/hotels"; // JSON Node names privatestaticfinal String TAG_HOTELS = "hotels"; privatestaticfinal String TAG_TITLEHOTEL = "TitleHotle"; privatestaticfinal String TAG_DESCHOTEL = "DescHotel"; privatestaticfinal String TAG_IMAGEHOTEL="ImageHotel"; // hotels JSONArray JSONArray hotels=null; @Override protectedvoid onCreate(Bundle savedInstanceState) { // TODO Auto-generated method stub super.onCreate(savedInstanceState); setContentView(R.layout.hotel_eng); // Hashmap for ListView hotelList=new ArrayList<HashMap<String,Object>>();
TOURGONDAR CITY GUIDE MOBILE APPLICATION
71
// Loading hotels in Background Thread new LoadHotels().execute(); //institiatedlistview list=getListView(); list.setOnItemClickListener(this); getHotel=(EditText) findViewById(R.id.getHotel); btnFilterHotel=(Button) findViewById(R.id.btnFilterHotelEng); btnFilterHotel.setOnClickListener(new OnClickListener() { @Override publicvoid onClick(View arg0) { //Text for search String textForSearch=getHotel.getText().toString(); if(textForSearch.equalsIgnoreCase("AG Hotel Gondar")|| textForSearch.equalsIgnoreCase("AG Hotel")|| textForSearch.equalsIgnoreCase("AG")){ //if it is match the string launching the activity startActivity(new Intent(getApplicationContext(), AgHotel_Eng.class)); } elseif(textForSearch.equalsIgnoreCase("L-Shape Hotel")|| textForSearch.equalsIgnoreCase("L Shape Hotel")|| textForSearch.equalsIgnoreCase("LShape Hotel")|| textForSearch.equalsIgnoreCase("L-Shape")|| textForSearch.equalsIgnoreCase("L Shape")|| textForSearch.equalsIgnoreCase("LShape")){ //if it is match the string launching the activity startActivity(new Intent(getApplicationContext(), LShapeHotel_Eng.class)); } elseif(textForSearch.equalsIgnoreCase("Florida International Hotel")|| textForSearch.equalsIgnoreCase("Florida International")||
TOURGONDAR CITY GUIDE MOBILE APPLICATION
72
textForSearch.equalsIgnoreCase("Florida Hotel")|| textForSearch.equalsIgnoreCase("Florida")){ //if it is match the string launching the activity startActivity(new Intent(getApplicationContext(), FloridaHotel_Eng.class)); } elseif(textForSearch.equalsIgnoreCase("Taye Belay Hotel")|| textForSearch.equalsIgnoreCase("Taye Belay")){ //if it is match the string launching the activity startActivity(new Intent(getApplicationContext(), TayeBelayHotel_Eng.class)); } elseif(textForSearch.equalsIgnoreCase("Goha Hotel")|| textForSearch.equalsIgnoreCase("Goha")){ //if it is match the string launching the activity startActivity(new Intent(getApplicationContext(), GohaHotel_Eng.class)); } elseif(textForSearch.equalsIgnoreCase("Quara Hotel")|| textForSearch.equalsIgnoreCase("Quara")){ //if it is match the string launching the activity startActivity(new Intent(getApplicationContext(), QuaraHotel_Eng.class)); } elseif(textForSearch.equalsIgnoreCase("New Fesica Hotel")|| textForSearch.equalsIgnoreCase("New Fesica")){ //if it is match the string launching the activity startActivity(new Intent(getApplicationContext(), NewFesicaHotel_Eng.class)); } elseif(textForSearch.equalsIgnoreCase("Yalew Ayker Hotel")|| textForSearch.equalsIgnoreCase("Yalew Ayker")){ //if it is match the string launching the activity startActivity(new Intent(getApplicationContext(), YalewAykerHotel_Eng.class));
TOURGONDAR CITY GUIDE MOBILE APPLICATION
73
} elseif(textForSearch.equalsIgnoreCase("Lammergeyer Hotel")|| textForSearch.equalsIgnoreCase("Lamergeyer Hotel")|| textForSearch.equalsIgnoreCase("Lammergeyer")|| textForSearch.equalsIgnoreCase("Lamergeyer")){ //if it is match the string launching the activity startActivity(new Intent(getApplicationContext(), LammergeyerHotel_Eng.class)); } elseif(textForSearch.equalsIgnoreCase("Fogera Hotel")|| textForSearch.equalsIgnoreCase("Fogera")){ //if it is match the string launching the activity startActivity(new Intent(getApplicationContext(), FogeraHotel_Eng.class)); } elseif(textForSearch.equalsIgnoreCase("Circle Hotel")|| textForSearch.equalsIgnoreCase("Circle")){ //if it is match the string launching the activity startActivity(new Intent(getApplicationContext(), CircleHotel_Eng.class)); } elseif(textForSearch.equalsIgnoreCase("Queens Hotel")|| textForSearch.equalsIgnoreCase("Queen Hotel")|| textForSearch.equalsIgnoreCase("Queens")|| textForSearch.equalsIgnoreCase("Queen")){ //if it is match the string launching the activity startActivity(new Intent(getApplicationContext(), QueensHotel_Eng.class)); } elseif(textForSearch.equalsIgnoreCase("Gondar Landmark Hotel")|| textForSearch.equalsIgnoreCase("Landmark Hotel")|| textForSearch.equalsIgnoreCase("Gondar Landmark")||
TOURGONDAR CITY GUIDE MOBILE APPLICATION
74
textForSearch.equalsIgnoreCase("Landmark")){ //if it is match the string launching the activity startActivity(new Intent(getApplicationContext(), LandmarkHotel_Eng.class)); } elseif(textForSearch.equalsIgnoreCase("Jantekel Hotel")|| textForSearch.equalsIgnoreCase("Jantekel")){ startActivity(new Intent(getApplicationContext(), JantekleHotel_Eng.class)); } else{ AlertDialog.Builder builder=newAlertDialog.Builder(Hotel_Eng.this); builder.setMessage("Sorry! No Match is Found\n Please check the spelling."); builder.setCancelable(false); builder.setPositiveButton("Ok", new DialogInterface.OnClickListener() { @Override publicvoid onClick(DialogInterface dialog, int which) { Hotel_Eng.this.finish(); } }); AlertDialog alert=builder.create(); alert.show(); } } });
TOURGONDAR CITY GUIDE MOBILE APPLICATION
75
} //Launching differen Activity by click on list item @Override publicvoid onItemClick(AdapterView<?> parent, View view, int position, long id) { //use switch statment to launch Activity switch(position) { case 0: startActivity(new Intent(getApplicationContext(), AgHotel_Eng.class)); break; case 1: startActivity(new Intent(getApplicationContext(), LShapeHotel_Eng.class)); break; case 2: startActivity(new Intent(getApplicationContext(), FloridaHotel_Eng.class)); break; case 3: startActivity(new Intent(getApplicationContext(), TayeBelayHotel_Eng.class)); break; case 4: startActivity(new Intent(getApplicationContext(), GohaHotel_Eng.class)); break; case 5: startActivity(new Intent(getApplicationContext(), QuaraHotel_Eng.class)); break; case 6: startActivity(new Intent(getApplicationContext(), NewFesicaHotel_Eng.class)); break; case 7: startActivity(new Intent(getApplicationContext(), YalewAykerHotel_Eng.class)); break; case 8: startActivity(new Intent(getApplicationContext(), LammergeyerHotel_Eng.class)); break;
TOURGONDAR CITY GUIDE MOBILE APPLICATION
76
case 9: startActivity(new Intent(getApplicationContext(), FogeraHotel_Eng.class)); break; case 10: startActivity(new Intent(getApplicationContext(), CircleHotel_Eng.class)); break; case 11: startActivity(new Intent(getApplicationContext(), QueensHotel_Eng.class)); break; case 12: startActivity(new Intent(getApplicationContext(), LandmarkHotel_Eng.class)); break; case 13: startActivity(new Intent(getApplicationContext(), JantekleHotel_Eng.class)); break; default: break; } } // Response from Edit Product Activity @Override protectedvoid onActivityResult(int requestCode, int resultCode, Intent data) { super.onActivityResult(requestCode, resultCode, data); // if result code 100 if (resultCode == 100) { // if result code 100 is received // means user edited/deleted product // reload this screen again Intent intent = getIntent(); finish(); startActivity(intent); } } //Background Async Task to Load all hotels by making HTTP Request class LoadHotels extends AsyncTask<String, String, String>{
TOURGONDAR CITY GUIDE MOBILE APPLICATION
77
//Before starting background thread Show Progress Dialog protectedvoid onPreExecute() { super.onPreExecute(); pDialog=new ProgressDialog(Hotel_Eng.this); pDialog.setMessage("Loading Hotels ...please wait"); pDialog.setIndeterminate(false); pDialog.setCancelable(false); pDialog.show(); } //getting All Hotels from url @Override protected String doInBackground(String... args) { // Building Parameters List<NameValuePair> params = new ArrayList<NameValuePair>(); // getting JSON string from URL JSONObject json = jParser.makeHttpRequest(urlHotel, "GET", params); // Check your log cat for JSON reponse Log.d("All Hotels: ", json.toString()); //get json Array try { hotels=json.getJSONArray(TAG_HOTELS); // looping through All hotels for (int i = 0; i <hotels.length(); i++) { JSONObject c = hotels.getJSONObject(i); // Storing each json item in variable String TitleHotel = c.getString(TAG_TITLEHOTEL); String DescHotel = c.getString(TAG_DESCHOTEL); String ImageHotel=c.getString(TAG_IMAGEHOTEL); // creating new HashMap HashMap<String, Object> map=new HashMap<String, Object>(); // adding each child node to HashMap key => value map.put(TAG_TITLEHOTEL, TitleHotel);
TOURGONDAR CITY GUIDE MOBILE APPLICATION
78
map.put(TAG_DESCHOTEL, DescHotel); map.put(TAG_IMAGEHOTEL, R.drawable.blank); map.put("image_path",ImageHotel ); // adding HashList to ArrayList hotelList.add(map); } } catch (JSONException e) { // TODO Auto-generated catch block e.printStackTrace(); } returnnull; } //After completing background task Dismiss the progress dialog protectedvoid onPostExecute(String file_url){ // dismiss the dialog after getting all products pDialog.dismiss(); // updating UI from Background Thread runOnUiThread(new Runnable() { publicvoid run() { /** * Updating parsed JSON data into ListView * */ SimpleAdapter adapter = newSimpleAdapter( Hotel_Eng.this, hotelList, R.layout.custom_list_hotel_eng, newString[] { TAG_TITLEHOTEL, TAG_DESCHOTEL,TAG_IMAGEHOTEL}, newint[] {R.id.titleHotel,R.id.descHotel,R.id.imageHotel }); // updating listview setListAdapter(adapter); //for image loop to get postion and path for(int i=0;i<adapter.getCount();i++) { HashMap<String , Object> hm=(HashMap<String, Object>)adapter.getItem(i); String imgUrl=(String) hm.get("image_path"); HashMap<String, Object>hmDownload=new HashMap<String, Object>(); hm.put("image_path", imgUrl); hm.put("position", i); // Starting ImageLoaderTask to download and populate image in the listview
TOURGONDAR CITY GUIDE MOBILE APPLICATION
79
new ImageLoader().execute(hm); Log.i("imageLoader", "imageLoader"); } } }); } } //AsyncTask to download and load an image in Listview privateclass ImageLoader extends AsyncTask<HashMap<String , Object>, Void, HashMap<String, Object>>{ @Override protected HashMap<String, Object> doInBackground(HashMap<String, Object>... hm) { InputStream iStream=null; String imgUrl=(String) hm[0].get("image_path"); int position=(Integer) hm[0].get("position"); URL url; try{ url=new URL(imgUrl); // Creating an http connection to communicate with url HttpURLConnection urlConnection=(HttpURLConnection) url.openConnection(); // Connecting to url urlConnection.connect(); // Reading data from url iStream=urlConnection.getInputStream(); // Getting Caching directory File cacheDirectory=getBaseContext().getCacheDir(); // Temporary file to store the downloaded image File tmpFile=newFile(cacheDirectory.getPath()+"/wpta_"+position+".jpg"); Log.d("wpta: ", cacheDirectory.getPath()); // The FileOutputStream to the temporary file FileOutputStream fOutStream=newFileOutputStream(tmpFile);
TOURGONDAR CITY GUIDE MOBILE APPLICATION
80
// Creating a bitmap from the downloadedinputstream Bitmap b=BitmapFactory.decodeStream(iStream); // Writing the bitmap to the temporary file as png file b.compress(Bitmap.CompressFormat.JPEG, 100, fOutStream); // Flush the FileOutputStream fOutStream.flush(); //Close the FileOutputStream fOutStream.close(); // Create a hashmap object to store image path and its position in the listview HashMap<String, Object> hmBitmap=new HashMap<String, Object>(); // Storing the path to the temporary image file hmBitmap.put("ImageHotel", tmpFile.getPath()); // Storing the position of the image in the listview hmBitmap.put("position", position); // Returning the HashMap object containing the image path and position return hmBitmap; }catch(Exception e) { e.printStackTrace(); } returnnull; } protectedvoid onPostExecute(HashMap<String, Object> result){ // Getting the path to the downloaded image String path=(String) result.get("ImageHotel"); // Getting the position of the downloaded image int position=(Integer) result.get("position"); // Getting adapter of the listview SimpleAdapter adapter = (SimpleAdapter )list.getAdapter(); // Getting the hashmap object at the specified position of the listview HashMap<String, Object> hm= (HashMap<String, Object>) adapter.getItem(position); // Overwriting the existing path in the adapter hm.put("ImageHotel",path); // Noticinglistview about the dataset changes adapter.notifyDataSetChanged(); }
TOURGONDAR CITY GUIDE MOBILE APPLICATION
81
} }
//Xml file for Hotel Activity in English
<?xmlversion="1.0"encoding="utf-8"?> <LinearLayoutxmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical"> <LinearLayout android:layout_width="match_parent" android:layout_height="55dp" android:background="#138808" android:orientation="horizontal"> <EditText android:id="@+id/getHotel" android:layout_width="wrap_content" android:layout_height="45dp" android:layout_gravity="center" android:layout_marginLeft="20dp" android:inputType="text" android:background="#F8F8FF" android:ems="10" android:text="Search"> <requestFocus/> </EditText> <Button android:id="@+id/btnFilterHotelEng" android:layout_width="80dp" android:layout_height="55dp" android:layout_gravity="center" android:text="Filter" /> </LinearLayout> <ListView android:id="@android:id/list"
TOURGONDAR CITY GUIDE MOBILE APPLICATION
82
android:layout_width="match_parent" android:layout_height="match_parent" > </ListView> </LinearLayout>
//Xml file for Customized list for Hotel list in English
<?xmlversion="1.0"encoding="utf-8"?> <LinearLayoutxmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="horizontal"> <ImageView android:id="@+id/imageHotel" android:layout_width="70dp" android:layout_height="60dp" android:scaleType="fitXY" /> <LinearLayout android:orientation="vertical" android:layout_width="match_parent" android:layout_height="50dp" > <TextView android:id="@+id/titleHotel" android:layout_width="match_parent" android:layout_height="30dp" android:textSize="20dp" android:textStyle="bold" android:layout_marginLeft="10dp"/> <TextView android:id="@+id/descHotel" android:layout_width="match_parent" android:layout_height="20dp" android:textSize="10dp" android:layout_marginLeft="10dp"/> </LinearLayout> </LinearLayout>
TOURGONDAR CITY GUIDE MOBILE APPLICATION
83
//Source code for Hotel Activity in Amharic java code
package com.example.gondarcityguide;
import java.io.File;
import java.io.FileOutputStream;
import java.io.InputStream;
import java.net.HttpURLConnection;
import java.net.URL;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import org.apache.http.NameValuePair;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import android.app.AlertDialog;
import android.app.ListActivity;
import android.app.ProgressDialog;
import android.content.DialogInterface;
import android.content.Intent;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.os.AsyncTask;
TOURGONDAR CITY GUIDE MOBILE APPLICATION
84
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ListView;
import android.widget.SimpleAdapter;
public class Hotel_Amh extends ListActivity implements OnItemClickListener {
ListView list;
EditText getHotelAmh;
Button btnFilterHotelAmh;
// Progress Dialog
private ProgressDialog pDialog;
// Creating JSON Parser object
JSONParser jParser = new JSONParser();
List<HashMap<String,Object>> hotelList;
// url to get all hotels list
TOURGONDAR CITY GUIDE MOBILE APPLICATION
85
private static String urlHotel="http://10.139.179.119/test/hotel_amh.php";
// JSON Node names
private static final String TAG_HOTELS = "hotels";
private static final String TAG_TITLEHOTEL = "TitleHotle";
private static final String TAG_DESCHOTEL = "DescHotel";
private static final String TAG_IMAGEHOTEL="ImageHotel";
// hotels JSONArray
JSONArray hotels=null;
@Override
protected void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
setContentView(R.layout.hotel_amh);
// Hashmap for ListView
hotelList=new ArrayList<HashMap<String,Object>>();
// Loading hotels in Background Thread
new LoadHotels().execute();
//institiated listview
list=getListView();
TOURGONDAR CITY GUIDE MOBILE APPLICATION
86
list.setOnItemClickListener(this);
getHotelAmh=(EditText) findViewById(R.id.getHotelAmh);
btnFilterHotelAmh=(Button) findViewById(R.id.btnFilterHotelAmh);
btnFilterHotelAmh.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View arg0) {
String textForSearch=getHotelAmh.getText().toString();
if(textForSearch.equalsIgnoreCase("AG Hotel Gondar")||
textForSearch.equalsIgnoreCase("AG Hotel")||
textForSearch.equalsIgnoreCase("AG")||
textForSearch.equalsIgnoreCase("ኤጂሆቴልጎንደር")||
textForSearch.equalsIgnoreCase("ኤጂሆቴል")||
textForSearch.equalsIgnoreCase("ኤጂ ")){
//if it is match the string launching the
activity
startActivity(new
Intent(getApplicationContext(), AgHotel_Amh.class));
}
else if(textForSearch.equalsIgnoreCase("L-
Shape Hotel")||
TOURGONDAR CITY GUIDE MOBILE APPLICATION
87
textForSearch.equalsIgnoreCase("L Shape Hotel")||
textForSearch.equalsIgnoreCase("LShape Hotel")||
textForSearch.equalsIgnoreCase("L-Shape")||
textForSearch.equalsIgnoreCase("L Shape")||
textForSearch.equalsIgnoreCase("LShape")||
textForSearch.equalsIgnoreCase("ኤል-ሼፕሆቴል")||
textForSearch.equalsIgnoreCase("ኤልሼፕሆቴል")||
textForSearch.equalsIgnoreCase("ኤልሼፕሆቴል")||
textForSearch.equalsIgnoreCase("ኤል-ሼፕ ")||
textForSearch.equalsIgnoreCase("ኤልሼፕ ")||
textForSearch.equalsIgnoreCase("ኤልሼፕ ")){
//if it is match the string launching the
activity
startActivity(new
Intent(getApplicationContext(), LShapeHotel_Amh.class));
TOURGONDAR CITY GUIDE MOBILE APPLICATION
88
}
else if(textForSearch.equalsIgnoreCase("Florida
International Hotel")||
textForSearch.equalsIgnoreCase("Florida International")||
textForSearch.equalsIgnoreCase("Florida Hotel")||
textForSearch.equalsIgnoreCase("Florida")||
textForSearch.equalsIgnoreCase("ፍሎሪዳኢተርናሽናልሆቴል")||
textForSearch.equalsIgnoreCase("ፍሎሪዳኢተርናሽናል ")||
textForSearch.equalsIgnoreCase("ፍሎሪዳሆቴል")||
textForSearch.equalsIgnoreCase("ፍሎሪዳ ")){
//if it is match the string launching the
activity
startActivity(new
Intent(getApplicationContext(), FloridaHotel_Amh.class));
}
else if(textForSearch.equalsIgnoreCase("Taye
Belay Hotel")||
TOURGONDAR CITY GUIDE MOBILE APPLICATION
89
textForSearch.equalsIgnoreCase("Taye Belay")||
textForSearch.equalsIgnoreCase("ታዬበላይሆቴል")||
textForSearch.equalsIgnoreCase("ታዬበላይ ")){
//if it is match the string launching the
activity
startActivity(new
Intent(getApplicationContext(), TayeBelayHotel_Amh.class));
}
else if(textForSearch.equalsIgnoreCase("Goha
Hotel")||
textForSearch.equalsIgnoreCase("Goha")||
textForSearch.equalsIgnoreCase("ጎሃሆቴል")||
textForSearch.equalsIgnoreCase("ጎሃ ")){
//if it is match the string launching the
activity
startActivity(new
Intent(getApplicationContext(), GohaHotel_Amh.class));
}
TOURGONDAR CITY GUIDE MOBILE APPLICATION
90
else if(textForSearch.equalsIgnoreCase("Quara
Hotel")||
textForSearch.equalsIgnoreCase("Quara")||
textForSearch.equalsIgnoreCase("ቋራሆቴል")||
textForSearch.equalsIgnoreCase("ቋራ ")){
//if it is match the string launching the
activity
startActivity(new
Intent(getApplicationContext(), QuaraHotel_Amh.class));
}
else if(textForSearch.equalsIgnoreCase("New
Fesica Hotel")||
textForSearch.equalsIgnoreCase("New
Fesica")||
textForSearch.equalsIgnoreCase("ኒውፋሲካሆቴል")||
textForSearch.equalsIgnoreCase("ኒውፋሲካ ")){
//if it is match the string launching the
activity
startActivity(new
Intent(getApplicationContext(), NewFesicaHotel_Amh.class));
TOURGONDAR CITY GUIDE MOBILE APPLICATION
91
}
else if(textForSearch.equalsIgnoreCase("Yalew
Ayker Hotel")||
textForSearch.equalsIgnoreCase("Yalew
Ayker")||
textForSearch.equalsIgnoreCase("ያለውአይቀርሆቴል")||
textForSearch.equalsIgnoreCase("ያለውአይቀር ")){
//if it is match the string launching the
activity
startActivity(new
Intent(getApplicationContext(), YalewAykerHotel_Amh.class));
}
else
if(textForSearch.equalsIgnoreCase("Lammergeyer Hotel")||
textForSearch.equalsIgnoreCase("Lamergeyer Hotel")||
textForSearch.equalsIgnoreCase("Lammergeyer")||
textForSearch.equalsIgnoreCase("Lamergeyer")||
textForSearch.equalsIgnoreCase("ላመርገየርሆቴል")||
TOURGONDAR CITY GUIDE MOBILE APPLICATION
92
textForSearch.equalsIgnoreCase("ላመርገየር")){
//if it is match the string launching the
activity
startActivity(new
Intent(getApplicationContext(), LammergeyerHotel_Amh.class));
}
else if(textForSearch.equalsIgnoreCase("Fogera
Hotel")||
textForSearch.equalsIgnoreCase("Fogera")||
textForSearch.equalsIgnoreCase("ፎገራሆቴል")||
textForSearch.equalsIgnoreCase("ፎገራ ")){
//if it is match the string launching the
activity
startActivity(new
Intent(getApplicationContext(), FogeraHotel_Amh.class));
}
else if(textForSearch.equalsIgnoreCase("Circle
Hotel")||
textForSearch.equalsIgnoreCase("Circle")||
TOURGONDAR CITY GUIDE MOBILE APPLICATION
93
textForSearch.equalsIgnoreCase("ሰርክልሆቴል")||
textForSearch.equalsIgnoreCase("ሰርክል ")){
//if it is match the string launching the
activity
startActivity(new
Intent(getApplicationContext(), CircleHotel_Amh.class));
}
else if(textForSearch.equalsIgnoreCase("Queens
Hotel")||
textForSearch.equalsIgnoreCase("Queen Hotel")||
textForSearch.equalsIgnoreCase("Queens")||
textForSearch.equalsIgnoreCase("Queen")||
textForSearch.equalsIgnoreCase("ኪዊስሆቴል")||
textForSearch.equalsIgnoreCase("ኪዊስ")){
//if it is match the string launching the
activity
TOURGONDAR CITY GUIDE MOBILE APPLICATION
94
startActivity(new
Intent(getApplicationContext(), QueensHotel_Amh.class));
}
else if(textForSearch.equalsIgnoreCase("Gondar
Landmark Hotel")||
textForSearch.equalsIgnoreCase("Landmark Hotel")||
textForSearch.equalsIgnoreCase("Gondar Landmark")||
textForSearch.equalsIgnoreCase("Landmark")||
textForSearch.equalsIgnoreCase("ጎንደርላድማርክሆቴል")||
textForSearch.equalsIgnoreCase("ላድማርክሆቴል")||
textForSearch.equalsIgnoreCase("ጎንደርላድማርክ ")||
textForSearch.equalsIgnoreCase("ላድማርክ ")){
//if it is match the string launching the
activity
startActivity(new
Intent(getApplicationContext(), LandmarkHotel_Amh.class));
}
TOURGONDAR CITY GUIDE MOBILE APPLICATION
95
else
if(textForSearch.equalsIgnoreCase("Jantekel Hotel")||
textForSearch.equalsIgnoreCase("Jantekel")||
textForSearch.equalsIgnoreCase("ጃንተክልሆቴል")||
textForSearch.equalsIgnoreCase("ጃንተክል ")){
startActivity(new
Intent(getApplicationContext(), JantekelHotel_Amh.class));
}
else{
AlertDialog.Builder builder=new
AlertDialog.Builder(Hotel_Amh.this);
builder.setMessage("ይቅርታ!
ከዚህጋርተመሳሳይየሆነየለም፡፡እባኮንፊደሎትንያረጋግጡ፡፡");
builder.setCancelable(false);
builder.setPositiveButton("እሺ",
new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
Hotel_Amh.this.finish();
TOURGONDAR CITY GUIDE MOBILE APPLICATION
96
}
});
AlertDialog
alert=builder.create();
alert.show();
}
}
});
}
@Override
public void onItemClick(AdapterView<?> parent, View view, int position,
long id) {
switch(position)
{
case 0:
TOURGONDAR CITY GUIDE MOBILE APPLICATION
97
startActivity(new Intent(getApplicationContext(),
AgHotel_Amh.class));
break;
case 1:
startActivity(new Intent(getApplicationContext(),
LShapeHotel_Amh.class));
break;
case 2:
startActivity(new Intent(getApplicationContext(),
FloridaHotel_Amh.class));
break;
case 3:
startActivity(new Intent(getApplicationContext(),
TayeBelayHotel_Amh.class));
break;
case 4:
startActivity(new Intent(getApplicationContext(),
GohaHotel_Amh.class));
break;
case 5:
startActivity(new Intent(getApplicationContext(),
QuaraHotel_Amh.class));
break;
case 6:
startActivity(new Intent(getApplicationContext(),
NewFesicaHotel_Amh.class));
TOURGONDAR CITY GUIDE MOBILE APPLICATION
98
break;
case 7:
startActivity(new Intent(getApplicationContext(),
YalewAykerHotel_Amh.class));
break;
case 8:
startActivity(new Intent(getApplicationContext(),
LammergeyerHotel_Amh.class));
break;
case 9:
startActivity(new Intent(getApplicationContext(),
FogeraHotel_Amh.class));
break;
case 10:
startActivity(new Intent(getApplicationContext(),
CircleHotel_Amh.class));
break;
case 11:
startActivity(new Intent(getApplicationContext(),
QueensHotel_Amh.class));
break;
case 12:
startActivity(new Intent(getApplicationContext(),
LandmarkHotel_Amh.class));
break;
case 13:
TOURGONDAR CITY GUIDE MOBILE APPLICATION
99
startActivity(new Intent(getApplicationContext(),
JantekelHotel_Amh.class));
break;
default:
break;
}
}
//Background Async Task to Load all hotels by making HTTP Request
class LoadHotels extends AsyncTask<String, String, String>{
//Before starting background thread Show Progress Dialog
protected void onPreExecute()
{
super.onPreExecute();
pDialog=new ProgressDialog(Hotel_Amh.this);
pDialog.setMessage("ሆቴል ...እባኮንትንሽይጠብቁ");
pDialog.setIndeterminate(false);
pDialog.setCancelable(false);
pDialog.show();
}
//getting All Hotels from url
TOURGONDAR CITY GUIDE MOBILE APPLICATION
100
@Override
protected String doInBackground(String... arg0) {
// Building Parameters
List<NameValuePair> params = new ArrayList<NameValuePair>();
// getting JSON string from URL
JSONObject json = jParser.makeHttpRequest(urlHotel, "GET", params);
// Check your log cat for JSON reponse
Log.d("All Hotels: ", json.toString());
//get json Array
try {
hotels=json.getJSONArray(TAG_HOTELS);
// looping through All hotels
for (int i = 0; i < hotels.length(); i++) {
JSONObject c = hotels.getJSONObject(i);
// Storing each json item in variable
String TitleHotel = c.getString(TAG_TITLEHOTEL);
String DescHotel = c.getString(TAG_DESCHOTEL);
TOURGONDAR CITY GUIDE MOBILE APPLICATION
101
String ImageHotel=c.getString(TAG_IMAGEHOTEL);
// creating new HashMap
HashMap<String, Object> map=new HashMap<String, Object>();
// adding each child node to HashMap key => value
map.put(TAG_TITLEHOTEL, TitleHotel);
map.put(TAG_DESCHOTEL, DescHotel);
map.put(TAG_IMAGEHOTEL, R.drawable.blank);
map.put("image_path",ImageHotel );
// adding HashList to ArrayList
hotelList.add(map);
}
} catch (JSONException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return null;
}
//After completing background task Dismiss the progress dialog
protected void onPostExecute(String file_url){
TOURGONDAR CITY GUIDE MOBILE APPLICATION
102
// dismiss the dialog after getting all products
pDialog.dismiss();
// updating UI from Background Thread
runOnUiThread(new Runnable() {
public void run() {
/**
* Updating parsed JSON data into ListView
* */
SimpleAdapter adapter = new SimpleAdapter(
Hotel_Amh.this, hotelList,
R.layout.custom_list_hotel_amh, new String[] {
TAG_TITLEHOTEL,
TAG_DESCHOTEL,TAG_IMAGEHOTEL},
new int[] {R.id.titleHotel,R.id.descHotel,R.id.imageHotel });
// updating listview
setListAdapter(adapter);
//for image loop to get postion and path
for(int i=0;i<adapter.getCount();i++)
{
TOURGONDAR CITY GUIDE MOBILE APPLICATION
103
HashMap<String , Object> hm=(HashMap<String,
Object>)adapter.getItem(i);
String imgUrl=(String) hm.get("image_path");
HashMap<String, Object> hmDownload=new HashMap<String, Object>();
hm.put("image_path", imgUrl);
hm.put("position", i);
// Starting ImageLoaderTask to download and populate image in the listview
new ImageLoader().execute(hm);
Log.i("imageLoader", "imageLoader");
}
}
});
}
}
//AsyncTask to download and load an image in Listview
private class ImageLoader extends AsyncTask<HashMap<String , Object>, Void,
HashMap<String, Object>>{
@Override
TOURGONDAR CITY GUIDE MOBILE APPLICATION
104
protected HashMap<String, Object> doInBackground(HashMap<String,
Object>... hm) {
InputStream iStream=null;
String imgUrl=(String) hm[0].get("image_path");
int position=(Integer) hm[0].get("position");
URL url;
try{
url=new URL(imgUrl);
// Creating an http connection to communicate with url
HttpURLConnection urlConnection=(HttpURLConnection)
url.openConnection();
// Connecting to url
urlConnection.connect();
// Reading data from url
iStream=urlConnection.getInputStream();
// Getting Caching directory
File cacheDirectory=getBaseContext().getCacheDir();
// Temporary file to store the downloaded image
File tmpFile=new
File(cacheDirectory.getPath()+"/wpta_"+position+".jpg");
Log.d("wpta: ", cacheDirectory.getPath());
// The FileOutputStream to the temporary file
FileOutputStream fOutStream=new FileOutputStream(tmpFile);
TOURGONDAR CITY GUIDE MOBILE APPLICATION
105
// Creating a bitmap from the downloaded inputstream
Bitmap b=BitmapFactory.decodeStream(iStream);
// Writing the bitmap to the temporary file as png file
b.compress(Bitmap.CompressFormat.JPEG, 100, fOutStream);
// Flush the FileOutputStream
fOutStream.flush();
//Close the FileOutputStream
fOutStream.close();
// Create a hashmap object to store image path and its position in the listview
HashMap<String, Object> hmBitmap=new HashMap<String, Object>();
// Storing the path to the temporary image file
hmBitmap.put("ImageHotel", tmpFile.getPath());
// Storing the position of the image in the listview
hmBitmap.put("position", position);
// Returning the HashMap object containing the image path and position
return hmBitmap;
}catch(Exception e)
{
e.printStackTrace();
}
return null;
}
TOURGONDAR CITY GUIDE MOBILE APPLICATION
106
protected void onPostExecute(HashMap<String, Object> result){
// Getting the path to the downloaded image
String path=(String) result.get("ImageHotel");
// Getting the position of the downloaded image
int position=(Integer) result.get("position");
// Getting adapter of the listview
SimpleAdapter adapter = (SimpleAdapter ) list.getAdapter();
// Getting the hashmap object at the specified position of the listview
HashMap<String, Object> hm= (HashMap<String, Object>)
adapter.getItem(position);
// Overwriting the existing path in the adapter
hm.put("ImageHotel",path);
// Noticing listview about the dataset changes
adapter.notifyDataSetChanged();
}}
}
//Xml file for Hotel Activity in Amharic
<?xmlversion="1.0"encoding="utf-8"?> <LinearLayoutxmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical"> <LinearLayout android:layout_width="match_parent"
TOURGONDAR CITY GUIDE MOBILE APPLICATION
107
android:layout_height="55dp" android:background="#138808" android:orientation="horizontal"> <EditText android:id="@+id/getHotelAmh" android:layout_width="wrap_content" android:layout_height="45dp" android:layout_gravity="center" android:layout_marginLeft="20dp" android:inputType="text" android:background="#F8F8FF" android:ems="10" android:text="መፈለጊያ"> <requestFocus/> </EditText> <Button android:id="@+id/btnFilterHotelAmh" android:layout_width="80dp" android:layout_height="55dp" android:layout_gravity="center" android:text="ፈልግ" /> </LinearLayout> <ListView android:id="@android:id/list" android:layout_width="match_parent" android:layout_height="match_parent" > </ListView> </LinearLayout> //Xml file for Customized list for Hotel list in English
<?xmlversion="1.0"encoding="utf-8"?> <LinearLayoutxmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="horizontal">
TOURGONDAR CITY GUIDE MOBILE APPLICATION
108
<ImageView android:id="@+id/imageHotel" android:layout_width="70dp" android:layout_height="60dp" android:scaleType="fitXY" /> <LinearLayout android:orientation="vertical" android:layout_width="match_parent" android:layout_height="50dp" > <TextView android:id="@+id/titleHotel" android:layout_width="match_parent" android:layout_height="30dp" android:textSize="20dp" android:textStyle="bold" android:layout_marginLeft="10dp"/> <TextView android:id="@+id/descHotel" android:layout_width="match_parent" android:layout_height="20dp" android:textSize="10dp" android:layout_marginLeft="10dp"/> </LinearLayout> </LinearLayout>
TOURGONDAR CITY GUIDE MOBILE APPLICATION
109
4.3. Screen Images User Interface diagram
Home Screen in English
Figure 24 Home screen in English
TOURGONDAR CITY GUIDE MOBILE APPLICATION
110
Home Screen in Amharic
Figure 25 Home screen in Amharic
TOURGONDAR CITY GUIDE MOBILE APPLICATION
111
Activity for Attractions in English
Figure 26 Activity for attraction in English
TOURGONDAR CITY GUIDE MOBILE APPLICATION
112
Activity for Attractions in Amharic
Figure 27 Activity for attraction in Amharic
TOURGONDAR CITY GUIDE MOBILE APPLICATION
113
Activity for detail Attraction place
Figure 28 Activity for detail Attraction places
TOURGONDAR CITY GUIDE MOBILE APPLICATION
114
CHAPTER 5
5. Conclusion and Recommendation
5.1. Conclusion
In this project, we presented the design and implementation of a mobile application called
Gondar City Guide, with which mobile users can get valuable information on different
Attraction places, Restaurants, Hotels, Healthy center, Banks, Police stations and Tour and
Travel agent in Gondar town with more ease at anywhere and anytime. Users can get basic
information about service providers in text and pictures. In particular, this application can
provide users location-based information of a Gondar town which can be browsed or queried
through a city map. Visitor can get current event information automatically when events are
occurred in Gondar town.
5.2. Recommendation
The team that developed this project recommends the following point for the best
implementation and installment of this project.
The user should be familiar with smart phone.
The government should facilitate internet access all over the country and support
peoples to learn and use it.
The application data should be update regularly by the an authorize person.
TOURGONDAR CITY GUIDE MOBILE APPLICATION
115
5.3. Bibliography
References
[1] Shea’s (2012). The People History Where People Memories and History
Join.[Online] Available: http://www.thepeoplehistory.com/mobilephones.html/ [February
30, 2012]
[2] Ian Sommerrvil. Software Engineering. Prentice Hall Inc, New York, 2004.
[3] Margare Rouse(Ed). (2008).Unified modeling language (fourth edition). Available:
http://serachsoftwarequality.com/ [Sep 30, 2013]
[4] John Waltzing, RobertB.jackson, sefenD. System Analysis and Design in changing
world. Prentice Hall Inc, Paris, 2001
TOURGONDAR CITY GUIDE MOBILE APPLICATION
116
Appendix A Glossary
Activity:An Activity is an application component that provides a screen with which users
can interact in order to do something, such as dial the phone, take a photo, send an email, or
view a map.
User interface:the means by which the user and a computer system interact, in particular the
use of input devices and software.
Password:is a secret word or phrase that must be used to gain admission to something.
Unified Modeling Language (UML):Unified Modeling language (UML) is a standardized
modeling language enabling developers to specify, visualize, construct and document
artifacts of a software system.
Use case diagram:Use case diagrams are a set of use cases, actors and their relationships.
They represent the use case view of a system.A use case represents a particular functionality
of a system.
Activity diagram:Activity diagram describes the flow of control in a system. So it consists
of activities and links. The flow can be sequential, concurrent or branched.
Class diagram:Class diagram represents the object orientation of a system. So it is generally
used for development purpose. This is the most widely used diagram at the time of system
construction.
Sequence diagram:A sequence diagram is an interaction diagram. From the name it is clear
that the diagram deals with some sequences, which are the sequence of messages flowing
from one object to another.
Data dictionary:A data dictionary is a file or a set of files that contains a database's
metadata. The data dictionary contains records about other objects in the database, such as
data ownership, data relationships to other objects, and other data.