Professional Documents
Culture Documents
11Q71A0529
K. SSSSDV PRASAD
11Q71A0554
K. BHARADWAJ
11Q71A0552
G. SHIVA PRASAD
11Q71A0530
CERTIFICATE
This is to certify that the project report entitled ANDROID APPLICATION ON
STUDENT FACULTY IDEA SHARING is being submitted by G.K.S.SARMA
in partial fulfillment of the requirements for the award of the Degree of Bachelor
of Technology in Computer Science and Engineering in the academic year to the
Jawaharlal Nehru Technology University. This is a record of bonafide work carried
out by him under my Guidance and Supervision. The result embodied in this thesis
has not been submitted to any other University or Institute for the award of any
degree.
INTERNAL GUIDE
Assistant Professor
EXETERNAL EXAMINER
DECLARATION
11Q71A0529
G. SHIVA PRASAD
11Q71A0530
K. BHARADWAJ
11Q71A0552
K. SSSSDV PRASAD
11Q71A0554
ACKNOWLEDGEMENT
We are very much thankful to our principal Prof. Dr. V.S.V.Prabhakar, for
permitting and encouraging me in doing this project.
ABSTRACT
Interaction. Firstly he should register with his id number into the app and then
log on to the app. After login he can send doubts. This paper represents online
interaction of student and faculty. In this app student can post his doubts
corresponding to subject and branch. At the same time faculty can give answers
to their doubts corresponding to his assigned subjects.This app is mainly
developing for specific college.The main advantage of this app is student and
faculty can download this app and make interaction and share the ideas.
TABLE OF CONTENTS
6
TOPIC
PAGE NO
1. INTRODUCTION
11
11
14
38
42
3.1. Introduction 34
3.2. Software Requirement Specification
3.3. Feasibility study
3.3.1. Economical feasibility
3.3.2. Technical feasibility
3.3.3. Social feasibility
4. SYSTEM DESIGN
48
7
4.1. Introduction
48
50
55
55
57
58
59
60
61
63
64
5. Implementation
66
5.1. Introduction
5.2. Sample data
5.3. Sample code
70
6. OUTPUT SCREENS
89
98
8. CONCLUSION
113
9. BIBLIOGRAPHY
115
116
INTRODUCTION
1. INTRODUCTION
1.1 Introduction
This android application is mainly developing for online interacion about
student and faculty.In this app every student and faculty has its own username
and password for logon to the application.There are three modules inthis app
Admin
Student
Faculty
1.2Objective of the Project
The project Student Faculty Interaction is designed and developed on
Android platform using Java Language and SQLite. This project lends a helping
hand to students in sending theirdoubtsin the app itself. This project is developed to
provide the student with message system and to get the solution/answer issued in
the app itself. This project accepts any inputs and displays the required output
within no time. In this application we are aiming for the student and faculty
interaction ,where in earlier applications and portals of specific colleges, we dont
have idea sharing between the student and faculty. In previous ideas they provide
college portals for the information about the college.
And there give the college details and faculty details and subjects etc, but
they dont give the interaction. They can provide information about the academic
year and student details and further details about
,semester and branch . student academic details of the particular student has been
provide .
10
Details about the faculty in the Particular department under the guidance of the
particular hod. Their subjects and e-books and further details of the subjects have
been provided. but thereis no particular subject to student doubt clarification
interaction program. But here we can provide that idea sharing application through
college portal.
11
SYSTEM REQUIREMENTS
12
2. SYSTEM REQUIREMENTS
Simple
Architecture neutral
Object oriented
Portable
Distributed
High performance
Interpreted
Multithreaded
Robust
Dynamic
Secure
interpreter parses and runs each Java byte code instruction on the computer.
Compilation happens just once; interpretation occurs each time the program is
executed. The following figure illustrates how this works.
You can think of Java byte codes as the machine code instructions for the Java
Virtual Machine(Java VM). Every Java interpreter, whether its a development tool
or a Web browser that can run applets, is an implementation of the Java VM. Java
byte codes help make write once, run anywhere possible. You can compile your
program into byte codes on any platform that has a Java compiler. The byte codes
can then be run on any implementation of the Java VM. That means that as long as
a computer has a Java VM, the same program written in the Java programming
language can run on Windows 2000, a Solaris workstation, or on an iMac.
14
15
Native code is code that after you compile it, the compiled code runs on a specific
hardware platform. As a platform-independent environment, the Java platform can
be a bit slower than native code. However, smart compilers, well-tuned
interpreters, and just-in-time byte code compilers can bring performance close to
that of native code without threatening portability.
What Can Java Technology Do?
The most common types of programs written in the Java programming
language are applets and applications. If youve surfed the Web, youre
probably already familiar with applets. An applet is a program that adheres to
certain conventions that allow it to run within a Java-enabled browser.
However, the Java programming language is not just for writing cute,
entertaining applets for the Web. The general-purpose, high-level Java
16
addresses.
Internationalization: Help for writing programs that can be localized
for users worldwide. Programs can automatically adapt to specific
locales and be displayed in the appropriate language.
17
lightweight
TM
persistence
and
19
Secure
Architectural neutral
Object oriented
Portable
Distributed
High Performance
Interpreted
Multithreaded
Secure
Java is also unusual in that each Java program is both compiled and interpreted.
With a compile you translate a Java program into an intermediate language called
Java byte codes the platform-independent code instruction is passed and run on the
computer.
Compilation happens just once; interpretation occurs each time the program
is executed. The figure illustrates how this works.
You can think of Java byte codes as the machine code instructions for the
Java Virtual Machine (Java VM). Every Java interpreter, whether its a Java
development tool or a Web browser that can run Java applets, is an
implementation of the Java VM. The Java VM can also be implemented in
hardware.
Java byte codes help make write once, run anywhere possible. You can
compile your Java program into byte codes on my platform that has a Java
compiler. The byte codes can then be run any implementation of the Java VM.
For example, the same Java program can run Windows NT, Solaris, and
Macintosh.
Java provides more packages to develop all kind of applications and applets.
Some of them are listed below.
20
java.lang- handles all basic operations and contains the data types.
21
Configurable
Swing's heavy reliance on runtime mechanisms and indirect composition
patterns allows it to respond at runtime to fundamental changes in its settings.
For example, a Swing-based application can change its look and feel at runtime.
22
Further, users can provide their own look and feel implementation, which
allows for uniform changes in the look and feel of existing Swing applications
without any programmatic change to the application code.
Lightweight UI
Swing's configurability is a result of a choice not to use the native host
OS's GUI controls for displaying itself. Swing "paints" its controls
programmatically through the use of Java 2D APIs, rather than calling into a
native user interface toolkit. Thus, a Swing component does not have a
corresponding native OS GUI component, and is free to render itself in any way
that is possible with the underlying graphics APIs. However, at its core every
Swing component relies on an AWT container, since (Swing's) JComponent
extends (AWT's) Container. This allows Swing to plug into the host OS's GUI
management framework, including the crucial device/screen mappings and user
interactions, such as key presses or mouse movements. Swing simply
"transposes" its own (OS agnostic) semantics over the underlying (OS specific)
components. So, for example, every Swing component paints its rendition on
the graphic device in response to a call to component. Paint (), which is defined
in (AWT) Container. But unlike AWT components, which delegated the
painting to their OS-native "heavyweight" widget, Swing components are
responsible for their own rendering.
This transposition and decoupling is not merely visual, and extends to
Swing's management and application of its own OS-independent semantics for
events fired within its component containment hierarchies. Generally speaking,
the Swing Architecture delegates the task of mapping the various flavors of OS
GUI semantics onto a simple, but generalized, pattern to the AWT container.
23
Building on that generalized platform, it establishes its own rich and complex
GUI semantics in the form of the JComponent model. A review of the source of
container. Java and JComponent.java classes are recommended for further
insights into the nature of the interface between Swing's lightweight
components and AWT's heavyweight widgets.
Loosely-Coupled/MVC
The Swing library makes heavy use of the Model/View/Controller
software design pattern, which conceptually decouples the data being viewed
from the user interface controls through which it is viewed. Because of this,
most Swing components have associated models (which are specified in terms
of
Java
can use
various
default
JList: Swing lists, represented by the JList class, display a list of selectable
objects.
JSplit: The JSplitPane component allows you to place two (and only two)
components side by side in a single pane.
JScrollPane: The JScrollPane class is actually just a panel with a hardworking layout manager and some convenient access methods for the
manager.
-JScrollPane control
-Row header
-Column header
-View port
-Horizontal Scrollbar
-Vertical Scrollbar
-Four corners (Upper left, Upper right, lower left)
JTabbedPane: The JTabbedPane is used for creating your own tabbed pane
with tab activation components, very quickly.
JFileChooser:JFileChooser class bundles a directory pane into a handy
interface.
JMenubar:JMenubar uses the Default single Selection model as its data
model because the user can raise, or activate, only one of its menus at a
given time.
JMenuItem: An implementation of an item in a menu. A menu item is
essentially a button sitting in a list. When the user selects the "button", the
action associated with the menu item is performed. A JMenuItem contained
in a JPopupMenu performs exactly that function.
JTree: The JTree class can build up trees out of several different objects,
including a Tree model. JTree extends directly from JComponent and
represent the visual side of any valid tree structure.
DefaultMutableTreeNode:DefaultMutableTreeNode inherits many of its
properties from the MutableTreeNode and TreeNode interfaces.
27
Border Layout: Border Layout lays out a container, arranging and resizing
its components to fit in five regions: north, south, east, west and center. Each
region may contain no more than one component, and is identified by a
corresponding constant: NORTH, SOUTH, EAST, WEST and CENTER.
Null Layout: A null layout arranges components in a user-defined position.
28
The source code for Android is available under free and open source
software licenses. Google publishes most of the code under the Apache License
version 2.0 and the rest, Linux kernel changes, under the GNU General Public
License version 2.
Features of Android:
Android is a powerful operating system competing with Apple 4GS and
supports great features. Few of them are listed below:
Feature
Beautiful UI
Description
Android OS basic screen provides a beautiful and intuitive user
Connectivity
interface.
GSM/EDGE, IDEN, CDMA, EV-DO, UMTS, Bluetooth, Wi-Fi,
Storage
Media
purposes.
H.263, H.264, MPEG-4 SP, AMR, AMR-WB, AAC, HE-AAC,
support
AAC 5.1, MP3, MIDI, OggVorbis, WAV, JPEG, PNG, GIF, and
Messaging
Web browser
BMP
SMS and MMS
Based on the open-source WebKit layout engine, coupled with
Multi-touch
Multi-tasking
Resizable
widgets
Multi-
Language
GCM
Wi-Fi Direct
30
Android Architecture:
Android operating system is a stack of software components which is
roughly divided into five sections and four main layers as shown below in the
architecture diagram.
31
Linux kernel:
At the bottom of the layers is Linux - Linux 2.6 with approximately 115
patches. This provides basic system functionality like process management,
memory management, device management like camera, keypad, display etc.
Also, the kernel handles all the things that Linux is really good at such as
networking and a vast array of device drivers, which take the pain out of
interfacing to peripheral hardware.
Libraries:
On top of Linux kernel there is a set of libraries including open-source
Web browser engine WebKit, well known library libc, SQLite database which is
32
a useful repository for storage and sharing of application data, libraries to play
and record audio and video, SSL libraries responsible for Internet security etc.
Android Runtime:
This is the third section of the architecture and available on the second
layer from the bottom. This section provides a key component called Dalvik
Virtual Machine which is a kind of Java Virtual Machine specially designed
and optimized for Android.
The Dalvik VM makes use of Linux core features like memory
management and multi-threading, which is intrinsic in the Java language. The
Dalvik VM enables every Android application to run in its own process, with its
own instance of the Dalvik virtual machine.
The Android runtime also provides a set of core libraries which enable
Android application developers to write Android applications using standard
Java programming language.
Application Framework:
The Application Framework layer provides many higher-level services to
applications in the form of Java classes. Application developers are allowed to
make use of these services in their applications.
Applications & Components:
You will find all the Android application at the top layer. You will write
your application to be installed on this layer only. Examples of such
applications are Contacts Books, Browser, and Games etc.
33
Description
They dictate the UI and handle the user interaction to the
smart phone screen
They handle background processing associated with an
application.
They handle communication between Android OS and
Receivers
applications.
Content Providers They handle data and database management issues.
Activities:
An activity represents a single screen with a user interface. For example,
an email application might have one activity that shows a list of new emails,
another activity to compose an email, and another activity for reading emails. If
an application has more than one activity, then one of them should be marked as
the activity that is presented when the application is launched.
An activity is implemented as a subclass of Activity class as follows:
public class MainActivity extends Activity { }
Services:
34
A service is a component that runs in the background to perform longrunning operations. For example, a service might play music in the background
while the user is in a different application, or it might fetch data over the
network without blocking user interaction with an activity.
A service is implemented as a subclass of Service class as follows:
public class MyService extends Service {}
Broadcast Receivers:
Broadcast Receivers simply respond to broadcast messages from other
applications or from the system. For example, applications can also initiate
broadcasts to let other applications know that some data has been downloaded
to the device and is available for them to use, so this is broadcast receiver who
will intercept this communication and will initiate appropriate action.
A
broadcast
receiver
of BroadcastReceiver class
and
is
each
implemented
message
as
is
subclass
broadcasted
as
an Intent object.
public class MyReceiver extends BroadcastReceiver {}
Content Providers:
A content provider component supplies data from one application to
others on request. Such requests are handled by the methods of
the ContentResolver class. The data may be stored in the file system, the
database or somewhere else entirely.A content provider component provided as
a sub class of ContentProvider class and must implement a standard set of
APIs that enable other applications to perform transactions.
public class MyContentProvider extends ContentProvider {}
35
Additional Components:
There are additional components which will be used in the construction
of above mentioned entities, their logic, and wiring between them. These
components are:
Components
Fragments
Description
Represents a behavior or a portion of user interface in an
Views
Activity.
UI elements that are drawn onscreen including buttons,
Layouts
lists forms
View hierarchies that control screen format and appearance
Intents
Resources
of the views.
Messages wiring components together.
External elements, such as strings, constants and drawables
Manifest
pictures.
Configuration files for the application.
37
and
2.3.1Software Requirements:
Software requirements deal with defining software resource requirements
and pre-requisite that need to be installed on computer to provide optimal
functioning of an application. These requirements are generally not include in the
software installation package and need to be installed seperately before the
software is installed.
Front end
Back End
Tools used
Operating system
Database
:
:
:
:
:
Java, Android.
java, JSON
Android SDK, Eclipse.
Windows 7
SQL
39
SYSTEM ANALYSIS
3.SYSTEM ANALYSIS
3.1 Identification Of Need
A system analysis is the process of examining a business situation with the
intent of improving it through better procedures and methods. Software design is a
process through which the requirements are translated into a representation of
software. Preliminary design is concerned with the transformation of requirements
into data and software architecture. It must act as a basis for detailed
implementation.
A system analysis is a detailed study of the various operations performed by
a system and their relationships within and outside the system. One aspect of
40
analysis is defining the boundaries of the system and determining whether a new
proposed system should consider other related items or not.
During analysis various data are collected using the toll like data flow
diagrams, interviews, On-line observations, procedural manuals and questionnaires
sensitively to the subjects being interviewed.
Purpose: The main purpose for preparing this document is to give a general
insight into the analysis and requirements of the existing system or situation and
for determining the operating characteristics of the system.
In this application we are aiming for the student and faculty interaction ,where in
earlier applications and portals of specific colleges, we dont have idea sharing
between the student and faculty. In previous ideas they provide college portals for
the information about the college.
And there give the college details and faculty details and subjects etc, but
they dont give the interaction. They can provide information about the academic
year and student details and further details about the student according to year
,semester and branch.Student academic details of the particular student has been
provide. Details about the faculty in the Particular department under the guidance
of the particular HOD.Their subjects and e-books and further details of the subjects
have been provided. butthere is no particular subject to student doubt clarification
interaction program. But here we can provide that idea sharing application through
college portal.
DISADVANTAGES:
. No interaction between faculty and student
Subject wise doubt clarification is not there.
No communication .
this app student can post his doubts corresponding to subject and branch. At the
same time faculty can give answers to their doubts corresponding to his assigned
subjects.This app is mainly developing for specific college.The main advantage of
this app is student and faculty can download this app and make interaction and
share the ideas.
.
ADVANTAGES:
1. By using this application we can reduce the users time and energy.
2. Student can easily share ideas.
3. Faculty can solve student doubts easily.
Economical Feasibility
Technical Feasibility
43
Social Feasibility
44
SYSTEM DESIGN
45
4. SYSTEM DESIGN
4.1 Deign Overview
Design involves identification of classes, their relationship as well as their
collaboration. In objector, classes are divided into entity classes, interface classes and
control classes. The computer Aided Software Engineering (CASE) tools that are
available commercially do not provide assistance in this transition. CASE tools take
advantage of meta data modeling that are helpful only after the construction of the class
diagram. In the fusion method, some object oriented approaches like object modeling
technique (OMT), Classes, Responsibilities, collaborators, etc. are used. Objectory used
the term agents to represent some of the hardware and software systems. Any software
project is worked out by both the analyst and designer. The Analyst creates the usecase
diagram and Designer creates the Class Diagram. But, the designer can do this only after
46
the analyst creates the use case diagram. Once the design Is over, it is essential to decide
which software is suitable for the application.
DFD symbols
Square:
47
It represents a process that transforms incoming data flow(s) into outgoing data
flow(s).
Open Rectangle:
View
subject
login
Student
Database
View&
postmessges
Log out
Faculty
48
4.3UML diagrams
It is a simple graphical formalism that can be used to represent a system in
terms of the input data to the system, various processing carried out on these data,
and the output data is generated by the system.
Modules:
1. Student Module.
2. Administrator Module: Is used to update or modify the database.
3. Faculty Module
Definition:
UML is a general-purpose visual modeling language that is used to specify,
visualize, construct, and document the artifacts of the software system.
UML is a language:
It will provide vocabulary and rules for communications and function on
conceptual and physical representation. So it is modeling language.
UML Specifying:
Specifying means building models that are precise, unambiguous and
complete. In particular, the UML address the specification of all the important
analysis, design and implementation decisions that must be made in developing
and displaying a software intensive system.
UML Visualization:
49
UML Constructing:
UML models can be directly connected to a variety of programming
languages and it is sufficiently expressive and free from any ambiguity to
permit the direct execution of models.
UML Documenting:
UML provides variety of documents in addition raw executable codes.
Figure 4.1 Modeling a System Architecture using views of UML
The use case view of a system encompasses the use cases that describe the
behavior of the system as seen by its end users, analysts, and testers.
50
Structural Things
Behavioral Things
Grouping Things
Annotational Things
Relationships:
Relationships tie the things together. Relationships in the UML are
Dependency
Association
Generalization
Specialization
UML Diagrams:
A diagram is the graphical presentation of a set of elements, most often
rendered as a connected graph of vertices (things) and arcs (relationships).
52
Class Diagram
Component Diagram
Deployment Diagram
Object Diagram
Behavioral Diagrams
Usecase Diagram
Sequence Diagram
Collaboration Diagram
State Chart Diagram
54
55
56
58
59
60
62
4.3.8 Collaboration diagram:A communication diagram in the Unified Modeling Language (UML) 2.0 is
a simplified version of the UML 1.x collaboration diagram.
UML has four types of interaction diagrams:
Sequence diagram
Communication diagram
Timing diagram
63
64
5.IMPLEMENTATION
5. IMPLEMENTATION
5.1 Introduction
Implementation is the stage of the project when the theoretical design is
turned out into a working system. Thus it can be considered to be the most critical
stage in achieving a successful new system and in giving the user, confidence that
the new system will work and be effective.
The implementation stage involves careful planning, investigation of the
existing system and its constraints on implementation, designing of methods to
achieve changeover and evaluation of changeover methods.
65
The implementation part is the most important phase of the project. In this
phase, we code the entire project in the chosen software according to the design
laid during the previous phase. The code has to be in such a way that the user
requirements are satisfied and also not complicated for the user i.e., the user
interface or GUI has to be easy to navigate. The code should be efficient in all
terms like space, easy to update, etc. In this manner, we can complete the coding
part of the project and later it can be sent for testing before being delivered to the
customer.
5.2 Sample data
DATABASE SUPPORT:
Database schema browsing to see the tables, views, and stored
procedures defined in a database
Database schema editing using wizards
Data view to see data stored in tables
SQL and DDL command execution to help you write and execute
more complicated SQL or DDL commands
Migration of table definitions across databases from different vendors
Works with databases, such as MySQL, PostgreSQL, Oracle, IBM
DB2,
Microsoft
SQL
Server,
PointBase,
Sybase,
Informix,
DATABASE DESCRIPTION:
The data pertaining to proposed system is voluminous hence a careful design
of the database must proceed before storing the data in the database.
A database management system provides flexibility in the storage and
retrieval of data. The DBMS is a bridge between the application program, which
determines what data are needed and how they are processed, and the operating
system of the computer, which is responsible for placing data on the magnetic
storage devices.
Characteristics:
Represents complex relationships between data.
Keeps control on data redundancy.
Enforces data access authorization.
Has automatic intelligent backup and recovery procedure for data.
Database Administrator:
A database administrator is a block of code loaded into memory, which
organizes all information (database) between the users.
The DBA takes care of the following things:
Updating database.
Enforces security
Optimizing queries
NORMALIZATION:
First Normal Form:
67
DATA DICTIONARY:
A data dictionary is a file that contains metadata i.e. data about data. This
file is consulates before actual data are read or modified in the database system. It
is also known as system catalogue. Among the types of information that the system
must store all the below items.
Name of the relations
Names of the attributes of each relation
Domains and lengths of attributes
68
5.3.Sample Code
HomeActivity.java
packagein.ganesh.model;
importin.ganesh.adapters.SubjectAdapter;
importin.ganesh.controllers.FacultyController;
importin.ganesh.controllers.StudentController;
importin.ganesh.entities.SubjectEntity;
importin.ganesh.util.SessionManagement;
importjava.util.List;
importandroid.app.Activity;
69
importandroid.content.Context;
importandroid.content.Intent;
importandroid.content.SharedPreferences;
importandroid.content.SharedPreferences.Editor;
importandroid.os.Bundle;
importandroid.view.Menu;
importandroid.view.MenuItem;
importandroid.view.View;
importandroid.widget.AdapterView;
importandroid.widget.AdapterView.OnItemClickListener;
importandroid.widget.ListView;
public class HomeActivity extends Activity{
privateSubjectAdapter adapter;
private List<SubjectEntity>subjectsList;
privateListViewlistView;
introleType;
int id;
String name;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_home);
initComponents();
}
70
if(sharedPreferences.contains(SessionManagement.ROLE)) {
roleType
sharedPreferences.getInt(SessionManagement.ROLE, -1);
id = sharedPreferences.getInt(SessionManagement.ID, -1);
name
sharedPreferences.getString(SessionManagement.NAME, "no name");
}
}
private void initComponents() {
roleType();
if(roleType == 1) {
subjectsList = new StudentController(this).getSubjectEntity(id);
adapter = new SubjectAdapter(this, subjectsList);
initListView(adapter);
} else if(roleType == 2) {
subjectsList = new FacultyController(this).getSubjectEntity(id);
adapter = new SubjectAdapter(this, subjectsList);
initListView(adapter);
}
}
71
MainActivity.java
packagein.ganesh.model;
importin.ganesh.controllers.FacultyController;
importin.ganesh.controllers.StudentController;
importin.ganesh.entities.FacultyEntity;
importin.ganesh.entities.StudentEntity;
73
importin.ganesh.util.SessionManagement;
importin.ganesh.util.ToastMessages;
importandroid.app.Activity;
importandroid.content.Context;
importandroid.content.Intent;
importandroid.content.SharedPreferences;
importandroid.content.SharedPreferences.Editor;
importandroid.os.Bundle;
importandroid.view.View;
importandroid.view.View.OnClickListener;
importandroid.widget.Button;
importandroid.widget.EditText;
importandroid.widget.RadioGroup;
importandroid.widget.RadioGroup.OnCheckedChangeListener;
public class MainActivity extends Activity
{
privateEditText username;
privateEditText password;
privateRadioGroup roles;
privateintroleType;
privateToastMessages messages = new ToastMessages(this);
privateSharedPreferencessharedPreferences;
private Button loginButton;
@Override
74
}
);
loginButton = (Button) findViewById(R.id.loginButton);
loginButton.setOnClickListener(new OnClickListener()
{
@Overridepublic void Click(View arg0)
{
authenticateUser();
}});
}
@Override
pro+tected void onResume()
{
sharedPreferences = getSharedPreferences(SessionManagement.FILENAME,
Context.MODE_PRIVATE);
if(sharedPreferences.contains(SessionManagement.ID)
&&sharedPreferences.contains(SessionManagement.NAME))
{
Intent intent = new Intent(this, HomeActivity.class);
startActivity(intent);
}
super.onResume();
}
public void successfulLogin(String username, int id)
ditor.putString(SessionManagement.NAME, username);
76
editor.putInt(SessionManagement.ROLE, roleType);
editor.commit();
Intent intent = new Intent(this, HomeActivity.class);
startActivity(intent);
}
public void authenticateUser()
{
if(roleType == 1)
{
StudentEntity
entity
=
StudentController(this).loginSuccessful(username.getText().toString(),
password.getText().toString()) ;
new
if(entity != null)
{
successfulLogin(entity.getName(), entity.getId());
}
else
{
messages.showMessage("Login Failed.. Please Try again...!");
}
}
else
{
FacultyEntity
entity
=
FacultyController(this).loginSuccessful(username.getText().toString(),
password.getText().toString()) ;
77
new
if(entity != null)
{
successfulLogin(entity.getName(), entity.getId());
}
else
{
messages.showMessage("Login Failed.. Please Try again...!");
}
}
MessageActivity.java
packagein.ganesh.model;
importin.ganesh.adapters.MessageAdapter;
importin.ganesh.controllers.MessageController;
importin.ganesh.entities.MessageEntity;
importin.ganesh.util.ToastMessages;
importin.ganesh.util.WebResource;
importjava.util.ArrayList;
importjava.util.List;
importjava.util.Timer;
importjava.util.TimerTask;
78
importorg.apache.http.HttpEntity;
importorg.apache.http.HttpResponse;
importorg.apache.http.client.HttpClient;
importorg.apache.http.client.methods.HttpGet;
importorg.apache.http.impl.client.DefaultHttpClient;
importorg.apache.http.util.EntityUtils;
importorg.json.JSONArray;
importorg.json.JSONObject;
importandroid.app.Activity;
importandroid.app.ProgressDialog;
importandroid.content.Context;
importandroid.os.AsyncTask;
importandroid.os.Bundle;
importandroid.util.Log;
importandroid.view.Menu;
importandroid.view.MenuItem;
importandroid.view.View;
importandroid.view.View.OnClickListener;
importandroid.widget.Button;
79
importandroid.widget.EditText;
importandroid.widget.ListView;
public class MessageActivity extends Activity {
privateintsubjectId;
private String name;
privateToastMessages toast = new ToastMessages(this);
private Button sendButton;
privateEditText message;
privateMessageController controller = new MessageController(this);
privateListViewlistView;
privateMessageAdapter adapter;
private List<MessageEntity> list;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_messages);
initSubjectId();
initList();
private void initSubjectId() {
80
@Override
public void onClick(View arg0) {
sendMessage();
});
}
private void initList() {
listView = (ListView) findViewById(R.id.messages);
list = controller.getMessages(subjectId);
adapter = new MessageAdapter(this, list);
listView.setAdapter(adapter);
newgetMessages(this).execute();
}
81
privateintgetLastId() {
MessageEntity entity = list.get(list.size()-1);
returnentity.getId();
}
public void sendMessage() {
if (message.getText().toString().length() > 0) {
if (controller.sendMessage(subjectId, message.getText().toString(),name)) {
toast.showMessage("Message Sent.. Successfully..!");
} else {
toast.showMessage("Message Sending Failed");
}
} else {
toast.showMessage("Blank Message cannot be sent");
}
}
publicclass getMessages extends AsyncTask<String, Void, List<MessageEntity>>
{
private Context context;
privateProgressDialog dialog;
83
newList = getList();
}
}, 1, 1000);
returnnewList;
} catch (Exception ex) {
Log.e("Error", ex.getMessage());
return null;
}
}
private List<MessageEntity>getList() {
try {
Log.e("Control", "Control came here");
HttpClient client = new DefaultHttpClient();
HttpGetget=newHttpGet(WebResource.GET_NEWMESSAGE+"/"+subjectId+"/"
+getLastId());
HttpResponse response = client.execute(get);
intstatusCode = response.getStatusLine().getStatusCode();
Log.i("Status Code", statusCode+"");
if(statusCode == 200) {
85
adapter.notifyDataSetChanged(); }
}
}
}
6.OUTPUT SCREENS
88
6.OUTPUT SCREENS
SCREEN1:
First student logon on his own username and pwd
89
SCREEN2:
The subjects will open based on his subid and branchid
90
SCREEN3:
The student can post his doubt and this message will go to particular faculty
91
SCREEN4:
Faculty can login based on his own username and password
92
SCREEN5:
The subjects will open based on his facultyid and subjectid.
93
SCREEN6:
The faculty can post his solution
94
95
96
outputs, that will be used for testing. During the testing of the unit the specified test
cases are executed and the actual results are compared with the expected outputs.
The final output of the testing phase is the testing report and the error report, or a
set of such reports. Each test report contains a set of test cases and the result of
executing the code with the test cases. The error report describes the errors
encountered and the action taken to remove the error
7.3 Error Messages:
The term error is used in two different ways. Errors refer to the discrepancy
between computed and observed values. That is error refers to the difference
between the actual output of the software and the correct output. In this
interpretation, error essentially is a measure of the difference between the actual
and the ideal. Error is also used to refer to human action those results in the
software containing a defect or a fault. This detection is quite general and
encompasses all phases. The consequence of thinking is the belief that the errors
largely occur during Programming, as it is the can see, the errors occur through the
development. As we can see, the errors occur throughout the development process.
However, the cost of connecting the errors of different phases is not the same and
depends upon when the error was detected and corrected. As one would expect the
greater the delay in detecting an error after it occurs, the more expensive it is to
correct it. Suppose an error occurs during the requirement phase and it was
corrected after the coding then the cost is higher than correcting it in the
requirements phase itself. If there was error in the requirements phase that error
will affect the design and coding also. To correct the error after coding is done
require both the design and the code to be changed there by increasing the cost of
correction.
100
The main moral of this section is that we should attempt to detect the errors
that occur in a phase during the phase itself should not wait until testing to detect
errors. This is not often practiced. In reality, sometimes testing is the sole point
where errors are detected. Besides the cost factor, reliance on testing as a primary
source for error detection and correction should be a continuous process that is
done throughout the software development. In terms of the development phase,
what this means is that we should try to validate each phase before starting the
next.
7.4 Testing Techniques
Testing is a process, which reveals errors in the program. It is the major quality
measure employed during software development. During testing, the program is
executed with a set of conditions known as test cases and the output is evaluated to
determine whether the program is performing as expected. In order to make sure
that the system does not have errors, the different levels of testing strategies that
are applied at differing phases of software development are:
Unit Testing: Unit testing involves the design of test cases that validate that the
internal program logic is functioning properly, and that program inputs produce
valid outputs. All decision branches and internal code flow should be validated. It
is the testing of individual software units of the application .it is done after the
completion of an individual unit before integration. This is a structural testing, that
relies on knowledge of its construction and is invasive. Unit tests perform basic
tests at component level and test a specific business process, application, and/or
system configuration. Unit tests ensure that each unique path of a business process
performs accurately to the documented specifications and contains clearly defined
inputs and expected results.
101
In this testing only the output is checked for correctness. The logical flow of the
data is not checked.
White Box Testing: In this the test cases are generated on the logic of each module
by drawing flow graphs of that module and logical decisions are tested on all the
cases. It has been uses to generate the test cases in the following cases:
Guarantee that all independent paths have been executed.
Execute all logical decisions on their true and false sides.
Execute all loops at their boundaries and within their operational
Execute internal data structures to ensure their validity.
Integration Testing: Integration testing ensures that software and subsystems
work together as a whole. It tests the interface of all the modules to make sure that
the modules behave properly when integrated together.
Integration tests are designed to test integrated software components
to determine if they actually run as one program. Testing is event driven and is
more concerned with the basic outcome of screens or fields. Integration tests
demonstrate that although the components were individually satisfaction, as shown
by successfully unit testing, the combination of components is correct and
consistent. Integration testing is specifically aimed at exposing the problems that
arise from the combination of components.
7.4.3 Test Results: All the test cases mentioned above passed successfully. No
defects encountered.
System Testing: The purpose of testing is to discover errors. Testing is the process
of trying to discover every conceivable fault or weakness in a work product. It
103
Invalid Input
Functions
Output
exercised.
Systems/Procedures
104
Test Results: All the test cases mentioned above passed successfully. No defects
encountered.
Validation Testing: The system has been tested and implemented successfully and
thus ensured that all the requirements as listed in the software requirements
specification are completely fulfilled. In case of erroneous input corresponding
error messages are displayed.
Compilation Testing: It was a good idea to do our stress testing early on, because
it gave us time to fix some of the unexpected deadlocks and stability problems that
only occurred when components were exposed to very high transaction volumes.
Execution Testing: This program was successfully loaded and executed. Because
of good programming there was no execution error.
Output Testing: The successful output screens are placed in the output screens
section
TEST
CASE
CONDIT
IONS
BEING
CHECK
ED
EXPECTED
BEHAVIOUR
OBSERVED
BEHAVIOUR
STAT
US
TEST
TYPE
Username=
Check
validation
Login not
successful
Login not
successful
please enter
correct uname
and pwd
Pass
Black
box
testing
Password=
Username=c
sefirstyear
Password=
csefirstyear
Check
If valid subjects
validation
will open
If valid subjects
will open
106
Pass
Black
box
testing
8.
TEST
CASE
CONDIT
IONS
BEING
CHECK
ED
EXPECTED
BEHAVIOUR
OBSERVED
BEHAVIOUR
STAT
US
TEST
TYPE
Username=
Check
validation
Login not
successful
Login not
successful
please enter
correct uname
and pwd
Pass
Black
box
testing
Password=
Username=c
sefirstyear
Password=
csefirstyear
Check
If valid subjects
validation
will open
If valid subjects
will open
107
Pass
Black
box
testing
TEST
CASE
CONDIT
IONS
BEING
CHECK
ED
EXPECTED
BEHAVIOUR
OBSERVED
BEHAVIOUR
STAT
US
TEST
TYPE
Blank
message
Check
validation
Message
cannot sent
Blank message
cannot sent
Pass
Black
box
testing
Message with
text
Check
validation
Message sent
successfully
Pass
Message sent
successfully
109
Black
box
testing
110
8.CONCLUSION
8.CONCLUSION
111
112
9. BIBLOGRAPHY
9.BIBLOGRAPHY
113
REFERNCES:
1.Java complete reference, Herbert schield,7th edition, Mc.Graw hill.
2.The definitive guide to SQLite,Mike Owens.
3. The Unified Modeling Language Reference Manual,James Rumbaugh,2nd
edition.
4. Expert Android, by SatyaKomatineni, Dave MacLean ,Dave MacLean
WEB LINKS:
1.www.sun.com
2.www.android.com
3.www.developers.android.com
4.www.SQLite.com
STEP1:
The student and faculty need to install the app in android mobile.The
database must be always should be in activemode.
The student should enter his own username and password
STEP2:
The subjects will open based on his subid and branched and year after log in
successfully.student can post his doubts by click on subject.
STEP3:
The student can post his doubts by entering text message at bottom of the
screen.after sending message it shows message send successfully.
STEP4:
The faculty can login based on his own username and password.
Faculty can view student posts by click on subject.
STEP5:
Faculty can send his solution to students by click on subjects.
STEP6:
The student and faculty can logout successfully by click on logout button
115