Professional Documents
Culture Documents
E POST OFFICE
Regno: 14P22J0018
Coimbatore-46
I Hereby declare that his project work titled “E POST OFFICE” is completed under the
guidance of MRS.VIMITHA.K.VIJAYAN and that this project work has not formed the
basis for the award of my degree fellowship or similar title to any candidate of any university.
Signature of candidate:
Registration No : 14P22J0018
Course : BCA
Place : Kolazhy
Date :
Countersigned by:
This is to certify that the project work entitled “E POST OFFICE” submitted to
BharathiarUniversity in partial fulfilment of requirements for the award of the Degree of
Bachelor of Computer Application is recorded of the original work done by AJITH
MOHANAN under my supervision and guidance during the semester and that this project
work has not formed the basis of award of any Degree Fellowship or similar title to any
certificate of any university
Forwarded by:
Director/Principal
Partner Institution
Centre of Participatory Programs
Bharathiar University
Coimbatore-456
ACKNOWLEDGEMENT
May we express my heartfelt thanks to our coordinator & project guide MRS
VIMITHA.K.VIJAYANand all the faculty member of Department of Computer Science for
the pain they took to enquire about the project unfailingly and for motivating use are also
grateful to our friends and family for their motivation.
AJITH MOHANAN
CONTENTS
1. INTRODUCTION
1.1. ORGANIZATION PROFILE
1.2. SYSTEM SPECIFICATION
1.2.1. HARDWARE CONFIGURATION
1.2.2. SOFTWARE CONFIGURATION
1.2.3. LANGUAGE OVERVIEW
2. SYSTEM STUDY
2.1. EXISTING SYSTEM
2.1.1. DRAWBACKS
2.2. PROPOSED SYSTEM
2.2.1. FEATURES
3. SYSTEMDESIGN AND DEVELOPMENT
3.1. FILE DESIGN
3.2. INPUT DESIGN
3.3. OUTPUT DESIGN
3.4. DATABASE DESIGN
3.4.1.NORMALIZATION
3.4.2 FIRST NORMAL FORM
3.4.3 SECOND NORMAL FORM
3.4.4 THIRD NORMAL FORM
3.5. SYSTEM DEVELOPMENT
3.5.1 SOFTWARE DEVOLPMENT TOOLS
3.6. MODULE DESCRIPTION
4. TESTING AND IMPLEMENTATION
4.1 VALIDATION TESTING
4.2 UNIT TESTING
4.3 INTEGRATION TESTING
4.4 ACCEPTANCE TESTING
5. CONCLUSION
5.1. BIBLOGRAPHY
5.2. APPENDICES
A.DATA FLOW DIAGRAMS
B.TABLE STRUCTURE
C.SAMPLE CODING
A.SAMPLE INPUT
B.SAMPLE OUTPUT
SYNOPSIS
E post office is an android app this project has an important role in our day to day life we all
know that that post office has many uses in our day to day life in order to send and receive
parcels articles applications for government tests although we have most modern
technologies for this post offices are preferred more often the project epost office (epos) is
devolved in the form of an app to make it more applicable to the users it specifies about the
courier to be reached, about the pin code of the postal offices, the timings of the offices and
many other information also this project also has a login/registration page in order for the
users to login to the app the main aim of developing this app is to inform the user that
his/her parcels or articles has arrived and will be delivered to them by the date thus this app
provides the users an information about our important things or belongings and lets us
make use of it
1.INTRODUCTION
The e-Post Office is the shopping portal of the world-renowned postal service on
the Internet and an additional distribution channel. It sells Stamps, Postcards, Packets, and
Cartons and has services like courier, registering for electricity vendors, selling mobile
cards, etc. Under this website many products and services can be ordered, that are also
available in a "normal" branch. The product prices are identical with the prices of their
normal branches.
The e-Post Office is expanded permanently through new products and services in
order to offer a product portfolio corresponding to the market. Private customer and
business customers can order the selected products of the postal service online quickly
and comfortably. Besides this, the e-Services offer new flexibility through e-Packet, the
PICKUP order for packages over the Internet as well as the online forwarding order and
storage order. For the case of the absence or the move, one can let delegate here the after
shipment of the postal service at another address or store the letter shipments. The
customers can register themselves and can be served individually.
Target groups of customer of the e-Post Office are predominantly little and
middle-class business. The customers can have a payment alternative through credit card.
In order to use the load writing procedure, the customer registers itself in the e-Post
Office and receives a login for its purchases name. You have to develop this website,
which captures the above functionality. It is an Internet application.
1.1 ORGANIZATION PROFILE
Chinmaya Mission College had a very humble beginning on 12th August 1975 with His
Holiness Swami DayanandaSaraswathi inaugurating the same at SakthanThampuran Palace,
in Thrissur town. There, our institution grew to such heights, not only in quality but also even
in quantity than a regular affiliated college under the University of Calicut. It got shifted to
our permanent building at Chinmaya Gardens, KolazhyPanchayath in 1993 when H.H.
Swami Mridananda of Sri Ramakrishna Mission rendered the inauguration. In 1997, our
college was the first among the reputed institutions in Thrissur to impart computer education
as value added course.
Presently, the college accommodates 2400 students in various courses beginning with
Higher Secondary of Kerala State to B.A. Economics, B.Sc. Maths, B.Sc. Computer Science
B.Com., BBA, BCA, MCA, MBA, and M.Com. Of Calicut University and Bharathiar
University. Since 2000, the college has been a study centre of Bharathiar University
conducting regular classes for MBA, MCA, BCA and B.Sc. (CS). The college has also
become the Programme Centre of Calicut University from the year 2012.
1.2 SYSTEM SPECIFICATION
1.2.1Software Requirements:
System : IBMCompatiblePC
Processor : IntelPentiumIV
Speed : 1.00Gz
As of July 2013 the Google Play store has had over one million Android application (“apps”)
published. A developer survey conducted in April-May 2013 found that 71% of mobile
developers develop for android. At Google I/O 2014, the company revealed that there were over
one billion active monthly Android users up from 538 million in June 2013. As of 2015, Android
has the largest installed base of all general-purpose operating systems.
Android source code is released by Google under open source licenses, although most Android
devices ultimately ship with a combination of open source and proprietary software, including
proprietary software developed and licensed by Google initially developed by Android, which
Google backed financially and later bought in 2005,Android was released in 2007,along with the
founding of the open Handset Alliance-a consortium of hardware, software, and
telecommunication companies developed to advancing open standards for mobile devices.
Applications (“apps”), that extend the functionality of devices, are written primary in the java
programming language using the Android software development kit (SDK).The SDK includes a
comprehensive set of development tools, including a debugger, software libraries, a handset
emulator based on QEMU, documentation, sample code, and tutorials. The official supported
integrated development environment (IDE) is Eclipse using the Android Development Tools
(ADT) plug-in. Other development tools are available, including a Native Development Kit for
application or extensions in C0r C++, Google App Inventor, a visual environment for novice
programmers, and various cross platform mobile web applications framework Google unveiled an
Apache Cordova-based frameworks for porting Chrome HTML 5 applications to Android,
wrapped in native application shell.
JAVA (Programming Language)
International, ISO/IES, ANSI, or any other third-party standards organization , the oracle
implementation is the de facto standard.
The oracle implementations are packaged into two different distributions. The java run time
environment (JRE) which contains the part of java SE platform required to run java programs this
is intended for end users. The java development kit (JDK), is intended for software developers and
includes development tools such as the java compiler, java DOC, jar, and debugger.
Open JDK is another notable java SE implementation that is licensed under GPL. The
implementation started when sun began releasing the java source code under the GPL. As of java
SE 7, open JDK is the official java reference implementation.
The main aim of this project is to computerize the existing system, which minimizes
the work of calculation and manual labour. The objective of this project is to find out the status of
Interview candidate and placed students details.
The existing system is a manual system. This system is fewer users friendly. The file system
does not meet the requirements of the present system. Data retrieval, processing and
manipulations are different. The system brings the current trend in the IT field and makes the user,
get the technologies used in a prosperous and creative manner.
The proposed system is more users friendly in which all transaction files are stored in separate
files. The files are organized based on the requirements and the processing usage.
The existing system is a manual system. This system is fewer users friendly. The file system does
not meet the requirements of the present system. Data retrieval, processing and manipulations are
different. The transactions that take place are follows.
• Debugging is difficult.
2.2 PROPOSEDSYSTEM
The proposed system is designed to meet all the disadvantages of the existing one. The proposed
system is more efficient and better than the existing system. It is designed to overcome all the
drawbacks of the present system and to provide a permanent solution to them.
The primary aim of the new system is to speed up the transactions. The preparation of all the
reports take less time since the verification is done automatically. User friendliness is another
peculiarity of the proposed system. At every stage of data entry, the values entered are checked
and necessary comments and validity messages are provided to the user. Every record is checked
for completeness and accuracy and then it is allowed to enter into the database.
The proposed system is also expected to reduce the amount of paper work involved in the
transactions. Reports are generated in a matter of seconds. These reports can be used as valid
documents by the authorities. Another important feature of the proposed system is the data
security provided by the system. The system is password protected and can only be accessed by
authorized users.
The main objective of the new system is to provide accurate data processing. New system reduces
the manual work and provides updated information. A person who is not
Familiar with computer can do the data entry work very easily. The program is menu driven.
Many options are designed so that they will ensure to give valid output so the user needs.
System design is the process of planning a new business system or one to replace or compliment
and existing system. But before this planning can be done, we must thoroughly understand the old
system and determine how computers can be used to make its operation more effective. The goal
of system design is to produce a model or a representation of an entity that will be built later.
Input design is the process of converting the user oriented description of inputs to a computer
based information system into a program-oriented specification. The objective is to create an input
layout that is easy to follow and phases of input from creation of initial data to actual entry of the
data to the system to processing. This input design is the link that ties the system into world of its
users.
While entering data, operator need to know the allocated space for the each field, the
format the data fields are entered, and the name of the item for the specified code if any. In
addition to these, the input design phase makes sure that data item and transactions have
validation to detect error and comments to warn the user of a wrong input. Control was ensured
for entering input data. A well-designed input should four purposes.
Inputs are most important because in almost all instances, they are only means of contacting a
user or a customer. Various forms are used to serve as data entries screens in order to input
data into the system. The user should see the data in the order in which it occurs on the form
and the Computer should reformat it as and when required.
Output design is an activity, started during the study phase itself. The contents and format of all
documents and reports are in an attractive and useful format. The standards for output design
suggests the following
1. Give each output a specific name or title.
2. Provide a simple output layout
3. State whether each output field is to include zeroes, spaces between fields and alphabetic
or any other data.
4. Specific the procedure for providing the accuracy of data.
Output generally refers to the result and information that are generated by the system. It can be
in the form of operational documents and reports. Since some of the end users will not actually
operate the information system or input data through workstations, but will use the output
from the system. The output design specification was carried out with maximum user friendly
interfaces.
A database is a collection of logically related data designed to meet the information needs of one
or more users. It is a collection of records stored in a computer in a systematic way, so that a
computer program consults it to answer questions. For better retrieval and sorting, each record is
usually organized as a set of data elements (facts). The items retrieved queries become
information that can be used to make decisions.
3.4.1 Normalization
Normalization is the process of organizing data in a database. This includes creating tables and
establishing relationships between those tables according to rules designed both to protect the data
and to make the database more flexible by eliminating redundancy and inconsistent dependency.
Redundant data wastes disk space and creates maintenance problems. If data that exists in more
than one place must be changed, the data must be changed in exactly the same way in all
locations. A buyer’s or promoter’s address change is much easier to implement if that data is
stored only in the buyer’s or promoter’s table and nowhere else in the database. There are a few
rules for database normalization. Each rule is called a "normal form." If the first rule is observed,
the database is said to be in "first normal form." If the first three rules are observed, the database
is considered to be in "third normal form." Although other levels of normalization are possible,
third normal form is considered the highest level necessary for most applications. Normalization
is carried out in this system for the following reasons.
To structure the data so that there is no repetition of data, this helps in saving.
To permit simple retrieval of data in response to query and report request.
To simplify the maintenance of the data through updates, insertions, deletions.
To reduce the need to restructure or reorganize data which new application requirements a rise.
3.4.2 First Normal Form
The First Normal Form states that the domain of an attribute must include only atomic values and
that the value of any attribute in a tuple must be a single value from the domain of that attribute.
In other words 1NF disallows “relations within relations”or “relations as attribute values within
tuples”. The only attribute values permitted by 1NF are single atomic or indivisible values.
The first step is to put the data into First Normal Form. Moving data into separate tables where the
data is of similar type in each table can do this. Each table is given a Primary Key or Foreign Key
as per requirement of the project. In this we form new relations for each monatomic attribute or
nested relation. This eliminates repeating groups of data. A relation is said to be in first normal
form if only if it satisfies the constraints that contain the primary key only.
According to Second Normal Form, for relations where primary key contains multiple attributes,
no non key attribute should be functionally dependent on a part of the primary key.A relation is
said to be in second normal form if and only if it satisfies all the first normal form conditions for
the primary key and every non-primary key attributes of the relation is fully dependent on its
primary key alone.
According to Third Normal Form, Relation should not have a non-key attribute functionally
determined by another non key attribute or by a set of non-key attributes. That is, there should be
no transitive dependency on the primary key.
A relation is said to be in third normal form if only if it is in second normal form and more over
the non-key attributes of the relation should not be depend on other non-key attribute
3.5 SYSTEM DEVELOPMENT
Planning
As a part of this phase the project is typically evaluated in four feasibility. They are
Technical feasibility, economic feasibility, operational feasibility, behavioral feasibility,
finally found it is absolutely feasible and suits for any education institution. Then an idea
about the front end and back end to use for the system development was drawn out will be
find to work with available facility. Then a plan was modeled to gather information from
clients that will help us in the entire system construction.
Design
In system design phase, form and table for the application was designed as per the
requirements. SQL 2008 was the backend tool used for the database design.
Coding
In this phase, coding was done for the system that is required to make the system achieve
its intended Goals, programming codes were done in c# using the methods and framework.
Testing
The testing carried out for each form. Mandatory fields were evaluated and validations
involving numeric string Were Made Email were evaluated for the accuracy of value are
done being entered to the database. The size checking for the input values are done to
ensure that it is compatible with the data types provide for the fields.
Feasibility Study
Feasibility Study is performed to choose the system that meets the performance requirements
at least cost. The most essential tasks performed by a Feasibility Study are the identification
and description of candidate systems, the evaluation of the candidate systems and the selection
of the best of the candidate systems. The best system means the system that meet performance
requirements at the least cost. The most difficult part of a Feasibility Study is the identification
of the candidate systems and the evaluation of their performances and costs. The new system
has no additional expense to implement the system. The new system has advantages such as
we can easily access files from any client in the Network, accurate output for accurate input
and this application is more user friendly. We can use this application not only in this
Technical Feasibility
Economical Feasibility
Operational Feasibility
Technical Feasibility
Technical Feasibility study is performed to check whether the proposed system is technically
System (hardware, software, etc) and to what extent it can support the proposed addition. This
technically feasible. All the data are stored in files. The input can be done through dialog boxes
which are both interactive and user friendly. Hard copies can be obtained for future use, by
diverting the documents to a printer. Windows serves as the platform for the new system.
Economical Feasibility
Economical Feasibility Study is the most frequently used method for evaluating the
procedure is to determine the benefits and savings that are expected from a candidate system and
compare them with cost. This analysis phase determines how much cost is needed to produce
the proposed system. This system is economically feasible since it does not require any initial
setup cost, as the organization has required machines and supporting programs for the
Operational Feasibility
Operational Feasibility study is performed to check whether the system is operationally feasible
or not. Using command buttons throughout the application programs enhances operational
feasibility. So maintenance and modification is found to be easier.
3.5.1 SOFTWARE DEVOLPMENT TOOLS
MySQL is a fast, and easy-to-use RDBMS used being used for many small and big
businesses.MySQLis developed, marketed, and supported by MySQL Database, which is a
Swedish company. MySQL (pronounced My Ess Q El) is an open source, SQL relation
database management system (RDBMS) that is free for many uses .Early in its history,
MySQLoccasionally faced opposition due to its lack of support for some core SQL
constructs such as sub selects and foreign keys. Ultimately, however, MySQL found a
board enthusiastic user base for its liberal licensing term, perkey performance, and ease of
use. Its acceptance was aided in part by the wide variety of other technologies such as
PHP, JAVA, PERL, PYTHON, and the like that have encouraged its use through stable,
well-documented modules and extensions.
3.6 Module Description
Module: User
Register-here the user can register if he doesn’t has an account by providing his e-mail
id ,phone number and his basic information
Module:Admin
Nearest office-here the user can search the nearest post office of the region with ease
Gallery-in this section the user can able to search the timing and price details
Module: postmaster
Track the item-here in this section the user can track the parcel or the article which he is
awaited for delivery
4.SYSTEM TESTING AND IMPLEMENTATION
The testing phase involves some modification to the pervious design phase and system testing has
been done to minimize the programming and system error. At the implementation phase, system
requirements such as hardware and software will be defined. Besides that, the system prototype
interfaces and functionalities (module) will be fully demonstrated to users.
The process of evaluating software during the development process or at the end of the
development process to determine whether it satisfies specified business requirements. Validation
Testing ensures that the product actually meets the client's needs. It can also be defined as to
demonstrate that the product fulfils its intended use when deployed on appropriate environment.
Unit testing, a testing technique using which individual modules are tested to determine if there
are any issues by the developer himself. It is concerned with functional correctness of the
standalone modules.
The main aim is to isolate each unit of the system to identify, analyse and fix the defects. During
this first round of testing, the program is submitted to assessments that focus on specific units or
components of the software to determine whether each one is fully functional. The main aim of
this endeavor is to determine whether the application functions as designed. In this phase, a unit
can refer to a function, individual program or even a procedure, and a White-box Testing method
is usually used to get the job done. One of the biggest benefits of this testing phase is that it can be
run every time a piece of code is changed, allowing issues to be resolved as quickly as possible.
It’s quite common for software developers to perform unit tests before delivering software to
testers for formal testing.
Upon completion of unit testing, the units or modules are to be integrated which gives raise to
integration testing. The purpose of integration testing is to verify the functional, performance, and
reliability between the modules that are integrated. After the unit testing has been done with
satisfaction for each component or script, the integration testing is started to ensure the CW-
MSLD System components worked together smoothly. The functional and non-functional
requirements were tested in this stage. One example for integration testing is to search the parcel
model by entering the parcel ID and if the GIS database has the parcel requested, the system will
display it and it can use the data given to register new real estate.
Acceptance testing, a testing technique performed to determine whether or not the software
system has met the requirement specifications. The main purpose of this test is to evaluate the
system's compliance with the business requirements and verify if it is has met the required criteria
for delivery to end users.
Alpha Testing
Beta Testing
SYSTEM IMPLEMENTATION
Implementation is the stage in the project where the theoretical design is turned into a working
system and is giving confidence on the new system for the users that it will work efficiently and
effectively. It involves careful planning, investigation of the current and its constrains on
implementation, design of the methods to achieve the changeover, an evaluation, of change over
methods. Apart from planning major task of preparing the implementation are education are
training of users. The more complex system being implemented, the more involved will be the
system analysis and the design effort required just for implementation. An Implementation
coordinating committee based on policies of individual organization has been appointed. The
implementation process begins with preparing a plan for the implementation of the system.
According to this plan, the activities are to be carried out, discussions made regarding the
equipment and resources and the additional equipment’s has to be acquired to implement the new
system.
Implementation is the final and important phase .The most critical stage in achieving a
successful new system and in giving the users confidence that the new system will work and be
effective. The system can be implemented only after through testing is done and if it found to
working according to the specification .This method also offers the greatest security since the old
system can take over if the errors are found or inability to handle certain type of transactions while
using the new system.
5.1 BIBLIOGRAPHY
REFERENCES
[3] Thomas m. Connolly, Carolyn E.Begg “Database System & Practical Approach to Design
Implementation and Management”, 4/e, Addision-welsley, 2005
WWW.WIKIPEDIA.COM
WWW.BCCRESEARCH.COM
WWW.FLIPCORP.COM
BOOKS
Programming in c# by balaguruswamy
Database system concepts by korth
ASP>net 2.0 by Black Book
Software Engineering by Yoghesh Singh and KK. Agarwal
5.2 APPENDICES
Data flow is the one of the best ways of documenting the entire functionality of the system. For
the system, which will have some data flows in and have some processing inside and then some
data flow out from the system can be documented or represented effectively by means of data
flow diagrams. The data flow diagrams are a diagrammatic representation of the system, which
has input, process and outputs. Once any system is represented using a data flow diagrams we can
identify the following things easily:
These are various symbols used in the data flow diagrams. Bubbles represent the processes.
Named arrows indicate data flow. External entities are represented by rectangles and are outside
the system such as vendors and customers with whom the system interacts. They either supply or
consume data. Entities supplying data are known as sources and those that consume data are
called sinks. Data are stored in a data store by process in the system. Each component in a DFD is
labelled with a descriptive name. Process names are further identified with a number.
Data flow diagram can be hierarchically organized, which help in partitioning and analysing large
system. As first step, one data flow diagram can depict an entire system, which gives the system
overview. It is called Context Diagram or level 0 DFD. The context diagram can be further
expanded. The successive expansion of a DFD from the context diagram to those giving more
details is known as levelling of DFD. Thus a top down approach is used, starting with an overview
and then working out the details.
The main merit of the DFD is that it can provide an overview of what data a system would
process, what files are used, and where the result flow. Context level DFD was drawn first. Then
the processes were decomposed into several elementary levels and were represented in the order
of importance.Data flow diagrams are excellent mechanism for communicating with customers
during requirement analysis. They are also widely used representation of external and top level
internal design specifications. In the later situations, naming conventions and name of system
components such as a subsystem, files and data links.
Transform process
Data store
A data store is a repository of data that is to be stored for use by one or more process may
be as simple as buffer or queue or sophisticated as relational database. They should have clear
names. If a process merely uses the content of store and does not alter it, the arrowhead goes only
from the store to the process. If a process alters the details in the store then double-headed arrow
is used.
Data flow
A data flow is a route, which enables packets of data to travel from one point to another. Data may
flow, with arrowhead pointing in the direction of the flow.
LEVEL 0
LEVEL 1
LEVEL 2
LEVEL 3
5.2.2 TABLESTRUCTURE
Table registration
Table admin
Login Page
package com.example.user.epost;
import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.view.WindowManager;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ProgressBar;
import android.widget.TextView;
import android.widget.Toast;
import com.loopj.android.http.JsonHttpResponseHandler;
import com.loopj.android.http.RequestParams;
import org.json.JSONException;
import org.json.JSONObject;
import cz.msebera.android.httpclient.Header;
@Override
public void onFailure(int statusCode, Header[] headers, String responseString,
Throwable throwable) {
Log.e("error", responseString);
sendCancelMessage();
}
@Override
public void onRetry(int retryNo) {
super.onRetry(retryNo);
sendCancelMessage();
}
@Override
public void onFailure(int statusCode, Header[] headers, Throwable, JSONObject
errorResponse) {
super.onFailure(statusCode, headers, throwable, errorResponse);
sendCancelMessage();
@Override
public void onUserException(Throwable error) {
super.onUserException(error);
sendCancelMessage();
}
@Override
public void onCancel() {
super.onCancel();
progressBar.setVisibility(View.GONE);
Toast.makeText(getApplicationContext(), "Please check your
internet connection and retry.", Toast.LENGTH_LONG).show();
}
}, getApplicationContext());
}
}
});
reg.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent=new Intent(LoginActivity.this,MainActivity.class);
startActivity(intent);
}
});
}
private void requestFocus(View view) {
if (view.requestFocus()) {
getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_VISIBLE
);
}
}
}
Registration
package com.example.user.epost;
import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.text.Editable;
import android.text.TextWatcher;
import android.util.Log;
import android.view.View;
import android.view.WindowManager;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ProgressBar;
import android.widget.Toast;
import com.loopj.android.http.JsonHttpResponseHandler;
import com.loopj.android.http.RequestParams;
import org.json.JSONException;
import org.json.JSONObject;
import cz.msebera.android.httpclient.Header;
}
@Override
public void onTextChanged(CharSequence, int i, int i1, int i2) {
@Override
public void afterTextChanged(Editable editable) {
email=tEmail.getText().toString();
String methodname = "checkEmail.jsp";
RequestParams = new RequestParams();
requestParams.put("checkEmail",email);
WebService.post(methodname, requestParams, new
JsonHttpResponseHandler() {
@Override
public void onSuccess(int statusCode, Header[] headers, JSONObject response) {
super.onSuccess(statusCode, headers, response);
try {
if (response.getBoolean("status")) {
emailStatus=true;
tEmail.setError(" Email is already used");
requestFocus(tEmail);
progressBar.setVisibility(View.GONE);
} else {
progressBar.setVisibility(View.GONE);
}
} catch (JSONException e) {
e.printStackTrace();
}
@Override
public void onFailure(int statusCode, Header[] headers, String responseString,
Throwable throwable) {
Log.e("error", responseString);
sendCancelMessage();
}
@Override
public void onRetry(int retryNo) {
super.onRetry(retryNo);
sendCancelMessage();
}
@Override
public void onFailure(int statusCode, Header[] headers, Throwable, JSONObject
errorResponse) {
super.onFailure(statusCode, headers, throwable, errorResponse);
sendCancelMessage();
@Override
public void onUserException(Throwable error) {
super.onUserException(error);
sendCancelMessage();
}
@Override
public void onCancel() {
super.onCancel();
Toast.makeText(getApplicationContext(), "Please check your
internet connection and retry.", Toast.LENGTH_LONG).show();
}
}, getApplicationContext());
}
});
register.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
if (tUname.getText().toString().trim().isEmpty()) {
tUname.setError("Enter Your Username");
requestFocus(tUname);
} else if (tPhone.getText().toString().trim().isEmpty()) {
tPhone.setError("Please Enter your Mobile Number");
requestFocus(tPhone);
} else if (tEmail.getText().toString().trim().isEmpty()) {
tEmail.setError("Please Enter your Email");
requestFocus(tEmail);
}
else if(emailStatus){
tEmail.setError(" Email is already used");
requestFocus(tEmail);
}else if (tPass.getText().toString().trim().isEmpty()) {
tPass.setError("Please Enter your Password");
requestFocus(tPass);
} else {
progressBar.setVisibility(View.VISIBLE);
String methodname = "regUser.jsp";
register.setClickable(false);
final RequestParams = new RequestParams();
requestParams.put("suname", tUname.getText().toString());
requestParams.put("sphone", tPhone.getText().toString());
requestParams.put("semail", tEmail.getText().toString());
requestParams.put("spass", tPass.getText().toString());
WebService.post(methodname, requestParams, new
JsonHttpResponseHandler() {
@Override
public void onSuccess(int statusCode, Header[] headers, JSONObject response) {
super.onSuccess(statusCode, headers, response);
try {
if (response.getBoolean("status")) {
tUname.setText("");
tPhone.setText("");
tEmail.setText("");
tPass.setText("");
register.setClickable(true);
progressBar.setVisibility(View.GONE);
Intent = new Intent(MainActivity.this,
LoginActivity.class);
startActivity(intent);
Toast.makeText(getApplicationContext(), "Registered
Sucessfully", Toast.LENGTH_LONG).show();
Toast.makeText(getApplicationContext(),
response.getString("message"), Toast.LENGTH_LONG).show();
} else {
register.setClickable(true);
progressBar.setVisibility(View.GONE);
Toast.makeText(getApplicationContext(),
response.getString("message"), Toast.LENGTH_LONG).show();
}
} catch (JSONException e) {
e.printStackTrace();
}
}
@Override
public void onFailure(int statusCode, Header[] headers, String responseString,
Throwable throwable) {
Log.e("error", responseString);
sendCancelMessage();
}
@Override
public void onRetry(int retryNo) {
super.onRetry(retryNo);
sendCancelMessage();
}
@Override
public void onFailure(int statusCode, Header[] headers, Throwable, JSONObject
errorResponse) {
super.onFailure(statusCode, headers, throwable, errorResponse);
sendCancelMessage();
@Override
public void onUserException(Throwable error) {
super.onUserException(error);
sendCancelMessage();
}
@Override
public void onCancel() {
super.onCancel();
progressBar.setVisibility(View.GONE);
register.setClickable(true);
Toast.makeText(MainActivity.this, "Please check your
internet connection and retry.", Toast.LENGTH_LONG).show();
}
}, getApplicationContext());
}
}
});
}
private void requestFocus(View view) {
if (view.requestFocus()) {
getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_VISIBLE
);
}
}
}
B . SAMPLE OUTPUT
Login Page
Registration