Documente Academic
Documente Profesional
Documente Cultură
BLOOD BANK
(Complete Android Industrial Training)
External coordinator
DECLARATION
I hereby declare that the project work entitled Blood Bank System is
an authentic record of my own work carried out at OneInfoNet
Technologies, as requirements of Industry Internship project for the
award of degree of MCA 6th SEM, Lovely Professional University,
Phagwara, Punjab, under the guidance of Miss Navpreet Kaur
(Internal Supervisor) and Mr Pankaj Kumar (External Supervisor),Mr.
Puneet Mangla(Faculty Co-ordinator).
The matter reported in this project has not been submitted earlier
anywhere else for the award of any other award of Diploma/Degree.
Team Members
University Registration
Preeti
11003981
Veena Devi
11308128
Manpreet Singh
11311538
Hardeep Singh
11311222
Number Signature
CERTIFICATE
This is to certify that the Major Project report entitled Blood Bank System
submitted by Preeti (11003981), Veena Devi (11308128), Manpreet
Singh(11311538), Hardeep Singh(11311222) has been carried out under my
guidance & supervision in OneInfoNet Technologies. The project report is
approved for submission towards partial fulfillment of the requirement for the
award of degree Master of Computer Applications from Lovely Professional
University, Jalandhar, Punjab.
External supervisor
Internal Supervisor
Mr Sahil Sharma
Software Developer
Asst. Professor
Acknowledgement
Preeti
Veena Devi
Manpreet Singh
Hardeep Singh
Table of Content
1. Company Profile......................................................................................... 7
Name of the Organization............................................................... 7
Products of OneInfoNet................................................................. 8
2. Profile of Problem............................................................................................ 9
Existing System................................................................................9
Disadvantage................................................................ 9
Introduction to Blood Bank........................................................ 9
Advantage.....................................................................9
3. Project Analysis..............................................................................................10
Product Definition..........................................................................10
Feasibility Analysis........................................................................10
Technical Feasibility Study........................................10
Economic Feasibility Study........................................10
Legal Feasibility Study...............................................10
Operational Feasibiliy................................................11
Project Plan.....................................................................................17
4. Software Requirement Analysis & Tools.......................................................18
Introduction....................................................................................18
General Description.....................................................................18
Android......................................................................18
Android SDK...........................................................20
JAVA........................................................................21
XML.......................................................................22
SQLite......................................................................23
E draw Max..............................................................24
SQLite browser........................................................25
SPECIFIC REQUIREMENT...................................25
Hardware..............................................25
Software...............................................25
5. Design.............................................................................................................26
Data Flow Diagram...........................................................................26
0 Level DFD..................................................................27
1 Level DFD..................................................................28
DFD for Donor Module............................28
DFD for Blood Seeker Module.................29
5
E-R Diagram.......................................................................................32
Table Structure..................................................................................33
6. Testing...........................................................................................................34
Functional Testing.......................................................................34
Structural Testing........................................................................35
Unit Testing.................................................................................35
Integration Testing.......................................................................35
System Testing............................................................................36
Acceptance Testing.....................................................................36
1.
COMPANY PROFILE
Services:
Consulting services
Developing services
Outsourcing services
Industrial service solutions
2. PROFILE OF PROBLEM
Existing System
Maintenance and updating of blood bank records, currently, are done manually which, at
times, results in loss of critically important records or delayed information updates. Listed
below are some of the problems that are faced by the blood bank officials while using the
present system.
The main purpose of this system is to handle and maintain the management of blood bank.
The primary target is only a blood transfusion unit. This system is combination of three sub
modules; there are blood module, patient module and donor module.
Disadvantage
Records are maintained in books or files and are subject to loss and or damage.
Difficult to calculate amount of blood in stock.
Difficulties in retrieving data (for any specific reason).
Records are very liable to be misfiled or soiled.
Securities of records are minimum.
Difficult of making reports.
Difficulty in identifying blood expiry date.
3. PROJECT ANALYSIS
PRODUCT DEFINITION
Blood Bank System is an android App which helps a needy and save a precious life of the
patients. It provides user friendly interface. The app also facilitates users to easily register and
donate the blood. In this project we use Java and for designing purpose XML language and
SQL-Server as database. So its a fully functional application having nice user interface and
best functionality.
FEASIBILITY ANALYSIS
The feasibility study is an evaluation and analysis of the potential of the proposed project
which is based on registration of the Donor and research the Donor. Various issues of
feasibility analysis considered in project are as follows:-
10
Operational Feasibility
Operational feasibility criteria measure the urgency of the problem (survey and study phases)
or the acceptability of a solution (selection, acquisition and design phases).
This application is operational feasible. User can change anything according to his time to
time requirements. It is easy to understand and any user who is not related to any technical
field can easily use this application. These all things make this application feasible in all
aspects.
Sr. No
Module
Description
Sign Up
Search
Facts
Benefits
Feedback
Rate us
11
Risk Assessments
Features
Description
Search
Feedback
Project Planning defines the project activities and end products that will be performed and
described how the activities will be accomplished. The purpose of project planning is to
define each major task, estimate the time and resources required, and provide a framework
for management review and control. The project planning activities and goals include
defining:
i.
The specific work to be performed and goals that define and bind the project.
ii.
iii.
iv.
The planning process includes steps to estimate the size of the project, estimate the resources
required to complete the project, produce a schedule, identify and access risks, and negotiate
commitments.
12
Clear project goals are very crucial because the success of project will be determined by how
closely one meets them. A clear project goal is both specific and measurable.
A project's objectives may include:
i. A list of project deliverables.
ii. Specific due dates, both for the ultimate completion of the project and for intermediate
milestones.
iii. Specific quality criteria that the deliverables must meet.
iv. Cost limits that the project must not exceed.
During the planning stage of a project, many things arises in one's mind like key resources
required to start work or time required to complete a process and other such issues. Consider
these project areas when you identify your underlying assumptions:
i.
Handoffs from other projects or departments: If your project depends on the work
of others, do they understand your dependency and agree to the handoff dates?
ii.
Task durations: If the task estimates are based on solid information or guesses?
iii.
iv.
Available time: If you're working toward a known deadline, can we realistically
complete all tasks with an acceptable level of quality?
Constraints on a project are factors that are likely to limit the project manager's options.
Typically, the three major constraints are:
i.
Schedule: such as a fixed end date or a deadline date for a major milestone.
ii.
iii.
A change in one of these constraints usually affects the other two and can affect overall
quality. For example, decreasing project duration (schedule) may increase the number of
13
workers you'll need (resources) and reduce the number of features that can be included in the
product (scope).
After the finalization of goals of the project one can define the actual product or service that
meets those goals. This product or service is called a deliverable. Where appropriate, one can
record information about the deliverables in the project.
A deliverable is tangible as well as verifiable. To be verifiable, the deliverable must meet
predetermined standards for its completion, such as design specifications for a product (like a
new car) or a checklist of steps that is completed as part of a service.
Organize your project tasks around the deliverables: A project can have one or many
deliverables. You can organize your project's tasks around the deliverables in several ways:
i.
Assign each deliverable to a separate phase of the project, and use a milestone
that represents the completion of both the deliverable and the phase simultaneously.
ii.
Group similar deliverables or deliverables with the same stakeholders in a phase.
This method allows you to schedule a team to work on a project until the deliverable is
handed off. Then the team can move on to other projects.
The task list is the heart of a projectan incomplete or badly planned task list can seriously
hamper your project's progress. Organizing tasks into milestones and phases gives structure
to the project and makes it easier for you to evaluate progress.
In its core, a project is a set of tasks. Each task represents a piece of work that must be done
to complete the project. A properly defined task is one that has a clear beginning and end, so
that the project manager can easily determine when the task is complete.
Keep the following in mind when you make tasks:
i. For practical purposes, tasks should be at least one day long. In long-term projects, tasks
are likely to have longer durations. In short-term projects, they tend to have shorter durations.
ii. Generally, it's a good idea to enter tasks in the order in which you expect work to begin on
them.
14
Create a milestone: Milestones allows us to create reference points that mark major events
in a project. Milestones are used to monitor the project's progress.
Depending on how you schedule the tasks, Project can predict finish dates for the tasks and
the project as you enter information about how the project is progressing. You can use this
information to determine whether your project schedule is at risk.
There are two key ways to sequence tasks:
i.
Use a dependency: to indicate that work on a task cannot begin or end until work
on another task begins or ends. For example, you use a dependency if painting can't start until
preparation work is finished.
ii.
Use a constraint: to indicate that work on a task must begin or end in relation to a
specific date. For example, you use a constraint if a task must end by June 30, because the
subject matter expert will be unavailable after that time.
iii.
Sequence your project task: At this point, you should have entered some tasks
that must be completed in order to complete your project. Each task should be associated with
a duration, which indicates how long the task will take to complete.
iv.
Link tasks according to their dependencies on one another. Specifying the
sequence for your tasks includes showing which tasks overlap or have a delay between
them.
v.
Create a milestone to represent an external dependency. When one want to
track an event but he/she can't link to it because the event doesn't appear in any project,
he/she can create a milestone to represent the event.
vi.
Create a deadline for a task. To be notified when a task is finished after a
particular date, you can create a deadline.
vii.
Tie a task or phase to a specific date. When you absolutely must start or finish a
task on a particular date, tie a task or phase to a specific date. That date can represent an
event.
15
After identifying the project scope, including setting up the task list and estimating the task
durations, one can use this information to make preliminary estimates, identify requirements,
and start staffing and procurement processes to acquire the required resources.
i.
After the establishment of the scope and objectives and set up of the task list in your project
plan, one is ready to plan resources and need to follow some steps:
a. Review the project scope and task list.
b. Obtain historical resource and duration information.
c. Consider how the resource numbers affect durations.
d. Review and refine the duration estimates.
e. Identify the resource types and quantities needed.
ii.
Change duration
Use the collected information about this project and similar projects to refine the task
duration estimates.
ii.
At this point, you are ready to list the resource types and quantities. You can enter and
compile this resource information in Project and submit it as part of your resource proposal
Creating an efficient project design likewise involves risk analysis. Risks factored in/analysis.
Know what the prospective hazard and losses of the project can be and how to crush them.
16
PROJECT PLAN
Project planning is performed basically in the large organization where it requires effective
management to control and to find the desired result. Project planning for an organization has
following steps:
Acquiring and organizing the tools and resources for the project.
Preparation of well-defined schedule for events of the project.
Proper evaluation of progress of project development.
Establishing various standards for the project by which we can find the
standard output.
We had the time from January 2015 to April 2015 for the project preparation thus within this
duration we had to estimate everything to prepare this project. According to the first step we
acquired the resources and organize them in well-defined manner so that there we should not
face any problem. The second thing is distributing the time stamp into small time unit
according to the module of the project. This is the term as schedule the task according to the
event happened in the project. We distributed the time into different module of the whole part
of the project development.
Evaluating the progress of project development is to measure the
functionality of the project by comparing with the requirement criteria. It is told that we
cannot do anything if we have not properly measure the task which you are going to do. This
is a project which has everything in it so the proper plan is much necessary. Initially, the
project must establish the objectives of each phase of development. Each phase must be of a
controllable size, and every task within the project must be performed with responsibility. We
first established the objectives of each phase and at last we guessed that the objectives that
have been established are met in the proper time.
17
GENERAL DESCRIPTION
Android
Android is a modern, open source operating system and SDK for mobile devices developed
by Google. With it you can create powerful mobile applications. This becomes even more
attractive when your applications can access Web services, which means you; need to speak
the language of the Web: XML. In this article, you will see different options for working with
XML on Android and how to use them to build your own Android applications.
-The Linux kernel 2.6-which includes useful drivers that allow for example Wi-Fi or
Bluetooth.
-The library written in C and C + + that provide higher level functionality such as an HTML
engine, or a database (SQLite).
-A runtime environment for applications based on a virtual machine, made for inefficient
machines such as telephones. The aim is to translate JAVA in machine language understood
by Android.
-A JAVA framework that allows applications running on the virtual machine to organize and
cooperate.
Applications
Android includes most of the time many Google applications like Gmail, YouTube or Maps.
These applications are delivered with the machine most of the time, except in certain cases,
such as some phones running android on which the provider has replaced Google applications
by its own applications.
Widgets
18
With android, it is possible to use widgets which are small tools that can most often get
information. These widgets are directly visible on the main window.
Android Market
This is an online software store to buy applications. Developers who created applications can
add them into the store, and these applications can be downloaded by users, they can be both
free and paid.
Multitasking
Android allows multitasking in the sense that multiple applications can run simultaneously.
With Task Manager it is possible view all running tasks and to switch from one to another
easily.
Messaging
SMS and MMS are available forms of messaging, including threaded text messaging and
Android Cloud to Device Messaging (C2DM) and now enhanced version of C2DM, Android
Google Cloud Messaging (GCM) is also a part of Android Push Messaging service.
Google search through voice has been available since initial release. Voice actions for
calling, texting, navigation, etc. are supported on Android 2.2 onwards. As of Android 4.1,
Google has expanded Vce Actions with ability to talk back and read answers from Google's
Knowledge Graph when queried with specific commands. The ability to control hardware has
not yet been implemented.
Connectivity
Bluetooth
Supports voice dialing and sending contacts between phones, sending files (OPP),
accessing the phone book (PBAP), A2DP and AVRCP. Keyboard, mouse and joystick (HID)
support is available in Android 3.1+, and in earlier versions through manufacturer
customizations and third-party applications.
Media support
Android supports the following audio/video/still media formats: WebM, H.263, H.264,
AAC, HE-AAC (in 3GP or MP4 container), MPEG-4 SP, AMR, AMR-WB (in 3GP
container), MP3, MIDI, Ogg Vorbis, FLAC, WAV, JPEG, PNG, GIF, BMP, WebP.
19
External storage
Most Android devices include microSD slot and can read microSD cards formatted with
FAT32, Ext3 or Ext4 file system. To allow use of high-capacity storage media such as USB
flash drives and USB HDDs, many Android tablets also include USB 'A' receptacle. Storage
formatted with FAT32 is handled by Linux Kernel VFAT driver, while 3rd party solutions
are required to handle other popular file systems such as NTFS, HFS Plus and exFAT.
Java support
While most Android applications are written in Java, there is no Java Virtual Machine in
the platform and Java byte code is not executed. Java classes are compiled into Dalvik
executables and run on Dalvik, a specialized virtual machine designed specifically for
Android and optimized for battery-powered mobile devices with limited memory and CPU.
J2ME support can be provided via third-party applications.
Storage
Activity:
An activity is a user interface that allows the user to interact with the screen, to perform
actions. For example, a text messaging application could have an activity that displays a list
of contacts to send messages. Once the contact is selected, activity could send information to
a second activity that could serve to send the message to the contact.
When an application is launched, what it displays is the result of an activity. At
the code level, for create an activity; you must create a class that extends the Activity class.
An activity has a required onCreate () method. It is the main method. To interact with the
program, through the activity, there must be something displayed, that is why the activity,
contains what is called views.
View:
20
A View is the basic building block for user interface components. A View occupies a
rectangular area on the screen. View is the base class for widgets, which are used to create
interactive UI components (buttons, text fields, etc.).There are different kinds of views, for
example a List-View is able to display only an interactive list of what you want to display,
while a Web-View allows you to display a web page. As said before, a view occupies a
rectangular area on the screen. To organize these rectangles on the screen, there is a text file
written in XML for every different screen.
Android SDK
The Android software development kit (SDK) includes a comprehensive set of development
tools. These include a debugger, libraries, a handset emulator based on QEMU,
documentation, sample code, and tutorials. Currently supported development platforms
include computers running Linux (any modern desktop Linux distribution), Mac OS X 10.5.8
or later, and Windows XP or later. For the moment one can also develop Android software on
Android itself by using the AIDE - Android IDE - Java, C++ app and the Java editor app. The
officially supported integrated development environment (IDE) is Eclipse using the Android
Development Tools (ADT) Plugin, though IntelliJ IDEA IDE (all editions) fully supports
Android development out of the box, and NetBeans IDE also supports Android development
via a plugin. Additionally, developers may use any text editor to edit Java and XML files,
then use command line tools (Java Development Kit and Apache Ant are required) to create,
build and debug Android applications as well as control attached Android devices (e.g.,
triggering a reboot, installing software package(s) remotely).
Java
Java is a programming language and computing platform first released by Sun Microsystems
in 1995. There are lots of applications and websites that will not work unless you have Java
installed, and more are created every day. Java is fast, secure, and reliable. From laptops to
datacenters, game consoles to scientific supercomputers, cell phones to the Internet, Java is
everywhere.
If you want to get started with application development, Google provides a
Java API to get started and compiles your files into classes. Why did Android prefer Java for
its development platform? There are multiple reasons such as; Java is a commonly used
language and many programmers know it, it can run on a virtual machine (VM) so no need to
recompile for different phones, better security, many development tools available for Java,
and Java is a known industry language with most phones compatible with it.
Though Google provides the Java API, Android does not use JVM to execute class files.
Rather, it uses Dalvik Virtual Machine (DVM). The class files are compiled into Dalvik
Executable (DEX) format, and bundled as Android Package (APK) along with other
resources. With Java, if you are aware of object-oriented programming principles, creating
applications for android will be much simpler than IOS app development.
21
XML on Android
Intent:
An activity can of course start another one, even if it but to do this, it will need a special
object called Intent. Intent is basis description of an operation to be performed. It can launch
an Activity, send a broadcast Intent to any interested Broadcast Receiver components, and
communicate with a background Service. Intent performs binding between the codes in
different applications. It can be thought of as the link between activities. It is possible to add
some informations to an Intent, thanks to an object called bundle that you add to the intent
thanks to the method:
Intent.putExtras(Bundle objectbunble );
Android Manifest:
AndroidManifest.xml file is necessary for all android applications and must have this name in
its root directory. In the manifest you can find essential information about the application for
the Android system, informations that the system must have before it can run any of the
application's code. Here is what you can find in the Android manifest:
-The name of the Java package for the application. The package name serves as a unique
identifier for the application.
-The description of the components of the application: the activities, services, broadcast
receivers, and content providers that the application is composed of and under what
conditions they can be launched.
-The processes that will host application components.
-The permissions the application must have in order to access protected parts of the API and
interact with other applications.
-The permissions that others are required to have in order to interact with the applications
components.
22
-The minimum level of the Android API that the application requires.
-The list of the libraries that the application must be linked against.
SQLite is an in-process library that implements a self-contained, server less, zeroconfiguration, transactional SQL database engine. It is the one database, which is zeroconfigured, that means like other database you do not need to configure it in your system.
SQLite engine is not a standalone process like other databases; you can link it statically or
dynamically as per your requirement with your application. The SQLite accesses its storage
files directly.
Android provides several ways to store user and app data. SQLite is one way of storing user
data. SQLite is a very light weight database which comes with Android OS. In this tutorial
Ill be discussing how to write classes to handle all SQLite operations.
To use a database, we will create a class called Helper. This class will allow us to manipulate
the database from any other class that has instantiated the object Helper. This class has
elements and methods very specific. First specific objects: A SQLite database and a class
called openHelper that we will also create.
private SQLiteDatabase db;
OpenHelper openHelper = new OpenHelper(this.context);
this.db = openHelper.getWritableDatabase();
The class OpenHelper extends SQLiteOpenHelper. This class is used to actually create one
table or several tables in a database, and fill the table in the moment of its creation, all this in
the method onCreate (). this class allows to update the version of the table with the method
onUpgrade (). The method OnCreate will be called only once, after that the table is created
this method will no longer serve. For the class Helper, you can add all the methods used to
select, add, edit or delete entries in the table.
Web service is software functionality that can be invoked through the internet using common
protocols:
The ability to describe sets of data in JSON format is a natural extension to the JavaScript
language. Service Now supports a web service interface that operates on the JSON object as
the data input and output format.
The JSON web service is provided by a platform-level processor similar to the services for
SOAP, WSDL, CSV, Excel, and XML. Like those services, the JSON service is triggered by
the standalone JSON URL parameter.
E-draw Max enables students, teachers and business professionals to reliably create and
publish various kinds of diagrams to represent any ideas. E-draw Max is an all-in-one
diagram software that makes it simple to create professional-looking flowcharts,
organizational charts, network diagrams, business presentations, building plans, mind maps,
science illustration, fashion designs, UML diagrams, workflows, program structures, web
24
design diagrams, electrical engineering diagrams, directional maps, database diagrams and
more.
SQLite browser
DB Browser for SQLite is a light GUI editor for SQLite databases, built on top of Qt. The
main goal of the project is to allow non-technical users to create, modify and edit SQLite
databases using a set of wizards and a spread sheet-like interface.
Specific Requirements
Software Requirements
For developing the application the following are the Software Requirements:
Operating System: Windows 8
Language: SDK, Java
Tools: Android Studio
Technologies used: Java, XML.
Debugger: Android Dalvik Debug Monitor service For running the application the following
are the Software Requirements:
Operating System: Android 2.4.1 or higher versions
Network: Wi-Fi Internet or cellular Network 3
Tools: Different APIs and JSON data
Hardware Requirements
For developing the application the following are the Hardware Requirements:
Processor: Adreno or higher
RAM: 256 MB
Space on disk: minimum 512MB For running the application:
Device: Android version 2.4.1 and higher
Minimum space to execute: 8.0MB
25
5. DESIGN
Design is the first step into the development phase for any engineered product or system.
Design is a creative process. A good design is the key to effective system. The term "design"
is defined as "the process of applying various techniques and principles for the purpose of
defining a process or a system in sufficient detail to permit its physical realization".
Notation Used
Process
External Entity
Data Flow
A directed arc or an arrow is used as a data flow sign. A data flow sign represents the data
flow occurring between two processes, or between an external entity and a process, in the
direction of the data flow arrow. Data flow signs are usually annotated with the
corresponding data names.
Data Store
26
A data store represents a logical file. It is represented using two parallel lines. A logical file
can represent either a data store sign, which can represent either a data structure, or a physical
file on disk. Each data store is connected to a process by means of a data flow sign. The
direction of the data flow arrow shows whether data is being read from or written into a data
store. A arrow flowing in or out of a data store implicitly represents the entire data of the data
store and hence connecting to a data store need not be annotated with the name of the
corresponding data items.
0 Level DFD
A 0 level DFD defines the boundary between the system and outer environment. Such
diagrams represent the system at the center with no details of its interior structure. The main
objective of this diagram is to focus attention on external factors and events that are
important during development of a set of system requirements.
27
This shows the system divides into sub systems each of which deals with one or more of the
data flow or form an external agent and which together provide all of the functionality of the
system as a whole.
Registration Module:
28
Search Module:
Share Module:
29
Rate Us Module:
Feedback
30
31
E-R DIAGRAM
Weight
Blood Group
Blood Group
City
Name
Sex
Stored
Donor
Blood Seeker
Age
Age
Phone no.
City
Blood
Blood Group
Weight
City
Name
Sex
32
Phone no.
Table Structure:
33
6. TESTING
Software testing is an investigation conducted to provide information about the quality of
the product or service under test. Software testing can also provide an objective, independent
view of the software to allow the business to appreciate and understand the risks at the
software implementation. Software testing is any activity aimed at evaluating an attribute or
capability of a program or system and determining that it meets its required results. Software
Testing is the process of executing a program or system with the intent of finding errors.
Software testing can also be stated as the process of validating and Adding that a software
program/application/product. Testing Objectives:
The main objectives of testing is to uncoCase a host of errors, systematically and with
minimum effort ant time, starting formally, we can say,
Testing is the process of executing a program with the intent of finding errors.
A successful test is one that uncoCases an as yet of finding errors.
A good test case is one that has a high probability of finding errors, if it exits.
The tests are independent to detect possible errors.
The software more or less confirms to the quality and reliable standards.
Functional Testing
34
Structural Testing
Guarantee that all independent paths within a module have been exercised at least
once.
Exercise all logical decisions on their true and false sides.
Unit Testing
A Unit is the small testable piece of software that can be compiled for example functions,
procedures, classes, and interface. It is generally written by the programmer and is done after
coding Rigorous use of unit tests helps catch defects prior to customer testing and minimizes
the cost of correcting defects by identifying them when they are the cheapest to fix. In
computer programming, a unit test is a procedure used to validate that a particular module of
source code is working properly. The procedure is to write test cases for all functions and
methods so that whenever a change causes a regression, it can be quickly identified and fixed.
Unit testing focuses verification effort on the smallest unit of software design-the software
component or module. Using the component-level design description as a guide, important
control paths are tested to uncover errors within the boundary of the module. The relative
complexity of tests and the errors those tests uncover is limited by constrained scope
established for unit testing. The unit test focuses on the internal processing logic and data
structures within the boundaries of a component. This type of testing can be conducted in
parallel for multiple components.
Integration Testing
It is a systematic technique for constructing the software architecture while at the same time
conducting tests to uncover errors interfacing. The objective is to take unit tested components
and build a program structure that has been dictated by design. It is the testing phase, in
which whole project developed in J2EE will be tested with integrating it with the various
modules for the correct functionality. If working fine, then it will be integrated together with
the other modules for purpose of creation of the whole System.
35
System Testing
It is a series of different tests whose primary purpose is to fully exercise the computer-based
system. Although each test has a different purpose, all work to verify that system elements
have been properly integrated and performed allocated functions. It is the type of testing in
which all the modules are integrated together to form the whole system, then this whole
system is tested against various efficiency based tests, that also test the accuracy of the
system, working as a whole.
Acceptance Testing
This testing is performed with realistic data of the user to demonstrate that the software is
working satisfactory. Testing here focuses on the external behavior of the system, the internal
logic of the program is not emphasized. Unlike the other test phases, an objective of
acceptance testing is not to actively look for faults.
(a) Alpha Testing: Alpha testing is testing of an application when development is about to
complete. Minor design changes can still be made as a result of alpha testing. Alpha testing is
typically performed by a group that is independent of the design team, but still within the
company, e.g. in-house software test engineers, or software QA engineers.
(b) Beta Testing: Beta testing is testing of an application when development and testing are
essentially completed and final bugs and problems need to be found before the final release.
Beta testing is typically performed by end-users or others, not programmers, software
engineers or test engineers.
36
Invalid Classes
Valid Classes
Name
Empty name
Text containing
alphabet
only
Age
Empty age
Text containing
number
only
Weight
Empty Weight
Text containing
number
only
Contact
Test Case ID
Description
Expected
Output
TCReg01
Click
Submit
button
with
empty
fields
Message is PASS
Message
should be shown to fill
all the fields
displayed
fill all the
fields
TCReg02
Click
Submit
button with
empty name
field
Message
should
be
displayed to
fill the name
fields
Message is PASS
shown to fill
the
name
fields
Click
Submit
button with
name field
containing
numbers or
Message
should
be
displayed to
fill the name
fields
correctly
Message is PASS
shown to fill
the
name
fields
correctly
TCReg02
37
Actual
Result
Remarks
special
character
TCReg04
Click
Input
Submit
accepted
button with
name field
containing
only
characters
is Input
accepted
is PASS
TCReg05
Click
Input
Submit
accepted
button with
name field
containing
space
between
characters
is Input
accepted
is PASS
TCReg06
Click
Submit
button with
contact field
containing
characters
other than
numbers
Message
Message is PASS
should
be displayed to
displayed to fill
the
fill
the number
number
fields
fields
correctly
correctly
TCReg07
Click
Submit
button with
contact field
containing
less than 10
digit number
Message
Message is PASS
should
be displayed to
displayed to fill
the
fill
the number
number
fields
fields
correctly
correctly
TCReg08
Click
Submit
button with
contact field
containing
greater10
digit number
Message
Message is PASS
should
be displayed to
displayed to fill
the
fill
the number
number
fields
fields
correctly
correctly
TCReg09
Click
Submit
is PASS
button with
contact field
containing
10
digit
number
TCReg10
Click
Message
Message is PASS
Submit
should
be shown to fill
button with displayed to the age fields
Age
field fill the age
empty
fields
TCReg11
Click
Submit
button with
age
field
containing
more than 2
digits
Message
should
be
displayed to
fill age less
than 70
Message is PASS
displayed to
fill age less
than 70
TCReg12
Click
Submit
button with
age
field
containing
age less than
17
Message
should
be
displayed
age should
be more than
17
Message is PASS
displayed
age should
be more than
17
TCReg13
Click
Message
Message is PASS
Submit
should
be shown to fill
button with displayed to the Weight
Weight field fill
the fields
empty
Weight
fields
TCReg14
Click
Submit
button with
Weight field
containing
value
less
than 50
Message
should
be
displayed
weight
should
be
more
than
50
TCReg15
Click
Submit
button
without
Message
Message is PASS
should
be displayed
displayed
select city
select city
39
Message is PASS
displayed
weight
should
be
more
than
50
selecting
city
TCReg16
Click
Submit
button
without
Internet
Connection
Message
should
be
displayed
Connection
Error
Message is PASS
displayed
Connection
Error
Test Case
ID
Description
Expected
Output
Actual
Result
TCSch16
Click
Search Icon
without
Internet
Connection
Message
should
be
displayed
Connection
Error
Message is PASS
displayed
Connectio
n Error
TCSch02
Click
Search Icon
without
Selecting
City
Message
should
be
displayed
Select City
Message is PASS
displayed
Select
City
TCSch03
Click
Search Icon
without
Selecting
Blood
Group
Message
should
be
displayed
Select Blood
Group
Message is PASS
displayed
Select
Blood
Group
Search
40
Remarks
8. IMPLIMENTATION
Conversion Plan
The Conversion Plan describes the strategies involved in converting data from an
existing system to another hardware or software environment. It is appropriate to
re-examine the original systems functional requirements for the condition of the
system before conversion to determine if the original requirements are still valid.
Various Types of conversion are as follows: Intra language conversion is a conversion between different versions of the same
computer language or different versions of a software system, such as a database
41
Corrective Maintenance
Adaptive Maintenance
Perfective Maintenance
Preventive Maintenance
When this system is installed it is used for long period. The average life of a system is 4 to 6
years and maximum used for 10 years. However, this period of use brings with it the need to
continually maintain the system, but this system can be modified and new technologies can
be used which are prevalent in market at that period of time. Software maintenance requires
an accurate maintenance plan to be prepared during the software development. It should
specify how users will request modifications or report problems. The budget should include
resource and cost estimates. A new decision should be addressed for the developing of every
new system feature and its quality objectives. Software maintenance takes more effort than
all other phases of software life cycle, but it has not been given as much importance as it
deserved. It is an admitted fact that approximately 60 to 70% effort is spent on maintenance
phase of software development life cycle.
42
9. PROJECT LEGACY
CURRENT STATUS OF THE PROJECT
The Designing phase has been almost completed of the project which consists of following
modules. The different modules of the project are:
In User Module, Anonymous user can visit all the links like adding, viewing, of the Blood
Donor. In the Register User module, new Donor can be added by Registration and get access
to another Donor detail and contact that person.
The Donor cannot register other. Only that person is too added in this application which is
above 18 year or up to 60 year. User can install this app in their phone and easily search the
blood Donor detail in case of emergency.
This website could be created to access all the data available on server side.
Call Facility Could is included when any person search the blood Donor.
Analysis module can to create to determine the location of the Donor.
Increase the efficiency to search the blood.
Web services can be enhanced to collect more information of project.
43
44
45
46
47
48
MainActivity.java
BloodBank.java
DrawerItemCustomAdapter.java
Home.java
Registration.java
Benefit.java
Fraghome.java
AboutUs.java
Share.java
Rate_Us.java
Contact.java
Feedback.java
Search.java
Custom_Values.java
ObjectDrawitem.java
JSONfunctions.java
Final.java
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<TabWidget
android:id="@android:id/tabs"
android:layout_width="fill_parent"
android:layout_height="wrap_content"/>
<FrameLayout
50
android:id="@android:id/tabcontent"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
></FrameLayout>
</LinearLayout>
</TabHost>
<FrameLayout
android:id="@+id/content_frame"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<ListView
android:id="@+id/left_drawer"
android:layout_width="240dp"
android:layout_height="match_parent"
android:layout_gravity="start"
android:choiceMode="singleChoice"
android:divider="@android:color/transparent"
android:dividerHeight="0dp"
android:background="#111"/>
</android.support.v4.widget.DrawerLayout>
51
3) Registration Screen
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/drop"
android:orientation="vertical" >
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="20dp"
android:layout_marginTop="20dp"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="20dp"
android:textStyle="italic"
android:text="Name:/>
<EditText
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textStyle="italic"
android:inputType="textPersonName"
android:id="@+id/name"
android:textSize="20dp"/>
52
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="20dp"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:numeric="integer"
android:text="Age: "
android:textSize="20dp"
android:textStyle="italic" />
<EditText
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/age"
android:textStyle="italic"
android:inputType="number"
android:textSize="20dp"/>
</LinearLayout>
53
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="20dp"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="20dp"
android:textStyle="italic"
android:inputType="number"
android:text="Weight"/>
<EditText
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/weight"
android:textStyle="italic"
android:inputType="number"
android:textSize="20dp"/>
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="20dp"
android:layout_marginTop="2dp"
android:orientation="horizontal">
54
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="20dp"
android:textStyle="italic"
android:text="Blood Group: "/>
<Spinner
android:layout_width="wrap_content"
android:layout_height="50dp"
android:id="@+id/bg"
android:textStyle="italic"
android:textSize="15dp"/>
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="-10dp"
android:layout_marginLeft="20dp"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="20dp"
android:textStyle="italic"
android:text="Sex: "/>
<Spinner
android:layout_width="wrap_content"
55
android:layout_height="50dp"
android:id="@+id/sex"
android:textStyle="italic"
android:textSize="20dp"/>
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="20dp"
android:layout_marginTop="-10dp"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="20dp"
android:textStyle="italic"
android:text="Contact no.: "/>
<EditText
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/phone"
android:textStyle="italic"
android:inputType="number"
android:textSize="20dp"/>
</LinearLayout>
56
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="20dp"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="20dp"
android:textStyle="italic"
android:text="City: "
/>
<Spinner
android:layout_width="wrap_content"
android:layout_height="50dp"
android:id="@+id/city"
android:textStyle="italic"/>
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:layout_marginLeft="100dp">
57
<Button
android:id="@+id/reg"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="30dp"
android:text="Submit"/>
</LinearLayout>
</LinearLayout>
Search Screen
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:orientation="vertical">
<ListView
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:id="@+id/lst_srch">
</ListView>
</LinearLayout>
4) Home Screen
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:weightSum="2"
58
android:orientation="vertical" >
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="0dp"
android:orientation="horizontal"
android:layout_weight="1.4"
android:layout_marginTop="10dp">
<ViewFlipper
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:id="@+id/flip"
>
<ImageView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@drawable/first"/>
<ImageView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@drawable/second"/>
<ImageView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@drawable/third"/>
<ImageView
android:layout_width="fill_parent"
59
android:layout_height="fill_parent"
android:background="@drawable/fourth"/>
<ImageView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@drawable/fifth"/>
<ImageView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@drawable/sixth"/>
<ImageView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@drawable/seventh"/>
<ImageView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@drawable/eighth"/>
</ViewFlipper>
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="0dp"
android:layout_weight="0.6"
android:layout_marginTop="50dp"
android:layout_marginLeft="20dp"
60
android:orientation="vertical">
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="20dp"
android:orientation="vertical">
<Spinner
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:id="@+id/city"/>
<Spinner
android:layout_marginLeft="110dp"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:id="@+id/bgroup"/>
<Button
android:id="@+id/search"
android:layout_width="60dp"
android:layout_height="30dp"
android:layout_marginTop="20dp"
android:layout_marginLeft="190dp"
android:background="@drawable/search"/>
</RelativeLayout>
</LinearLayout>
</LinearLayout>
61
5) Rate Us:
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:orientation="horizontal"
android:background="@drawable/search"
>
<RatingBar
android:id="@+id/rat"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="50dp"/>
<Button
android:id="@+id/click"
android:layout_width="wrap_content"
android:layout_height="50dp"
android:textSize="20dp"
android:layout_marginTop="50dp"
android:text="Rate"
/>
</LinearLayout>
6) Contact Us
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
62
android:layout_marginTop="50dp"
android:background="@drawable/drop"
android:orientation="vertical">
<TextView
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:layout_marginLeft="90dp"
android:textSize="20dp"
android:text="CONTACT US"/>
<TextView
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:layout_marginLeft="20dp"
android:layout_marginTop="20dp"
android:textSize="20dp"
android:text="Feel free to email Contact us, ask your queries."/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:inputType="textEmailAddress"
android:layout_marginLeft="30dp"
android:textSize="15dp"
android:layout_marginTop="20dp"
android:text="veena.thakur.thakur07@gmail.com,"/>
<TextView
63
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:inputType="textEmailAddress"
android:textSize="15dp"
android:layout_marginTop="20dp"
android:layout_marginLeft="30dp"
android:text=" thakurpreeti390@gmail.com,"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:inputType="textEmailAddress"
android:textSize="15dp"
android:layout_marginTop="20dp"
android:layout_marginLeft="30dp"
android:text="manpreetsingh2111@gmail.com,"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:inputType="textEmailAddress"
android:textSize="15dp"
android:layout_marginTop="20dp"
android:layout_marginLeft="30dp"
android:text="hardeepgillmh1@gmail.com"/>
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
64
android:layout_marginLeft="20dp"
android:inputType="number"
android:textSize="15dp"
android:layout_marginTop="20dp"
android:text="8591222522,9988279174"/>
</LinearLayout>
7) Tabs:
<android.support.v4.widget.DrawerLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent">
<TabHost
android:id="@android:id/tabhost"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical">
65
<TabWidget
android:id="@android:id/tabs"
android:layout_width="fill_parent"
android:layout_height="wrap_content"/>
<FrameLayout
android:id="@android:id/tabcontent"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
></FrameLayout>
</LinearLayout>
</TabHost>
<FrameLayout
android:id="@+id/content_frame"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<ListView
android:id="@+id/left_drawer"
android:layout_width="240dp"
android:layout_height="match_parent"
android:layout_gravity="start"
66
android:choiceMode="singleChoice"
android:divider="@android:color/transparent"
android:dividerHeight="0dp"
android:background="#111"/>
</android.support.v4.widget.DrawerLayout>
8) About us:
<ScrollView
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_height="fill_parent"
android:layout_width="fill_parent">
<LinearLayout
android:id="@+id/container"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical"
android:background="@drawable/fback" >
<TextView
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:layout_marginRight="20dp"
android:layout_marginTop="50dp"
android:layout_marginLeft="20dp"
android:textSize="20dp"
android:text="The Blood Bank system is developed so that users can
view the information about registered blood donors such as name, address, and
other such personal information along with their details of blood group and
other medical information of donor. This project requires internet access and
thus there is a disadvantage of internet failure."/>
67
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"
android:layout_marginTop="50dp"
android:text="The Blood you donate gives someone another chance at
life. One day that someone may be a close relative, a friend, a loved one-or
even you."
android:textSize="20dp" />
<TextView
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:layout_marginRight="20dp"
android:layout_marginTop="50dp"
android:layout_marginLeft="20dp"
android:textSize="20dp"
android:text="At 18 you grow up. At 18 you drive. At 18 you give Blood
to keep someone alive."/>
</LinearLayout>
</ScrollView>
68
9) Feedback:
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="40dp"
android:layout_marginLeft="30dp"
android:text="hvgxfgv"/>
<RadioGroup
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="30dp">
<RadioButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Excellent"/>
<RadioButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Good"/>
<RadioButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
69
android:text="Average"/>
</RadioGroup>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:layout_marginLeft="30dp"
android:textSize="20dp"
android:text="Any Suggestion"/>
<EditText
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:inputType="textMultiLine"/>
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="40dp"
android:layout_marginLeft="70dp"
android:text="Finish"/>
</LinearLayout>
70
import android.annotation.SuppressLint;
import android.annotation.TargetApi;
import android.app.Fragment;
import android.app.FragmentManager;
import android.app.TabActivity;
import android.content.Intent;
import android.os.Build;
import android.os.Bundle;
import android.support.v4.app.ActionBarDrawerToggle;
import android.support.v4.widget.DrawerLayout;
import android.util.Log;
import android.view.MenuItem;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ListView;
import android.widget.TabHost;
import android.widget.TabHost.TabSpec;
@TargetApi(Build.VERSION_CODES.HONEYCOMB)
@SuppressLint("NewApi")
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.bloodbank);
// for proper titles
TabHost tabHost=getTabHost();
TabSpec hometab=tabHost.newTabSpec("Search");
hometab.setIndicator("Search",getResources().getDrawable(R.drawable.ic_launcher));
Intent photoIntent=new Intent(this,Home.class);
hometab.setContent(photoIntent);
TabSpec regitab=tabHost.newTabSpec("Registration");
regitab.setIndicator("Registration",getResources().getDrawable(R.drawable.ic_launcher));
Intent songIntent=new Intent(this,Registration.class);
72
regitab.setContent(songIntent);
tabHost.addTab(hometab);
tabHost.addTab(regitab);
//Set Fragmentation Title
mTitle = mDrawerTitle = getTitle();
// initialize properties
mNavigationDrawerItemTitles
getResources().getStringArray(R.array.navigation_drawer_items_array);
new
ObjectDrawitem(R.drawable.feedback,
"Feedback");
drawerItem[6] = new ObjectDrawitem(R.drawable.rate, "Rate Us");
drawerItem[7] = new ObjectDrawitem(R.drawable.about, "About");
73
new
mDrawerList.setAdapter(adapter);
android.app.FragmentTransaction
getFragmentManager().beginTransaction();
mFragmentTransaction
mFragmentTransaction.addToBackStack(null);
// set the item click listener
mDrawerList.setOnItemClickListener(new DrawerItemClickListener())
// for app icon control for nav drawer
mDrawerLayout = (DrawerLayout) findViewById(R.id.drawer_layout);
mDrawerToggle = new ActionBarDrawerToggle(
this,
/* host Activity */
mDrawerLayout,
/* DrawerLayout object */
74
}
// Set the drawer toggle as the DrawerListener
mDrawerLayout.setDrawerListener(mDrawerToggle);
// enable ActionBar app icon to behave as action to toggle nav drawer
getActionBar().setDisplayHomeAsUpEnabled(true);
getActionBar().setHomeButtonEnabled(true);
if (savedInstanceState == null) {
// on first time display view for first nav item
selectItem(0);
}
}@Override
public boolean onOptionsItemSelected(MenuItem item) {
// The action bar home/up action should open or close the drawer.
// ActionBarDrawerToggle will take care of this.
if (mDrawerToggle.onOptionsItemSelected(item)) {
return true;
}
return super.onOptionsItemSelected(item);
}
// to change up caret
@Override
protected void onPostCreate(Bundle savedInstanceState) {
super.onPostCreate(savedInstanceState);
// Sync the toggle state after onRestoreInstanceState has occurred.
mDrawerToggle.syncState();
}
// navigation drawer click listener
75
@Override
public void onItemClick(AdapterView<?> parent, View view, int
position, long id) {
selectItem(position);
}
}
private void selectItem(int position) {
// update the main content by replacing fragments
Fragment fragment = null:
switch (position) {
case 0:
fragment = new Fraghome();
break;
case 1:
fragment = new Facts();
break;
case 2:
fragment = new Benefit();
break;
case 3:
fragment = new Share();
break;
case 4:
fragment = new Contect();
break;
case 5:
76
} else {
// error in creating fragment
Log.e("MainActivity", "Error in creating fragment");
}
}
77
@Override
public void setTitle(CharSequence title) {
mTitle = title;
getActionBar().setTitle(mTitle);
}
@Override
public void onBackPressed() {
if (getFragmentManager().getBackStackEntryCount() == 0) {
this.finish();
Intent back=new Intent(this,BloodBank.class);
startActivity(back);
} else {
getFragmentManager().popBackStack();
}
}
}
78
2. Home Activity:
package com.example.bloodbank;
import android.app.Activity;
import android.app.Fragment;
import android.content.Intent;
import android.net.ConnectivityManager;
import android.os.Bundle;
import android.view.View;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemSelectedListener;
import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.Spinner;
import android.widget.Toast;
import android.widget.ViewFlipper;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.home);
Bhavnagar","Bhilai","Bhilwara","Bhimavaram","Bhiwandi","Bhiwani","Bhopal","Bhubanes
war","Bhuj","Bhusawal","Bidar","Bihar","Bijapur","Bijnor","Bikaner","Bilaspur","Bokaro
Steel City","Bolpur",
"Bommanahalli","Bongaigaon","Bongaon","Brahmapur","Bulandshahr","Byatarayanapura","
Chandigarh","Chandrapur","Changanacheri","Chapara","Chengalpattu","Chennai","Cherthal
a","Chhindwara","Chidambaram","Chikmagalur","Chitradurga","Chittaurgarh","Chittoor","C
huru","Coimbatore","Coonoor","Cuddapah","Cuttack","dadri","Daman","Darbhanga","Dava
nagere","Dehra Dun","Delhi",
"Deoghar","Deoira","Dewas","Dhanbad","Dharmapuri","Dhenkanal","Dhule","Dibrugarh","
Dimapur", "Dindigul","Dispur","Dombivali","Dum
Dum","DurgBhilainagar","DurgapurMC","Edathala","Eluru",
"Erode","Etawah","Faizabad","Faridabad","Faridkot","Farrukhabad","Fatehabad","Fazilka","
Firozabad","Firozpur","Gadag","Gaddiannaram","Gajukwaka","Gandhidham","Gandhinagar
","Ganganagar","Gangtok","Gaya","Ghatlodiya","Ghaziabad","Ghazipur","Giridih","Gobich
ettipalayam","Gobindgarh","Godhra","Gonda","Gondia","Gorakhpur","Gulbarga","guna","G
untur","Gurdaspur","Gurgaon","Guruayur","Guwahati","Gwalior","Habra","Hajipur","Haldia
","Haldwani","Hansi","Hanumangarh","Hapur",
"Hardwar","Hassan","Hathras","Hazaribagh","Himatnagar","Hissar","Hooghly_Chinsurah","
Hoshangabad","Hoshiarpur","Hospet","Hosur","Howrah","Hubli","Hyderabad","Ichalkaranji
","Imphal","Indore","Itanagar","Jabalpur","JabalpurCantonment","Jagadhri","Jagdalpur","Jag
raon","Jaipur","Jaisalmer","Jalandhar","Jalgaon","Jalna","Jalpaiguri","Jammu","Jamnagar","J
amshedpur","Jaunpur","Jhansi","Jharsuguda","Jhunjhunun","Jind","Jodhpur","Jorhat","Junag
adh","Kaithal","Kakinada","Kalamassery","Kalyan","Kalyani","Kanchipuram","Kannur","Ka
npur","Kanpur
Cantonment","Kapurthala","Karad","Karaikal","Karaikkudi","Karimnagar","Karnal","Karur"
,"Karwar","Kasaragod","Kashipur","Kathua","Katihar","Kavaratti","Kayamkulam","Khamm
an","Khandwa","Khanna","Kharagpur","Khopoli","Kochi","Kodungallur","Kolar","Kolhapur
","Kolkata","Kollam","Korba","KotKapura","Kota","Kottyam","Kozhikode","Krishnagiri","
Krishnanagar","Krishnarajapura","Kukatpalle","Kullu","Kumbakonam","Kurnool","Kuruksh
etra","Lakhimpur","Lalbahadur Nagar","Latur", "Lonavale","Lucknow","Lucknow
Cantonment","Ludhiana","Machilipatnam","Madavaram", "Madgaon",
"Madurai","Mahadevapura","Mahbubnagar","Mahesana","Malappuram","Malegaon" ,"Maler
Kotla","Malkajgiri","Malout","Mancherial","Mandi","Mandi Dabwali","Mandsaur",
"Mandya","Mangalore","Mango","Manjeri","Mansa","Mathura","Mayiladuthurai","Medinipu
r","Meerut","Meerut Cantonment","Mira
Bhayandar","Mirzapur","Modinagar","Moga","Mohali", "Moradabad",
"Morbi","Mormugao","Motihari","Muktsar","Mumbai","Murshidabad",
"Muzaffarnagar","Muzaffarpur","Mysore","Nabha","Nadiad","Nagaon","Nagapattinam","Na
gaur","Nagercoil","Nagpur","Nalasopara","Nalgonda","Namakkal","Nanded","Nandyal","Na
rnaul","Nashik","Navi
Mumbai","Navsari","Nedumangad","Nellore","Neyveli","Nizambad","Noida","Old
Malda","Ongole","Ozhukarai","Palakkad","Palanpur","Palghar","Pali","Palwal","Panaji","Pa
nchkula","Panipat","Panvel","Parbhani","Patan","Pathankot","Patiala","Patna","Phagwara","
Pilibhit","Pimpri-Chinchwad","Pollachi","Pondicherry","Porbandar","Port
81
Blair","Pudukkottai","Pune","Pune
Cantonemnt","Puri","Purnia","Purulia","Qutubullapur","Raebareli","Raichur","Raiganj","Rai
garh","Raipur","Rajahmundry","RajarhatGopalpore","Rajendranagar","Rajkot","Rajnandgaon","Rajpura"
,"Ramanathapuram","Ramgarh","Rampur","Ranaghat","Ranchi","Ranip","Ratlam","Ratnagir
i","Raurkela","Rewa","Rewari","Rishikesh","Rohtak","Roorkee","Rudrapur","S.A.S.
Nagar","Sagar", "Saharanpur", "Salem","Samastipur","Sambalpur","Sangli (Miraj)","Sangrur","Satara","Satna",
"Secunderabad","Seoni","Serampore","Serilingampalle","Shahdol","Shahjahanpur","Shamli"
,"Shillong","Shimla","Shimoga","Sibsagar","Sikar","Silchar","SiliguriM.C.","Silvassa","Sirh
ind","Sirsa","Sitapur","Sivakasi","Siwan","Solan","Solapur","Sonepat","South Dum
Dum","Srikakulam","Srinagar"
,"Sultanpur","Sunam","Surat","Surendranagar","Tambaram","Tamluk","Tanuku","Tarn
Taran","Tenali","Tenkasi","Tezpur","Thalassery","Thane","Thanesar","Thanjavur","Theni","
Thiruvananthapuram","Thrissur","Tindivanam","Tinsukia","Tiruchirappali","Tirunelveli","Ti
rupati","Tiruppur","Tirur","Tiruvalla","Tiruvannamalai","Tiruvottiyur","Tumkur","Udaipur",
"Udhagamandalam","Udhampur","Udupi","Ujjain","Ulhasnagar","Unnao","Uppal
Kalan","Vadakara","Vadodara","Valsad","Vapi",
"Varanasi","Vasai","Vejalpur","Vellore","Vidisha","Vijayawada","Viluppuram","Virar","Vir
udhunagar","Visakhpatnam","Vrindavan","Warangal","Wardha","Yamuna
Nagar","Yavatmal","Yelahanka", "Zira"};
ArrayAdapter<String> cityadptr=new ArrayAdapter<String>(this,
android.R.layout.simple_dropdown_item_1line,city);
spcty.setAdapter(cityadptr);
spcty.setOnItemSelectedListener(new OnItemSelectedListener() {
@Override
public void onItemSelected(AdapterView<?> arg0, View arg1,
int arg2, long arg3) {
// TODO Auto-generated method stub
String name=spcty.getItemAtPosition(arg2).toString();
}
@Override
public void onNothingSelected(AdapterView<?> arg0) {
// TODO Auto-generated method stub
}
82
});
flip=(ViewFlipper)findViewById(R.id.flip);
search=(Button)findViewById(R.id.search);
search.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View arg0) {
// get Connectivity Manager object to check connection
ConnectivityManager connec =
(ConnectivityManager)getSystemService(getBaseContext().CONNECTIVITY_SERVICE);
==
connec.getNetworkInfo(0).getState()
android.net.NetworkInfo.State.CONNECTING ||
==
connec.getNetworkInfo(1).getState()
android.net.NetworkInfo.State.CONNECTING ||
==
connec.getNetworkInfo(1).getState()
android.net.NetworkInfo.State.CONNECTED ) {
==
Toast.makeText(getApplicationContext(),spbg.getSelectedItem().toString()+","
+spcty.getSelectedItem().toString() ,
Toast.LENGTH_LONG).show();
Intent
Intent(getApplicationContext(),Search.class);
searchobj=new
searchobj.putExtra("key_city",
spcty.getSelectedItem().toString());
searchobj.putExtra("key_bld",
spbg.getSelectedItem().toString());
83
startActivity(searchobj);
}
else if (
connec.getNetworkInfo(0).getState()
android.net.NetworkInfo.State.DISCONNECTED ||
==
connec.getNetworkInfo(1).getState()
android.net.NetworkInfo.State.DISCONNECTED ) {
==
Toast.makeText(Home.this,
Toast.LENGTH_LONG).show();
}
}
});
flip.startFlipping();
}
}
84
"Connection
error",
3. Registration Activity:
package com.example.bloodbank;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.List;
import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.StatusLine;
import org.apache.http.client.ClientProtocolException;
import org.apache.http.client.HttpClient;
import org.apache.http.client.entity.UrlEncodedFormEntity;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.impl.client.DefaultHttpClient;
import org.apache.http.message.BasicNameValuePair;
import android.annotation.SuppressLint;
import android.app.Activity;
import android.net.ConnectivityManager;
import android.os.Bundle;
import android.os.StrictMode;
import android.util.Log;
85
import android.view.View;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Spinner;
import android.widget.Toast;
import android.widget.AdapterView.OnItemSelectedListener;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.registration);
if (android.os.Build.VERSION.SDK_INT > 9) {
StrictMode.ThreadPolicy
policy
StrictMode.ThreadPolicy.Builder().permitAll().build();
StrictMode.setThreadPolicy(policy);
}
final Spinner bg=(Spinner)findViewById(R.id.bg);
final Spinner sex=(Spinner)findViewById(R.id.sex);
86
new
sex.setAdapter(adpt);
sex.setOnItemSelectedListener(new OnItemSelectedListener() {
@Override
public void onItemSelected(AdapterView<?> arg0, View arg1,
int arg2, long arg3) {
// TODO Auto-generated method stub
String group=sex.getItemAtPosition(arg2).toString();
}
@Override
public void onNothingSelected(AdapterView<?> arg0) {
// TODO Auto-generated method stub
}
});
87
ArrayAdapter<String>
adptr=new
ArrayAdapter<String>(this,
R.layout.support_simple_spinner_dropdown_item,bloodgroup);
bg.setAdapter(adptr);
bg.setOnItemSelectedListener(new OnItemSelectedListener() {
@Override
public void onItemSelected(AdapterView<?> arg0, View arg1,
int arg2, long arg3) {
// TODO Auto-generated method stub
String group=bg.getItemAtPosition(arg2).toString();
}
@Override
public void onNothingSelected(AdapterView<?> arg0) {
// TODO Auto-generated method stub
}
});
Sadar","Ambarnath","Ambattur","Ambikapur","Amravati","Amreli","Amritsar","Amroha,"A
nand","Anantnag",
"Anklesvar","Ara","Arakonam","AsansoIMC","Aurangabad","Avadi","Azamgarh",
"Badlapur",
"Bagalkot""Bahadurgarh","Baharampore","Bahraich","Balaghat","Balangir","Baleshwar",
"Ballia","Balurghat","Bangalore","Bankura","Banswara","Baramati","Baramula","Barasat","
Baraut","Bardhaman","Bardoli","Bareilly","Bareilly","Bargarh","Baripada","Barmer","Barna
la","Barrackpore","Baruipur","Basti","Batala","Bathinda","Beawar","Begusarai","Behta
Hajipur","Belgaum", "Bellary
,"Bettiah","Betul","Bhadrak","Bhagalpur","Bhandara","Bharatpur","Bharatpur","Bharuch","
Bhavnagar","Bhilai","Bhilwara","Bhimavaram","Bhiwandi","Bhiwani","Bhopal","Bhubanes
war","Bhuj","Bhusawal","Bidar","Bihar","Bijapur","Bijnor","Bikaner","Bilaspur","Bokaro
Steel City","Bolpur",
"Bommanahalli","Bongaigaon","Bongaon","Brahmapur","Bulandshahr","Byatarayanapura","
Chandigarh","Chandrapur","Changanacheri","Chapara","Chengalpattu","Chennai","Cherthal
a","Chhindwara","Chidambaram","Chikmagalur","Chitradurga","Chittaurgarh","Chittoor","C
huru","Coimbatore","Coonoor","Cuddapah","Cuttack","dadri","Daman","Darbhanga","Dava
nagere","Dehra Dun","Delhi",
"Deoghar","Deoira","Dewas","Dhanbad","Dharmapuri","Dhenkanal","Dhule","Dibrugarh","
Dimapur", "Dindigul","Dispur","Dombivali","Dum
Dum","DurgBhilainagar","DurgapurMC","Edathala","Eluru",
"Erode","Etawah","Faizabad","Faridabad","Faridkot","Farrukhabad","Fatehabad","Fazilka","
Firozabad","Firozpur","Gadag","Gaddiannaram","Gajukwaka","Gandhidham","Gandhinagar
","Ganganagar","Gangtok","Gaya","Ghatlodiya","Ghaziabad","Ghazipur","Giridih","Gobich
ettipalayam","Gobindgarh","Godhra","Gonda","Gondia","Gorakhpur","Gulbarga","guna","G
untur","Gurdaspur","Gurgaon","Guruayur","Guwahati","Gwalior","Habra","Hajipur","Haldia
","Haldwani","Hansi","Hanumangarh","Hapur",
"Hardwar","Hassan","Hathras","Hazaribagh","Himatnagar","Hissar","Hooghly_Chinsurah","
Hoshangabad","Hoshiarpur","Hospet","Hosur","Howrah","Hubli","Hyderabad","Ichalkaranji
","Imphal","Indore","Itanagar","Jabalpur","JabalpurCantonment","Jagadhri","Jagdalpur","Jag
raon","Jaipur","Jaisalmer","Jalandhar","Jalgaon","Jalna","Jalpaiguri","Jammu","Jamnagar","J
amshedpur","Jaunpur","Jhansi","Jharsuguda","Jhunjhunun","Jind","Jodhpur","Jorhat","Junag
adh","Kaithal","Kakinada","Kalamassery","Kalyan","Kalyani","Kanchipuram","Kannur","Ka
npur","Kanpur
Cantonment","Kapurthala","Karad","Karaikal","Karaikkudi","Karimnagar","Karnal","Karur"
,"Karwar","Kasaragod","Kashipur","Kathua","Katihar","Kavaratti","Kayamkulam","Khamm
an","Khandwa","Khanna","Kharagpur","Khopoli","Kochi","Kodungallur","Kolar","Kolhapur
","Kolkata","Kollam","Korba","KotKapura","Kota","Kottyam","Kozhikode","Krishnagiri","
Krishnanagar","Krishnarajapura","Kukatpalle","Kullu","Kumbakonam","Kurnool","Kuruksh
etra","Lakhimpur","Lalbahadur Nagar","Latur", "Lonavale","Lucknow","Lucknow
Cantonment","Ludhiana","Machilipatnam","Madavaram", "Madgaon",
"Madurai","Mahadevapura","Mahbubnagar","Mahesana","Malappuram","Malegaon" ,"Maler
Kotla","Malkajgiri","Malout","Mancherial","Mandi","Mandi Dabwali","Mandsaur",
"Mandya","Mangalore","Mango","Manjeri","Mansa","Mathura","Mayiladuthurai","Medinipu
89
r","Meerut","Meerut Cantonment","Mira
Bhayandar","Mirzapur","Modinagar","Moga","Mohali", "Moradabad",
"Morbi","Mormugao","Motihari","Muktsar","Mumbai","Murshidabad",
"Muzaffarnagar","Muzaffarpur","Mysore","Nabha","Nadiad","Nagaon","Nagapattinam","Na
gaur","Nagercoil","Nagpur","Nalasopara","Nalgonda","Namakkal","Nanded","Nandyal","Na
rnaul","Nashik","Navi
Mumbai","Navsari","Nedumangad","Nellore","Neyveli","Nizambad","Noida","Old
Malda","Ongole","Ozhukarai","Palakkad","Palanpur","Palghar","Pali","Palwal","Panaji","Pa
nchkula","Panipat","Panvel","Parbhani","Patan","Pathankot","Patiala","Patna","Phagwara","
Pilibhit","Pimpri-Chinchwad","Pollachi","Pondicherry","Porbandar","Port
Blair","Pudukkottai","Pune","Pune
Cantonemnt","Puri","Purnia","Purulia","Qutubullapur","Raebareli","Raichur","Raiganj","Rai
garh","Raipur","Rajahmundry","RajarhatGopalpore","Rajendranagar","Rajkot","Rajnandgaon","Rajpura"
,"Ramanathapuram","Ramgarh","Rampur","Ranaghat","Ranchi","Ranip","Ratlam","Ratnagir
i","Raurkela","Rewa","Rewari","Rishikesh","Rohtak","Roorkee","Rudrapur","S.A.S.
Nagar","Sagar", "Saharanpur", "Salem","Samastipur","Sambalpur","Sangli (Miraj)","Sangrur","Satara","Satna",
"Secunderabad","Seoni","Serampore","Serilingampalle","Shahdol","Shahjahanpur","Shamli"
,"Shillong","Shimla","Shimoga","Sibsagar","Sikar","Silchar","SiliguriM.C.","Silvassa","Sirh
ind","Sirsa","Sitapur","Sivakasi","Siwan","Solan","Solapur","Sonepat","South Dum
Dum","Srikakulam","Srinagar"
,"Sultanpur","Sunam","Surat","Surendranagar","Tambaram","Tamluk","Tanuku","Tarn
Taran","Tenali","Tenkasi","Tezpur","Thalassery","Thane","Thanesar","Thanjavur","Theni","
Thiruvananthapuram","Thrissur","Tindivanam","Tinsukia","Tiruchirappali","Tirunelveli","Ti
rupati","Tiruppur","Tirur","Tiruvalla","Tiruvannamalai","Tiruvottiyur","Tumkur","Udaipur",
"Udhagamandalam","Udhampur","Udupi","Ujjain","Ulhasnagar","Unnao","Uppal
Kalan","Vadakara","Vadodara","Valsad","Vapi",
"Varanasi","Vasai","Vejalpur","Vellore","Vidisha","Vijayawada","Viluppuram","Virar","Vir
udhunagar","Visakhpatnam","Vrindavan","Warangal","Wardha","Yamuna
Nagar","Yavatmal","Yelahanka", "Zira"};
(ConnectivityManager)getSystemService(getBaseContext().CONNECTIVITY_SERVICE);
if
(
connec.getNetworkInfo(0).getState()
android.net.NetworkInfo.State.CONNECTED ||
==
connec.getNetworkInfo(0).getState()
android.net.NetworkInfo.State.CONNECTING ||
==
connec.getNetworkInfo(1).getState()
android.net.NetworkInfo.State.CONNECTING ||
==
connec.getNetworkInfo(1).getState()
android.net.NetworkInfo.State.CONNECTED ) {
==
if((nm.equals(""))&&(ag.equals(""))&&(ph.equals(""))&&(wt.equals("")))
{
Toast.makeText(getApplicationContext(), "Plz fill all
Fields", 1000).show();
}
else{
String
"http://oneinfonet.besaba.com/blood_save.php";
url
@SuppressWarnings("unused")
String resultServer = getHttpPost(url,params);
92
Toast.makeText(Registration.this,
Toast.LENGTH_LONG).show();
"
Record
Saved...",
}
else if(
connec.getNetworkInfo(0).getState()
android.net.NetworkInfo.State.DISCONNECTED ||
==
connec.getNetworkInfo(1).getState()
android.net.NetworkInfo.State.DISCONNECTED ) {
==
Toast.makeText(Registration.this,
Toast.LENGTH_LONG).show();
"Connection
error",
}
}
}
});
}
public String getHttpPost(String url,List params) {
StringBuilder str = new StringBuilder();
HttpClient client = new DefaultHttpClient();
HttpPost httpPost = new HttpPost(url);
try {
httpPost.setEntity(new UrlEncodedFormEntity(params, "UTF-8"));
HttpResponse response = client.execute(httpPost);
StatusLine statusLine = response.getStatusLine();
int statusCode = statusLine.getStatusCode();
if (statusCode == 200) { // Status OK
HttpEntity entity = response.getEntity();
InputStream content = entity.getContent();
93
BufferedReader
reader
new
BufferedReader(new
InputStreamReader(content));
String line;
while ((line = reader.readLine()) != null) {
str.append(line);
}
} else {
Log.e("Log", "Failed to download result..");
}
} catch (ClientProtocolException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
return str.toString();
}
}
94
4. Search Activity:
package com.example.bloodbank;
import java.util.ArrayList;
import java.util.HashMap;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import android.app.Activity;
import android.app.ProgressDialog;
import android.os.AsyncTask;
import android.os.Bundle;
import android.util.Log;
import android.widget.ListView;
public class Search extends Activity {
//Declare Variables
JSONObject jsonobject;
JSONArray jsonarray;
ListView listview;
CustomValues adapter;
ProgressDialog mProgressDialog;
ArrayList<HashMap<String, String>> arraylist;
static String RANK = "Name";
static String COUNTRY = "phone";
static String weight = "weight";
static String POPULATION = "bloodgroup";
static String age = "age";
static String sex = "sex";
static String city = "city";
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_search);
// Execute DownloadJSON AsyncTask
new DownloadJSON().execute();
}
// DownloadJSON AsyncTask
private class DownloadJSON extends AsyncTask<Void, Void, Void> {
@Override
protected void onPreExecute() {
super.onPreExecute();
// Create a progressdialog
95
@Override
protected Void doInBackground(Void... params) {
// Create an array
arraylist = new ArrayList<HashMap<String, String>>();
// Retrieve JSON Objects from the given URL address
jsonobject = JSONfunctions
.getJSONfromURL("http://oneinfonet.besaba.com/blood_get.php");
try {
// Locate the array name in JSON
jsonarray = jsonobject.getJSONArray("blood_array");
for (int i = 0; i < jsonarray.length(); i++) {
HashMap<String, String> map = new HashMap<String, String>();
jsonobject = jsonarray.getJSONObject(i);
// Retrive JSON Objects
map.put("Name", jsonobject.getString("name"));
map.put("phone", jsonobject.getString("phone"));
map.put("bloodgroup", jsonobject.getString("bloodgroup"));
map.put("age", jsonobject.getString("age"));
map.put("sex", jsonobject.getString("sex"));
map.put("city", jsonobject.getString("city"));
//map.put("flag", jsonobject.getString("flag"));
//Set the JSON Objects into the array
arraylist.add(map);
}
} catch (JSONException e) {
Log.e("Error", e.getMessage());
e.printStackTrace();
}
return null;
}
96
@Override
protected void onPostExecute(Void args) {
// Locate the listview in listview_main.xml
listview = (ListView) findViewById(R.id.lst_srch);
// Pass the results into ListViewAdapter.java
adapter = new CustomValues(Search.this, arraylist);
// Set the adapter to the ListView
listview.setAdapter(adapter);
Log.d("jsonarayaaaaaaaaaaaaaaaaaaaaaaaaaaaa", ""+arraylist);
// Close the progressdialog
mProgressDialog.dismiss();
}
}
//
listview=(ListView)findViewById(R.id.lst_srch);
//
Custom_Values adpter=new Custom_Values(Search.this,
donnernm,donnercity,donnerbg,donnersex);
//
listview.setAdapter(adpter);
//
listview.setOnItemClickListener(new AdapterView.OnItemClickListener() {
//
@Override
//
public void onItemClick(AdapterView<?> arg0, View arg1, int
position,
//
long arg3) {
//
// TODO Auto-generated method stub
//
Toast.makeText(getApplicationContext(), "You Click on
"+donnernm[+position], Toast.LENGTH_LONG).show();
//
}
//
});
//
}
//
97
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.search, menu);
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
// Handle action bar item clicks here. The action bar will
// automatically handle clicks on the Home/Up button, so long
// as you specify a parent activity in AndroidManifest.xml.
int id = item.getItemId();
if (id == R.id.action_settings) {
return true;
}
return super.onOptionsItemSelected(item);
}
98
12. Bibliography
Below the list of websites that we have gone through for the development of the application:
Internet:
a)
b)
c)
d)
http://androidsourcecode.blodspot.in/2010/10/android-reading-inbox-sms.html
www.vogella.com/tutorials/AndroidSQLite/article.html
www.codeproject.com/.../how-to-get-data-from-database-in-android
http://stackoverflow.com/questions/17794551/fetch-data-from-existing-sqlitedatabase
99
100